New Open-Source Tool Visualizes PostgreSQL Internals as a 3D City Simulation

Developer Nikolay Samokhvalov released PGSimCity, an open-source, browser-based tool that turns PostgreSQL's internal mechanics into an interactive 3D spatial simulation resembling a city-builder game, with the explicit goal of making notoriously abstract database internals easier to reason about for backend engineers and site reliability engineers. Rather than reading through EXPLAIN ANALYZE output or prose-heavy documentation, users can watch a visual representation of how queries move through the engine, how the planner makes decisions, and how kernel-level execution unfolds, with client connections entering through a Postmaster supervisor, shared_buffers represented as a central grid, and storage internals like B-trees and the Free Space Map rendered as excavated districts. The project runs entirely in the browser using PGlite, which compiles a real, in-memory Postgres instance to WebAssembly, and it lets users trigger real operational pathologies, such as forcing clock-sweep eviction races with a tiny shared_buffers setting, or simulating restricted work_mem to watch sort and hash-aggregate operations spill to disk. The project is hosted on GitHub under an Apache-2.0 license, drew significant discussion on Hacker News about AI-assisted systems visualization, and has already inspired a ClickHouse-focused spin-off called CHSimCity. For teams running Postgres in production, the practical value is less the simulation itself and more what it represents: understanding query planning and execution paths is essential for diagnosing slow queries, tuning indexes, and reasoning about concurrency and locking behavior, and tools that build that intuition visually can shorten onboarding time for engineers who operate or debug Postgres-backed systems but have not yet developed a mental model of what happens between a query being issued and a result coming back. Given Postgres's continued rise as the default database choice across the industry, tooling that makes its internals more approachable, rather than just its SQL surface, fills a real gap in how backend and platform teams train engineers on the systems they depend on.

Source

View on ShipDigest