Much of human history was not so fortunate.
Lacking indoor plumbing, the "privy" or "garderobe" was no more than a cramped alcove with a hole for straddling that dropped waste either to a deep pit or outside. Many castles built their garderobes to jut out from the exterior walls so that waste dropped into a ditch or moat. King Edward I made garderobes a requirement in his extensive Welsh castle-building program.
This design element for castles had one potential problem: the privy that extended out from the walls so the waste could simply fall outside the castle was a potential access point for invaders. An exposed waste shaft at Chateau Gaillard overlooking the Seine in Normandy (owned by King John of England) was low enough to the ground that it allowed forces of Philip II of France to sneak inside. A stone wall was built around the base to prevent further intrusions.
When Mayor Dick Whittington took office, he constructed a 128-seat public toilet facility called "Whittington's Longhouse" that dumped into the Thames so that high tide would flush the waste away. Many municipalities had public toilets, since health and hygiene were important for everyone's safety. They were often placed on bridges over rivers, as in York over the Ouse.
Whatever innovations were designed to drop waste away or flush it away with rivers or tides, there were still unsavory issues to deal with. The smell was always a problem. Also, in situations where refuse was not dropped into rivers but lay where it fell, paid positions were available for people to remove the waste and clean and fix the latrines. Maintenance was important, because unlike the stone example illustrated above, public latrines were built of wood, and wood needed to be replaced occasionally.
Tomorrow I'll share an incident in which architecture failed regarding a latrine. Prepare yourselves.