Hello! Welcome to the first lesson in our module on Data Storage Strategies.
In this lesson, we'll tackle a fundamental question in system design: "Which database should I use?" Just as in product design you choose materials based on their properties—like strength, flexibility, and cost—in system design, we select a database based on its characteristics and how they fit the problem we're trying to solve.
Our goal today is to learn how to select appropriate database types—specifically SQL, NoSQL, and NewSQL—based on three key factors: the data model, query patterns, and consistency requirements. By the end of this lesson, you'll have a framework for making informed database choices.
Let's start with a high-level map of the database world.

1. The Core Criteria for Choosing a Database
Before we dive into the specific types, it's crucial to understand the criteria used to evaluate them. The choice of a database isn't about finding the "best" one, but the right one for the job. The main factors revolve around the nature of your data, how you'll use it, and the guarantees you need.
To get a structured overview of these criteria, please watch the first part of the following video.
Types of Databases | Criteria to choose the best database in the System Design Interview
This video from Think Software provides an excellent breakdown of the key criteria to consider when selecting a database.
Watch the section 'Criteria for Database Selection' from 02:08 to 08:21. Pay close attention to the discussion on Data Model, Scalability, Query Patterns, and the ACID vs. BASE concepts.
As the video explained, the most critical decision factors for our purpose are:
- Data Model: Is your data highly structured with clear relationships (like users and their orders), or is it semi-structured or unstructured (like blog posts, product catalogs with varying attributes, or social media feeds)?
- Scalability: How will the system handle growth? Does it need to scale vertically (running on a single, more powerful server) or horizontally (distributing the load across many servers)?
- Consistency: How important is it that every user sees the exact same, up-to-the-minute data? This is the trade-off between strong consistency and eventual consistency.
- Query Patterns: How will you access the data? Will your system be read-heavy or write-heavy? Will you perform simple lookups by an ID, or will you need to run complex queries that join multiple data tables?
These criteria form a framework we'll use to compare SQL, NoSQL, and NewSQL databases.

