Venice appeared as a kind of, but not quite, sovereign polity in the late 700s and 800s. Venetian society, no longer governed directly by Constantinople, nor really independent, had to survive between the two super-powers of their time, Byzantium and the Carolingian Empire.
Pigs and bulls lose in the alleyways, wooden castles smashed with maces, human towers and funambulists. The Venetian carnival was quite unlike the modern replica.
Venice produced and exported Theriac, an ancient wonder medicine for just about every ailment imaginable. It was a flourishing business for centuries, and an important part of the Venetian economy.
During the 1400s, Venice had created defences against the recurring outbreaks of the plague, and they kept Venice mostly safe for the following centuries. Mostly safe.