Tuesday, July 28, 2026

FBSimCity: an explorable city that shows how Firebird works

I've published FBSimCity, an interactive visualization of Firebird internals: an explorable isometric city where every building is a subsystem from the classic Conceptual Architecture for Firebird paper (Chan & Yashkir), and queries commute through the pipeline as glowing particles — REMOTE harbor → Y-valve → DSQL → JRD, with the lock manager tower watching over it.

The simulation is Firebird-flavored throughout:

  • MGA record versions stack a floor on a tower with every UPDATE, and the towers redden as chains grow.
  • Next / OAT / OIT counters run live on the Transaction Hall facade. Flip on a long-running transaction and watch the OIT pin garbage collection while the version towers pile up — Firebird's version of bloat, visible in about twenty seconds.
  • Cooperative GC and a sweep truck tour the tables, correctly refusing to demolish anything the OIT still protects.
  • A page cache flashes hits and misses above the excavation that is the database file, where careful write ordering — not a WAL — keeps things consistent.
  • Lock waits and deadlock rollbacks queue at the lock manager tower.

Version 0.3.0 adds a live version-chain inspector: click the Record Version Towers and watch the busiest table's chain update in real time, each version tagged with the transaction that wrote it and marked reachable or garbage against the current OIT. There is also a guided tour, a step-by-step query trace that walks one UPDATE through every station, six scenario presets (cache thrash, stuck OIT, lock contention, rush hour...), and a data-page anatomy diagram.

If you prefer reading to clicking, The life of a query is the same sixteen-station pipeline as an accessible, keyboard-navigable page that works with a screen reader.

You can share a reproducible state with deep links, for example this one drops you into a stuck-OIT city fifty simulated seconds in, with the chain inspector already open.

Try it: mariuz.github.io/FBSimCity
Source: github.com/mariuz/FBSimCity (MIT, plain HTML/JS, no build step, no dependencies)

Inspired by PGSimCity, the PostgreSQL equivalent. It is a scaled model for intuition, not an emulator — no SQL is parsed and no Firebird code runs in your browser — so corrections from people who know the engine internals are very welcome.

FBSimCity is an independent educational project, not affiliated with or endorsed by the Firebird Project. Firebird® is a registered trademark of the Firebird Foundation Incorporated.

No comments: