Skip to content
AFM Studio
  • Pages

    AFM Studio
  • Work
  • Lab
  • About
  • CV
  • Contact
  • Projects

    AksaraA searchable library for Otorita IKN's knowledge, where the server checks every reader's access across three levels
  • Daily TaqwaTamper-resistant prayer attendance system for ~2,000 OIKN government employees at Masjid Negara IKN
  • Lantara v2A permit engine for Otorita IKN where administrators add new permit types from a screen, without a developer
  • eKiosk IKNTwo control rooms for Nusantara: kiosk content management and live bus tracking with arrival times that grade themselves
  • E-Monev IKNA monitoring platform for Nusantara's 23-year build, tracking every unit's quarterly progress against 24 national KPIs
  • JDIH OIKNOIKN's public legal document portal, with a controlled publishing workflow and AI summaries that never leave the server
  • Jejak PenanamanA check-in app for IKN tree-planting events that proves each participant was on site with a geofenced selfie
  • Dashboard SAKTIA nightly pipeline and dashboard that replaces OIKN's manual budget downloads for all six of its budget units
  • DoseRxA bedside dose calculator for 127 drugs that rounds each dose to tablets and syrups Indonesian pharmacies sell
  • CubiqA speedcubing trainer with competition-grade timing and a solver I wrote for each of the 8 major puzzles
  • ScimotionAn interactive science library of 86 articles, each explained next to animations the reader can control
  • WA Daily Scrum BotA WhatsApp bot that chases missing standup reports for a 14-person team and flags tasks stuck for days

↑ ↓ to move · Enter to open · Esc to close

Isolation Anomaly

An interactive score of two clashing database transactions, checked against 220 recordings from four real databases

Screenshots
database engines modelled from cited docs
5
runs recorded on real databases
220
scenarios, including write skew
11
vendor documentation citations behind the rules
328
On this page

The problem

Every application developer picks a database isolation level, the setting that decides how much two simultaneous operations may interfere. Almost everyone keeps the default, and almost nobody can say what it protects them from. The failure modes are taught as a list of names, dirty read, non-repeatable read, phantom, that people recite in interviews and rarely understand.

The most dangerous failure isn't on that list. In write skew, two transactions read the same data, each checks a rule ("someone else is still on call, so I can go off call"), and each writes a different row. Nothing collides, both go through, and the rule is broken. This is how on-call rosters empty and rooms get double-booked. Snapshot isolation doesn't prevent it, and it is what most defaults amount to. Worse, the level names mean different things in different databases. Oracle's "SERIALIZABLE" still allows write skew.

What I built

Real databases came first

A developer might make a production decision from what this tool shows, so I couldn't build the simulator from what I believed about databases. Before the simulator existed, I wrote a harness that starts real PostgreSQL, MySQL, SQL Server and Oracle in containers and runs every schedule against them. It records every value read, every error code, where each transaction waited and whether it finished. Those 220 recordings are the answer key. When the simulator and a recording disagree, the simulator is wrong.

One engine, five rule files

There is one simulator. Each database is a file of rules: what each level name really means, when locks are taken, what conflicts and which error code comes back. The comparison between databases is only fair if the machinery is shared, and a database expert can review a rule file without reading my code. Every rule cites the vendor's documentation, and the deploy fails if a citation is missing.

A separate checker names the anomaly

The code that spots an anomaly shares nothing with the simulator. It reads the finished run and checks each anomaly against its published definition. A checker built on the simulator's assumptions would approve the simulator's bugs. Every scenario is tested both ways: the anomaly must appear at levels that allow it, and must not appear at levels that prevent it.

The tool refuses when it can't know

SQL Server picks which transaction to kill in a deadlock by a cost estimate, so the same schedule can lose a different transaction at different levels. I didn't guess. That rule is marked as not modelled, and the tool refuses the run and says why. A test checks that each refusal matches an actual deadlock in the recordings. The harness also caught one deadlock rule I had written wrong, which is why I built it first.

The schedule reads like sheet music

Transactions sit on parallel staves, like a musical score, with a bar line at each step. Reading down a bar line shows what happened at the same moment. You can drag operations to reorder them and the run updates. One red mark lands on the exact step where the anomaly became unavoidable, with a one-line explanation generated from the run. A matrix runs the same schedule on all five rule files at every level.

Result

Isolation Anomaly is live and public, in English and Indonesian, as a fully static site. It models five engines: PostgreSQL 16, MySQL 8.4, SQL Server 2022, SQL Server 2022 with snapshot reads switched on, and Oracle 23ai. Eleven scenarios frame the stakes, such as an on-call roster for write skew and a bank transfer for read skew. You can also build your own schedule and share it by link. I built it alone over two days in August 2026.

Under the hoodTechnical detail for engineers
  • The oracle harness runs from docker-compose.oracle.yml with the pg, mysql2, mssql and oracledb drivers. None of it reaches CI or the browser bundle. Re-recording produces byte-identical fixtures.
  • Waits come from each engine's own instrumentation: pg_stat_activity, performance_schema.data_lock_waits, sys.dm_exec_requests and v$session.blocking_session.
  • Recorded versions: PostgreSQL 16.14, MySQL 8.4.11 (InnoDB), SQL Server 16.0.4265.3, Oracle 23.26.2.0.0. SQL Server runs under x86 emulation on Apple Silicon.
  • Packs: postgres-16, mysql-8-innodb, sqlserver-2022, sqlserver-2022-rcsi, oracle-23ai, validated with Zod and carrying 328 vendor citations. There is no if (engine === 'postgres') anywhere. RCSI is its own pack, recorded against a separate database so the option can't leak.
  • Declared boundaries: SQL Server victim selection is unmodelled (five recorded runs refused); PostgreSQL rejects statements after rollback with 25P02 while SQL Server autocommits them, which is how a swallowed 3960 still writes; Oracle's serialization failure kills the statement, not the transaction; lock wait timeouts are not modelled.
  • One MVCC core with version chains and snapshot visibility, and one lock manager with range and gap locks. The trace is byte-identical for identical inputs: no clock, no randomness, no module-level state.
  • The conflict graph's cycle detection is cross-checked against brute-force enumeration of every serial order, including three-transaction schedules.
  • 1,551 tests in 11 files, about 3.6 s. 1,215 compare the simulator with real-database recordings; 229 are both-direction anomaly assertions.
  • Four runtime dependencies: Next.js 14.2.15 (output: 'export'), React 18.3.1, React DOM and Zod 3.23.8. No database, SQL-parser, graph-layout or state library. Six pages per locale; schedules share via URL hash.
  • The PRD called it Sekat, Indonesian for a partition. The five-pack scope went past the PRD's cap of three.
  • 38 commits on 6–7 August 2026, 9,255 lines of application code and 1,701 lines of tests.

Screenshots

Overview
Schedule
Scenarios
Matrix
Conflict Graph
Engines

Hiring, or building something similar?

I'm open to full-time roles and select freelance work.