Skip to main content

Command Palette

Search for a command to run...

Database Concepts for Modern System Design

Introduction to database:

Updated
2 min read
Database Concepts for Modern System Design

Why do we need databases? Or even storage?

Suppose you are ordering a book from an e-commerce platform. You open the app, search for the book, and the system must fetch that information instantly. This means the application needs a place to store product data so it can be retrieved quickly when you search.
Now imagine all this data is stored in simple file storage.

What’s the issue with file storage?

File storage works for basic logs but fails when many users read or write data at the same time. You can’t control different permission for different users and many more.

Solution:

A database is a system that stores data in an organized way and provides efficient, safe, and reliable methods to retrieve and manage that data.

Advantage:

  1. Data Consistency
    Ensures the same data is uniformly available across the system, reducing duplication and contradictions.

  2. High Reliability & Durability
    Databases guarantee that once data is written (especially in ACID systems), it won’t be lost even during failures.

  3. Efficient Data Retrieval
    Indexing, query optimization, and caching engines allow fast reads—even for large datasets.

  4. Scalability
    Modern databases support vertical & horizontal scaling, sharding, clustering, and replication.

  5. Security & Access Control
    Fine-grained permissions, encryption, and auditing ensure data is protected at rest and in transit.

  6. Backup & Recovery
    Built-in mechanisms allow restoring data after accidental deletion, crashes, or corruption.

  7. Concurrency Handling
    Database engines manage multiple users modifying data at the same time without conflicts.

  8. Integrity Constraints
    Features like primary keys, foreign keys, and unique constraints maintain correct & meaningful data relationships.

  9. Support for Transactions
    Ensures reliable multi-step operations (commit/rollback) without partial updates.

There are 3 basic types of databases:

SQL: Structured Query Language databases are relational systems (RDBMS) that store data in tables with a predefined schema and structure. They enforce relationships between tables and support powerful querying using SQL.
Examples: MySQL, PostgreSQL, Oracle, SQL Server

NoSQL: Not Only SQL. NoSQL databases store data in various formats such as key–value, document, wide-column, and graph. They support flexible schemas and are highly suitable for horizontal scaling. NoSQL databases are ideal when dealing with unstructured or semi-structured data.

Examples: MongoDB, Elasticsearch, Redis, DynamoDB

NewSQL: NewSQL databases combine the relational model and SQL querying of traditional SQL databases with the horizontal scalability of NoSQL systems. They provide strong ACID consistency while being able to scale across distributed clusters.

Examples: CockroachDB, Google Spanner, TiDB.

Next, we’ll explore the major types of databases—how they work, where they fit, and why they matter in system design.

Databases in System Design: A Complete Beginner-to-Advanced Guide