system-design-refresher

Databases

Contents

Relational Databases

All SQL databases use tables for data storage and use SQL as a query language. They are great for transactions, complex queries and integrity.

The most common examples are PostgresQL, MySQL, SQLite, etc.

A.C.I.D Compliance

NoSQL Databases

These databases drop the Consistency property from the ACID. No schemas, good for unstructured data.

There are different types of NoSQL databases:

The most common examples are MongoDB, Cassandra, Redis, etc.

In-memory Databases

Can be Relational or NoSQL depending on their design and structure.

Scaling

Vertical vs Horizontal scaling

Vertical Scaling

Horizontal Scaling

Sharding

Consists of distributing different portions (shards) of the dataset across multiple servers.

Some of the sharding strategies are:

Replication

Keeping copy of data in multiple servers for high availability.

Master-Slave vs Master-Master replication

Performance

Performance improvement techniques

Some of the most common techniques to optimize performance are: