architect-handbook

Software Architect Handbook

View on GitHub

Choosing a Database

Overview

The reason that we have many database options available today is due to the CAP theorem.

CAP Theorem: At any given time, you can only guarantee two of the following: consistency, availability, and partition tolerance.

Important Questions to Ask

Relational

Examples: SQL Server, MySQL, Oracle database, PostgresSQL, IBM DB2.

Relational databases traditionally feature strong consistency and high availability at the expense of partition tolerance.

Non-relational

Examples: Memcached, Redis, Coherence, HBase, BigTable, Accumulo, MongoDB, CouchDB.

Non-relational databases have been developed to serve availability and partition tolerance needs mostly. Great for data that’s unstructured or not relational at all, or for only serializing/deserializing data (JSON, XML, YAML, etc).