CAP LAB / 01
DISTRIBUTED DATABASE SIMULATOR
INTERACTIVE LEARNING ENVIRONMENT / ALL SYSTEMS SIMULATED LOCALLY
CP MODE
CAPCHALLENGETHE DISTRIBUTED DATABASE GAME
0 / 5 MISSIONS COMPLETE
MISSION 01 OF 05

Majority versus minority

Investigate a cluster under partition.

CP · 5 REPLICASSTEP 1 / 4
LIVE NETWORK TOPOLOGY SIMULATION ACTIVE

Global replica network

Click a node for CRUD, or a dashed line to partition. ⚑ Yellow flags mean a replica is behind.

● NETWORK HEALTHY
3 REPLICAS / CHAIN TOPOLOGY
CAP FAMILY
REPLICAS
DATABASE PROVIDER
GLOBAL VIEW / WORLD NETWORKDRAG TO PAN · SCROLL TO ZOOM
Available Restricted Divergent Offline⚑ Out of sync Connected Partitioned
MODECP · CONSISTENCY FIRST
STRONG CONSISTENCYMAINTAINED
AVAILABILITYALL ONLINE SERVED
DATA SYNCIN SYNC
LIVE REPLICA VALUES stockValues are shown as stored on each replica
LATEST COMMITTED / LOCAL VALUES
INTERACTIVE LEARNING QUEST0 OF 5 COMPLETE

CAPCHALLENGE

Five missions. Real decisions. Discover what distributed databases do when things go wrong.

◈ No configuration required · Each mission sets up the cluster for you

Complete five CAP missions

Every mission configures the cluster automatically. Follow the highlighted step, interact with the map, use the action panel when necessary, and watch replicas respond. Some rejected requests are expected results.

There are no provider, replication-factor, or CAP settings to change. The CP vs AP mission includes one built-in mode switch. After each mission, review the explanation and learning outcomes before moving forward.

Explore. Partition. Observe.

CAP theorem becomes clearer when you deliberately make a distributed database fail.

  1. Configure your cluster.Choose 3–5 replicas and a CA, CP, or AP behavior model.
  2. Cut a network connection.Click the dashed link connecting two replica sites. Try cutting several.
  3. Submit a request.Select a replica and attempt an INSERT, UPDATE, DELETE, or READ.
  4. Observe the outcome.Watch packets move between cities. A yellow flag marks replicas that have not yet received the latest data.
  5. Heal the network.Reconnect the links and watch replicas catch up or reconcile conflicts.
  6. Present or explore.Use the top-right view switch for a larger classroom map or the full laboratory. Moving cyan dashes indicate healthy connections; distinct packet dots represent actual simulated messages.

What this simulator models

This is a conceptual single-key distributed database, not an implementation of Raft, Paxos, Cassandra, or any production system.

CAP consistency means linearizability: successful reads do not go backward behind completed writes.

CP uses a simplified majority-quorum leader with committed state. A reachable majority responds; minority components reject requests.

AP permits local operations on every functioning replica and uses deterministic Last-Write-Wins resolution with logical timestamps and tombstones. It can lose an acknowledged update in a conflict.

CA uses an illustrative fixed single primary, similar to an asynchronous primary/standby configuration. A reachable primary continues read/write operations during a partition; isolated followers reject strong requests. Automatic failover is disabled. This preserves consistency for served requests but does not guarantee CAP availability across the partition.

Leaders are architectural choices, not CAP categories. CA shows a primary; CP shows a quorum-elected leader; AP uses independent peers in this lab. SQL Server appears as an asynchronous single-primary teaching model under CA and as an Always On AG synchronous configuration under CP. Actual SQL Server WSFC quorum/failover rules are more complex than this classroom simulation.

Real-world database examples illustrate particular deployments, read/write guarantees, or consistency settings. A product is not permanently CA, CP, or AP in all modes. Local single-server databases avoid distributed CAP trade-offs rather than overcoming partitions.

Server vs. service are different: an online CP minority replica is running, but cannot serve an eligible strongly consistent request.

Network uses a chain of bidirectional links; an offline intermediate node breaks paths. Messages traverse real map edges with geography-weighted, deliberately slowed teaching delays. No measured Internet latency is implied. Replicas remain stale until updates arrive.