Particularly successful cities have themselves become independent Great Powers. This applies not only to Genoa but also to Venice, which has been able to retain its independence for over a thousand years. Until 1797, Venice was the capital of the republic of the same name and for a long time one of the largest European cities. Until the 16th century, Venice was one of the world’s most important trading capitals and at times had the largest merchant and war fleet in the world! Despite its own limited resources and relatively small and scattered dominion, Venice was able to play a leading role in the Mediterranean region for a long time. Besides diplomatic skill, this was mainly due to the economic strength of the city, which for centuries had a quasi-monopoly position on trade with the Orient, especially for salt and grain.
The legendary founding date of 421 dates back to the twilight of the Roman Empire, a time when the surrounding inhabitants fled the invading Visigoths and Huns into the lagoon of Venice and settled there, as it was easier to defend. Venice was originally part of the Byzantine Empire and formally retained this status until about 900. In fact, however, Venice became independent with the appointment of the first Doge in 697. 
It is remarkable that Venice managed to remain an independent community with its own diplomacy and its own military power amid changing alliances between the major and regional powers for a period of over 1,000 years. And these were not quiet times in that region. The list of powers and competitors with which Venice had to contend, and which it often outlived, includes the Lombards, the Byzantines, the Holy Roman Empire, the Papal States, free cities such as Genoa, Bologna and Pisa, the Normans, Hungary, Croats, Habsburgs, and Ottomans, and finally Spain and France. A Venetian patrician is said to have referred to the secret recipe of the city in the 16th century:
In this cruel war, in which all the kings of the world fought against us, no citizen of this city was killed. Everything was achieved with money and the lives of foreign mercenaries.
In foreign policy, the Republic relied on diplomacy, efficient information gathering, and pragmatism. Venice kept out of ideological and religious disputes as far as possible. The economic well-being of the city took precedence over the expansion of political power. Inside, careful attention was paid to maintaining a balance of power between the various groups and maintaining checks on power wielded by the state authorities. The election process was extremely complicated, and it could not be foreseen who was eventually elected, but this prevented election campaigns and the bribing of voters. This is one of the reasons for the unique stability of this state in a troubled Europe: in 1,100 years not a single government was overthrown!  The domination of a single family, as had become customary in the other city-states of northern Italy, was prevented. This was not always achieved without conflicts, but overall it was possible to prevent too much concentration of power. Venice also had a reputation for political stability and personal freedom for its citizens, which was the exception in Europe at the end of the Middle Ages. The historian Gilmour writes:
The patrician and the gondoliere lived in different social conditions, but legally they were equal. Legal privileges for the nobility were unknown. Civil and criminal justice was fair overall, and women enjoyed unique rights… The foreign propaganda about dungeons in which political prisoners languished was pure slander… Religion was important, but it remained subordinate to the state: The Doge and not the bishops were the guarantors of the Republic of Venice. “Veneziani, poi cristiani”, this is how the inhabitants used to describe themselves: first Venetians and then Christians. Such self-confidence naturally annoyed the Popes, who repeatedly pronounced an interdict against Venice… The achievements of Venice were difficult for the rest of Europe to bear. The success of the republic was too blatant and too glamorous for jealous rivals to accept. The Venetians were called greedy and insidious because they traded with the Ottomans as long as there was no war. 
Only with the advent of the Atlantic and Indian trade and the strengthening of the territorial states did Venice lose at least relative trade power and sunk to local size. This is when the city changed to a strategy of diversification through the mass production of glass beads and the manufacturing of artful pieces of glass. The region is still known for the latter. Venice was able to maintain its independence until 1797 when the city was occupied by Napoleon. Despite its final downfall, Free Cities can learn a lot from Venice.
- Gilmour 2013, 103-122; Cf. also the instructive article at Wikipedia: https://en.wikipedia.org/wiki/Republic_of_Venice
- Gilmour 2013, 121 Gilmour emphasizes the extraordinarily successful development of Venice over 1,100 years in his book, which is well worth reading, and concludes that joining the united Italy was the worse option for Venice.
- Gilmour 2013, 111-113, 117.