It might seem banal, but this is a surprisingly poignant question. It is a question that people living on every rocky or sandy Mediterranean island had to deal with: How to obtain and store drinking water, especially given the dry Mediterranean summer.
The answer is that every Mediterranean island community too populous to rely on seasonal torrents subsisted on rainwater. This means that Venice, built on sandbars in a brackish-water lagoon (thus absolutely no freshwater, not even seasonally) was entirely and completely reliant on rainwater.
If you visit Venice, you might notice inexplicable marble constructions topped with domed copper covers in the center of all city squares denominated Campi (as well as in the odd courtyard). These are commonly called Pozzi, meaning "Wells," but it might be more correct to call them "Cisterns." Their construction would have been a major project for the community: the whole area of the Campo would be excavated ten to fifteen meters down, and the base and sides of the crater-like result would be lined with waterproof stone and brick, isolating the cistern from the muddy substrate. The well would then be built up, tower-like, in permeable stone. Around the well, the excavation would be filled up with freshwater sand (typically from the nearby river Piave) topping off the whole thing with pavement or soil. Thus rainfall during the damp winters (augmented, as the city drew denser, by strategic rooftop drainpipes) would filter down through the dirt or flagstones and into the sand, creating a small water table that could be accessed by the artificial well.
The first humans to populate the northeastern lagoons had collected water from simpler open-air rainwater cisterns. Only in the ninth century did the Venetians begin building the elaborate cisterns described above, and in the first half of the 14th century their construction and administration became the purview of the Republic's Major Council (save, of course, for the wells in courtyards of private homes and religious buildings, which themselves could even become elaborate centerpieces carved in marble). As Venice's campi exchanged orchards and gardens for pavement and market stalls, the government would endeavor to build these cisterns wherever there was enough room to do so. As the campi were paved over, the authorities could even install grates, facilitating the filtration of water into the sandy base. Those who made a living carrying water from the wells to households were even organized in a cooperative in the second half of the 14th century.
Indeed, that of the Water Carrier, called Acquaioli, might seem like a banal profession. However, in Venice there was an entire economy built around the supply of water. Fear of poison (both intentional and accidental) meant that access to the wells was strictly regulated, and power of enforcement and oversight was granted to a multitude city offices' agents (fanti working for the overseers for the Water, Healthcare, and City, which in Venetian were called the Provveditore alle Acque, Provveditore alla Sanità , and Provveditore per il Comun). The primary line of defense against improper use of the city wells would be local leaders, typically the parish priest in the church overlooking the Campo, entrusted with the keys and tasked with opening it up for the acquaioli twice a day. But a well's greatest threat wasn't misuse, but rather an issue born out of the fact that Venice is fundamentally built on low-lying sandbars in a tidal basin: the feared Aqua Alta, or high water resulting from an anomalous tide, could flood the Campi and filter through to the cisterns. If this happened, the people had no choice but to dig up the Campo, knock down the well, and replace the sand.
In the first years of the 20th century, plumbing systems became accessible to ordinary people in Venice and were phased-in by the city utilities board. Today, venetian wells are sealed shut and kept purely for their historic and decorative value; if you were to dig up a Venetian Campo, rather than sand you're more likely to find phone lines, high-tension power wires, and sewer pipes. However, for centuries the collection of rainwater and its associated infrastructure was an important responsibility of the local government.