On sunny days,  the Roman citizens of Ostia could be found on a long stone bench near the Forum. Friends and neighbors exchanged  news and gossip while simultaneously attending to more... urgent business. These public latrines could sit up to 20 Romans at a time, draining waste in water conduits below. Today, most cultures consider trips to the restroom to be a more private occasion. But even when going alone, our shared sewage infrastructure is one of the most pivotal inventions  in the history of humanity. While many ancient religious texts  contain instructions for keeping waste away from drinking water and campsites, waste management took a more familiar shape as early as 3000 BCE. Ancient Mesopotamian settlements often had clay structures made for squatting or sitting  in the most private room of the house. These were connected to pipes which used running water to move waste into street canals and cesspits. Water infrastructure like this flourished  in the Bronze Age, and in some parts of the Indus Valley, nearly every house had a toilet connected to a citywide sewage system. Ancient Cretan palaces even offered a manual flushing option. Researchers can’t say for certain  what inspired these early sewage systems, but we do know that waste management is essential for public health. Untreated sewage is a breeding ground for dangerous microorganisms, including those that cause cholera, dysentery, and typhoid. It would be several millennia before scientists fully understood the relationship between sewage and sickness. But the noxious odors of sewage have recorded associations with disease as early as 100 BCE. And by 100 AD, more complex  sanitation solutions were emerging. The Roman Empire had continuously  flowing aqueducts dedicated to carrying waste  outside city walls. Chinese dynasties of the same period  also had private and public toilets, except their waste  was immediately recycled. Most household toilets fed into pig sties, and specialized excrement collectors gathered waste from public latrines to sell as fertilizer. In China, this tradition of waste  management continued for centuries, but in Europe the fall of the Roman Empire brought public sanitation  into the Dark Ages. Pit latrines called “gongs”  became commonplace, and chamber pots were frequently dumped into the street. Castles ejected waste from tall windows into communal cesspits. At night, so-called gong farmers  would load up the waste before traveling beyond city limits  to dump their cargo. Europe's unsanitary approach persisted for centuries, but toilets themselves underwent some major changes. By the late Middle Ages,  most wealthy families had commode stools— wooden boxes with seats and lids. And in the royal court of England, the commodes were controlled by the Groom of the Stool. In addition to monitoring  the king’s intestinal health, the Groom’s... intimate relationship  with the monarch made him a surprisingly influential figure. The next major leap in toilet technology came in 1596, when Sir John Harrington designed  the first modern flush toilet for Queen Elizabeth. Its use of levers to release water  and a valve to drain the bowl still inform modern designs. But Harrington’s invention  stank of sewage. Thankfully, in 1775,  Scottish inventor Alexander Cumming added a bend in the drainpipe  to retain water and limit odors. This so-called S-trap was later improved into the modern U-bend by Thomas Crapper— though the term “crap” predates  the inventor by several centuries. By the turn of the 19th century, many cities had developed  modern sewage infrastructure and wastewater treatment plants, and today, toilets have a wide range of features, from the luxurious to the sustainable. But roughly 2 billion people still don’t  have their own toilets at home. And another 2.2 billion  don’t have facilities that properly manage their waste, putting these communities  at risk of numerous diseases. To solve this problem, we’ll need  to invent new sanitation technologies and address the behavioral, financial,  and political issues that produce inequity  throughout the sanitation pipeline.