PGSimCity is an open-source teaching tool that turns PostgreSQL internals into a 3D city running in the browser. Created by Nikolay Samokhvalov, it is designed to help backend developers, database architects, and SREs connect SQL behavior to lower-level engine mechanics.

The simulation maps PostgreSQL 18 components into visible districts. Client connections arrive at the Postmaster, worker processes move along a backend avenue, shared buffers become a frame grid, and storage structures such as heap pages, B-trees, Free Space Maps, and Visibility Maps sit below the city.

The project is not just a static diagram. Users can follow statement lifecycles through parse, rewrite, plan, and execute stages, and trigger operational problems such as small shared_buffers causing eviction pressure, work_mem limits causing sort spills, long transactions starving autovacuum, or checkpoint storms flooding WAL.

Samokhvalov said the initial prototype involved extensive LLM prompting before manual calibration against PostgreSQL source code. PGSimCity also uses PGlite to run in-memory PostgreSQL compiled to WebAssembly, making the educational model interactive without local setup.