CAP LAB
DISTRIBUTED DATABASE SIMULATOR
INTERACTIVE LEARNING ENVIRONMENT / ALL SYSTEMS SIMULATED LOCALLY
CP MODE
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
LATEST COMMITTED / LOCAL VALUES

Choose a database example

Choose a provider to apply its simplified replication profile, or open the official documentation. These are teaching approximations, not product emulators.

CPAvailable examples for the selected CAP family

These are configuration-specific teaching approximations, not full emulators. Actual failover, replication and consistency guarantees vary by deployment.

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.