<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/pgsimcity-a-3d-city-that-visualizes-what-s-actually-happening-inside-postgresql-2openukcw" -->

---
title: PGSimCity: A 3D City That Visualizes What&#x27;s Actually...
description: Nikolay Samokhvalov built PGSimCity, a browser-based 3D city visualization that represents what&#x27;s happening inside a running PostgreSQL 18 cluster in real...
canonical: https://daily.dev/posts/pgsimcity-a-3d-city-that-visualizes-what-s-actually-happening-inside-postgresql-2openukcw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: PGSimCity: A 3D City That Visualizes What&#x27;s Actually Happening Inside PostgreSQL | daily.dev
og:description: Nikolay Samokhvalov built PGSimCity, a browser-based 3D city visualization that represents what&#x27;s happening inside a running PostgreSQL 18 cluster in real...
og:url: https://daily.dev/posts/pgsimcity-a-3d-city-that-visualizes-what-s-actually-happening-inside-postgresql-2openukcw
og:image: https://api.daily.dev/og/posts/2OpeNUKCw.png
og:image:alt: PGSimCity: A 3D City That Visualizes What&#x27;s Actually Happening Inside PostgreSQL
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# PGSimCity: A 3D City That Visualizes What's Actually Happening Inside PostgreSQL

**[Collections](https://daily.dev/sources/collections)** · 2 min read · 1 upvotes · 0 comments

## Summary

Nikolay Samokhvalov built PGSimCity, a browser-based 3D city visualization that represents what's happening inside a running PostgreSQL 18 cluster in real time. It's not a scripted animation - it runs PGlite, a WebAssembly build of actual Postgres, so shrinking shared_buffers, restricting work_mem, or holding long transactions open produces real Postgres behavior driving the city's traffic and buildings. The rendering uses three.js with TypeScript state machines for simulation logic. The prototype was built largely through LLM prompting checked against Postgres source code, and has already spawned CHSimCity, a ClickHouse equivalent. The project is Apache-2.0 licensed and open for contributions, with a roadmap covering statement-pooling visualization and I/O tuning parameters.

## Content

Nikolay Samokhvalov built something I didn't know I needed: a browser-based 3D city where the buildings and traffic represent what's happening inside a running PostgreSQL 18 cluster.

The idea is simple once you see it, but the execution is the interesting part. Concepts like `shared_buffers`, WAL, autovacuum, and checkpoint storms are notoriously hard to teach because they're invisible - you can read about clock-sweep eviction all day and still not have a gut feeling for when it actually kicks in. PGSimCity tries to fix that by turning these mechanics into something you can watch happen, in real time, as a small virtual city.

It's not a fake simulation dressed up with pretty visuals either. Under the hood it runs PGlite, a WebAssembly-compiled build of actual Postgres, right in your browser. So when you shrink `shared_buffers` and watch eviction go haywire, or restrict `work_mem` until temp files start spilling to disk, or hold a long transaction open until autovacuum starts starving - that's real Postgres behavior driving the visualization, not a scripted animation. The rendering runs on three.js, with isolated TypeScript state machines handling the simulation logic behind the scenes.

What caught my attention on Hacker News wasn't just the tool itself but how it got built. The prototype came together through heavy LLM prompting, checked and corrected against the actual Postgres source code - which is a pretty good template for how this kind of AI-assisted technical visualization work might go in general. It's already spawned a spin-off: CHSimCity, doing the same thing for ClickHouse.

The project is Apache-2.0 licensed and open for contributions. The roadmap includes statement-pooling visualization and alignment with `io_combine_limit` and `effective_io_concurrency`, so there's more coming for anyone who wants to dig into connection pooling or I/O tuning behavior next.

If you're a backend developer, SRE, or database architect who's ever struggled to explain (or understand) why a checkpoint storm happens, this is worth a look.

## Questions this post answers

### How does PGSimCity visualize PostgreSQL internals in the browser?

PGSimCity renders a 3D city using three.js where buildings and traffic represent live PostgreSQL 18 activity. It runs PGlite, a WebAssembly-compiled build of actual Postgres, so behaviors like shrinking shared_buffers to trigger eviction, restricting work_mem to cause temp file spills, or holding long transactions to starve autovacuum are driven by real Postgres engine behavior, not scripted animation.

_Developers untangling autovacuum or buffer eviction issues can find deep-dive explainers like this on daily.dev._

### What license is PGSimCity released under and can I contribute to it?

PGSimCity is released under the Apache-2.0 license and is open for community contributions. Its roadmap includes adding statement-pooling visualization and aligning the simulation with io_combine_limit and effective_io_concurrency settings for connection pooling and I/O tuning behavior.

_Anyone evaluating open source database tooling can track projects like this on daily.dev._

### Is there a ClickHouse equivalent of PGSimCity?

Yes, a spin-off called CHSimCity applies the same live 3D visualization approach to ClickHouse instead of PostgreSQL. It followed directly from PGSimCity's success and reuses the same concept of turning invisible database engine mechanics into a real-time simulation you can watch and interact with.

_Engineers comparing Postgres and ClickHouse internals can follow tooling like this on daily.dev._

---

Tags: [#postgresql](https://daily.dev/tags/postgresql), [#webassembly](https://daily.dev/tags/webassembly), [#data-visualization](https://daily.dev/tags/data-visualization), [#threejs](https://daily.dev/tags/threejs)

[View this post on daily.dev](https://daily.dev/posts/pgsimcity-a-3d-city-that-visualizes-what-s-actually-happening-inside-postgresql-2openukcw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"PGSimCity: A 3D City That Visualizes What's Actually Happening Inside PostgreSQL","url":"https://daily.dev/posts/pgsimcity-a-3d-city-that-visualizes-what-s-actually-happening-inside-postgresql-2openukcw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/pgsimcity-a-3d-city-that-visualizes-what-s-actually-happening-inside-postgresql-2openukcw"},"datePublished":"2026-08-17T17:40:28.676Z","dateModified":"2026-08-17T17:41:09.639Z","description":"Nikolay Samokhvalov built PGSimCity, a browser-based 3D city visualization that represents what's happening inside a running PostgreSQL 18 cluster in real...","image":"https://pbs.twimg.com/media/HP8QhhTXEAA8pX-.jpg","thumbnailUrl":"https://pbs.twimg.com/media/HP8QhhTXEAA8pX-.jpg","isAccessibleForFree":true,"articleSection":"Collections","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Collections","logo":"https://media.daily.dev/image/upload/s--fk_6ycEi--/f_auto,q_auto/v1780996001/logos/collections?_a=BAMAMiWQ0","url":"https://daily.dev/sources/collections"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/pgsimcity-a-3d-city-that-visualizes-what-s-actually-happening-inside-postgresql-2openukcw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"postgresql,webassembly,data-visualization,threejs","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Collections","item":"https://daily.dev/sources/collections"},{"@type":"ListItem","position":3,"name":"PGSimCity: A 3D City That Visualizes What's Actually Happening Inside PostgreSQL"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/pgsimcity-a-3d-city-that-visualizes-what-s-actually-happening-inside-postgresql-2openukcw#faq","mainEntity":[{"@type":"Question","name":"How does PGSimCity visualize PostgreSQL internals in the browser?","acceptedAnswer":{"@type":"Answer","text":"PGSimCity renders a 3D city using three.js where buildings and traffic represent live PostgreSQL 18 activity. It runs PGlite, a WebAssembly-compiled build of actual Postgres, so behaviors like shrinking shared_buffers to trigger eviction, restricting work_mem to cause temp file spills, or holding long transactions to starve autovacuum are driven by real Postgres engine behavior, not scripted animation. Developers untangling autovacuum or buffer eviction issues can find deep-dive explainers like this on daily.dev."}},{"@type":"Question","name":"What license is PGSimCity released under and can I contribute to it?","acceptedAnswer":{"@type":"Answer","text":"PGSimCity is released under the Apache-2.0 license and is open for community contributions. Its roadmap includes adding statement-pooling visualization and aligning the simulation with io_combine_limit and effective_io_concurrency settings for connection pooling and I/O tuning behavior. Anyone evaluating open source database tooling can track projects like this on daily.dev."}},{"@type":"Question","name":"Is there a ClickHouse equivalent of PGSimCity?","acceptedAnswer":{"@type":"Answer","text":"Yes, a spin-off called CHSimCity applies the same live 3D visualization approach to ClickHouse instead of PostgreSQL. It followed directly from PGSimCity's success and reuses the same concept of turning invisible database engine mechanics into a real-time simulation you can watch and interact with. Engineers comparing Postgres and ClickHouse internals can follow tooling like this on daily.dev."}}]}
```

