Skip to main content

CAP Theorem

IBM CAP doc

1. Consistency

Weak consistency

After a W, R may or may not see it: VoIP, video chat, realtime.

Memcached

Eventual Consistency - Data is replicated asynchronously

Highly available systems with NoSQLDB: after a W, R will eventually see it: Email or DNS.

Strong consistency - transaction based systems

After W, R will see it: file systems and RDBMSes.

Google I/O 2009 - Transactions Across Datacenters.. - YouTube

2. Availability

Fail-over

Active-passive (master-slave) failover

Active-active (master-master) failover

Potential data loss

3. Replication

Database.

Master-Slave Master-Master

4. DBs

DB types:

  • CP
  • AP
  • CA

System Properties Comparison Cassandra vs. CouchDB vs. MongoDB

SQL vs. NoSQL Databases: What's the Difference?

NameTypeFeaturesTech
MongoDBCPaBSON(Binary JSON) doc, single-master arch, SQL query via ConnectorC++
CassandracAPwide-column, master-less arch, repair functionality, SQL-like supportJava
CouchDBcAPJSONErlang