An interactive visualization of the CAP theorem. A single bank account is mirrored across three branches (New York, London, Tokyo). Cut the network and watch the system trade Consistency for Availability in real time.
A distributed store can't have all three of Consistency, Availability, and Partition tolerance at once. Since networks fail, partition tolerance isn't optional — so the real choice is C vs A. Quorum turns that choice into a button.
- Network healthy → all branches agree. You get both C and A.
- Network cut → the cluster splits into a majority (2 nodes) and a
minority (1 node), and you pick a mode:
- CP — the minority branch refuses writes (no quorum), so data stays correct everywhere but that branch is unavailable.
- AP — every branch keeps serving, so balances drift apart until the link heals and last-write-wins reconciles them.
- Backend — TypeScript + Express. A single
Bankclass owns all state and the CAP rules (quorum checks, replication, reconciliation) as small, readable methods. - Frontend — React + Vite. Renders server state only; never re-implements the rules.
- Deploys as one service — Express serves both the API and the built UI.
- pnpm install
- pnpm dev
