The first pooling resource we will explore is called PgBouncer. This is a very popular connection pool written by Skype developers in 2007. The project has been maintained by various developers in subsequent years, but its role in lowering the cost of connecting to PostgreSQL has never changed.
PgBouncer allows PostgreSQL to interact with enormous number of clients than is otherwise possible because its connection overhead is much lower. Instead of huge libraries, accounting for temporary tables, query results, and other expensive resources, it essentially just tracks each client's connection in a queue. Then, based on the configuration settings, it creates several PostgreSQL connections and assigns them to the connections on a first-come, first-served basis.
This means hundreds, or even thousands of database clients, can theoretically share a single...