2. SQL (Relational) Databases
SQL databases, also known as Relational Database Management Systems (RDBMS), have been the standard for decades. They organize data into tables with rows and columns, much like a collection of interconnected spreadsheets.
SQL vs NoSQL: A Comparison of Database Technologies
To understand the core characteristics of SQL databases, let's read a quick summary from this article by Airbyte.
Read the section 'What Are SQL Databases and Their Core Characteristics?'. Focus on the three key features: ACID properties, schema-based organization, and the use of SQL.
Key Characteristics:
- Structured Data & Rigid Schema: Data must fit into a predefined structure (the schema). This ensures data integrity but can make changes difficult.
- ACID Compliance: SQL databases guarantee that transactions are Atomic, Consistent, Isolated, and Durable. In simple terms, this means a transaction (like a bank transfer) either completes fully or fails entirely, leaving the database in a valid state. This provides strong consistency.
- Complex Queries & JOINs: SQL is a powerful language for querying data, especially for performing
JOINoperations to combine data from multiple tables. - Vertical Scaling: Traditionally, you handle more load by increasing the resources of a single server (more CPU, RAM, or storage). Scaling across multiple servers (horizontally) is possible but often complex to manage.
When to use SQL:
SQL databases are an excellent choice for applications that require high reliability and have structured, relational data.
- Financial Systems: Banking, trading platforms.
- E-commerce Backends: Managing orders, customer information, and inventory.
- Any system where data integrity is more critical than raw speed or massive scale.
3. NoSQL (Non-Relational) Databases
NoSQL ("Not Only SQL") databases emerged to address the limitations of SQL databases, particularly regarding scalability and flexibility. They are a diverse family of databases that don't rely on the rigid, table-based structure of their relational counterparts.
SQL vs NoSQL: A Comparison of Database Technologies
Now, let's get an overview of NoSQL databases from the same Airbyte article.
Read the sections 'What Are NoSQL Databases and How Do They Differ from Traditional Systems?' and 'What Are the Primary Advantages and Disadvantages of SQL vs NoSQL Databases?'. Focus on the pros and cons, especially regarding schema flexibility, scalability, and consistency.
Key Characteristics:
- Flexible Schema: Data doesn't need to conform to a predefined structure. This is great for unstructured or rapidly evolving data.
- Horizontal Scaling: NoSQL databases are designed from the ground up to be distributed across many commodity servers, making it easy to scale out as traffic and data volume grow.
- BASE Philosophy: Many NoSQL databases trade strict ACID compliance for the Basically Available, Soft state, Eventually consistent (BASE) model. This means the system prioritizes availability, and data will become consistent across all nodes eventually, but immediate reads might return slightly stale data.
- Varied Data Models: NoSQL is not one thing; it's a category.
To understand the different flavors of NoSQL, let's watch a video that breaks them down.
Choosing a Database for Systems Design: All you need to know in one video
This video from 'Jordan has no life' provides a great tour of the most common NoSQL database types and their specific use cases.
Watch the following segments to understand the different NoSQL categories: Document Databases (MongoDB): 09:39 - 11:46 Wide-Column Stores (Cassandra): 11:46 - 13:49 Key-Value Stores (Riak, Redis): 13:49 - 14:59 and 16:41 - 18:01 Graph Databases (Neo4j): 18:01 - 19:28 For each type, focus on the data model and the example use cases provided.
Here's a quick summary of the main NoSQL types:
| Type | Description | Best For | Examples |
|---|---|---|---|
| Document | Stores data in flexible, JSON-like documents. | Content management, product catalogs, user profiles. | MongoDB, Couchbase |
| Key-Value | A simple model like a dictionary or hash map. | Caching, user sessions, real-time leaderboards. | Redis, Amazon DynamoDB |
| Wide-Column | Organizes data in tables, but columns can be dynamic for each row. | High write-throughput scenarios like IoT data, logs, analytics. | Apache Cassandra, Google Bigtable |
| Graph | Uses nodes and edges to model complex relationships. | Social networks, recommendation engines, fraud detection. | Neo4j, Amazon Neptune |
4. NewSQL Databases
What if you need the massive horizontal scalability of NoSQL but can't afford to give up the ACID guarantees and familiar SQL interface of a relational database? This is the problem NewSQL databases were designed to solve.
NewSQL databases are a modern class of relational databases that combine the best of both worlds.
What is NewSQL and how does it differ from traditional ...
This article from Design Gurus provides a clear definition of NewSQL and compares it directly with SQL and NoSQL.
Read the sections 'What Is NewSQL?', 'SQL vs NoSQL vs NewSQL: Key Differences', and the FAQ 'When should I use a NewSQL database instead of NoSQL or SQL?'. Pay close attention to the comparison table and the use cases where NewSQL shines.
Key Characteristics:
- Relational Model & SQL: They use a relational model and support the standard SQL query language.
- ACID Compliance: They provide full ACID guarantees for transactions, even in a distributed environment.
- Horizontal Scalability: They are architected to scale out across many servers, just like NoSQL systems.
When to use NewSQL:
NewSQL is ideal for applications that have outgrown traditional SQL databases but still require strong consistency.
- Global Financial Services: Systems that need to process transactions consistently across multiple geographic regions.
- Large-Scale E-commerce: Managing a global inventory system in real-time.
- Online Gaming: Maintaining consistent player state for a massive, worldwide user base.
Conclusion
We've covered the three major categories of databases and the criteria for choosing between them. The decision is always a matter of trade-offs, guided by your specific requirements.
Key Takeaways:
- SQL databases are the traditional choice for structured data that requires strong consistency (ACID) and complex relational queries. They scale vertically.
- NoSQL databases are a diverse family built for flexibility and massive horizontal scale. They often favor availability over consistency (BASE) and are suited for unstructured or semi-structured data. The main types are Document, Key-Value, Wide-Column, and Graph.
- NewSQL databases are a modern hybrid, offering the horizontal scalability of NoSQL with the ACID guarantees and SQL interface of relational databases.
Referencing the "Database Selection Process" flowchart again, you can now see a clear path: you start by analyzing your data and query patterns, which points you toward a category (SQL, NoSQL, etc.). Then, you consider your consistency and scalability needs to finalize your choice. There is no single "best" database—only the right tool for the specific design problem at hand.
Preview of the Next Lesson:
In our next lesson, we will dive deeper into one of the key concepts we touched on today: scalability. We'll explore "data partitioning strategies including horizontal sharding and vertical partitioning," which are techniques used to distribute data across multiple machines to handle massive scale.
Can't find a good explanation? Sign up and we'll make it for you
Sign up