
Durgesh Tiwari
Author
Almost every modern application stores and manages data. Whether you use a social media platform, an online shopping website, a banking application, or a food delivery app, data is constantly being created, updated, and retrieved.
As applications grow, the amount of data and the number of users also increase. To keep everything running smoothly, applications need a reliable way to store data, retrieve it quickly, and manage it efficiently.
This is where databases come in. A database helps applications store, organize, and manage data so it can be accessed whenever needed. Understanding databases is one of the first steps in learning System Design because they directly affect an application's performance, scalability, and reliability.
Think about the last time you logged into a website, placed an online order, or transferred money through a banking app. All of this information must be stored safely so it can be accessed whenever required.
This is where a Database is used.
A Database is an organized collection of data that allows applications to store, retrieve, update, and delete information efficiently.
Unlike storing information in separate files, a database keeps data organized, making it faster to search, update, and manage.
In simple words, a database is a system that stores and manages application data in an organized way.
User Request
│
▼
┌────────────────┐
│ Application │
└────────────────┘
│
▼
┌────────────────┐
│ Database │
└────────────────┘
│
┌─────────────┼─────────────┐
▼ ▼ ▼
Store Retrieve Update

Databases are used in almost every software application, from small websites to platforms serving millions of users.
Let's understand this with an online shopping website.
Its database stores information such as:
Customer details
Product information
Orders
Payment records
Shipping addresses
Inventory
Whenever a customer places an order, the application retrieves and updates this information in the database.
Imagine storing all application data in separate files. As users and data increase, finding, updating, and managing information becomes slow and difficult. It also increases the chances of duplicate or inconsistent data.
A database solves these problems by storing data in an organized way, allowing applications to access and update information quickly.
A database helps to:
Store application data securely.
Retrieve information quickly.
Maintain data consistency.
Support multiple users at the same time.
Reduce data duplication.
Improve application performance.
Scale as data and user traffic grow.
Choosing the right database is an important System Design decision because it directly affects an application's performance, scalability, and reliability.
A database should do more than just store data. It should retrieve information quickly, protect sensitive data, and continue to perform well as the application grows.
When choosing or designing a database, developers usually look for the following characteristics:
Reliability: Stores and retrieves data accurately without losing or corrupting information, even during unexpected failures.
Scalability: Handles increasing amounts of data and growing user traffic without major performance issues.
Performance: Executes queries quickly and returns results with minimal delay.
Security: Protects sensitive data using authentication, authorization, and encryption.
Availability: Remains accessible even during hardware failures or maintenance.
Data Integrity: Ensures data remains accurate and consistent by preventing invalid or duplicate records.
Different applications have different data storage needs. For example, a banking application requires strong data consistency, while a social media platform needs to handle large amounts of data and millions of user requests efficiently.
Because of these different needs, a single database cannot meet every requirement. This is why multiple types of databases are available, each designed for a specific use case.
The three main types of databases are:
Relational Database (SQL)
NoSQL Database
NewSQL Database

A Relational Database, also known as a SQL Database, stores data in a structured and organized way. Many applications such as banking systems, e-commerce websites, and hospital management systems use relational databases because they need accurate data and reliable transactions.
A Relational Database stores data in the form of tables, where each table contains rows and columns. These tables are connected using keys, making it easy to organize related data and retrieve it whenever needed.
It uses Structured Query Language (SQL) to create, retrieve, update, and delete data.
Note: A Relational Database and a SQL Database generally refer to the same type of database. The term Relational Database describes how data is organized, while SQL Database refers to the use of SQL for managing that data.
In simple words, a Relational Database (SQL Database) stores data in tables and uses SQL to manage and query that data efficiently.
Because data is stored in a fixed structure, relational databases are a good choice for applications where accuracy, consistency, and reliable transactions are important.
Stores structured data in tables.
Organizes information using rows and columns.
Connects related tables using keys.
Follows ACID properties to maintain data consistency.
Uses SQL to create, retrieve, update, and delete data.
Banking systems
E-commerce applications
Hospital management systems
Student management systems
Inventory management systems
MySQL
PostgreSQL
Oracle Database
Microsoft SQL Server
As modern applications grow, they often need to handle large amounts of data that changes frequently. Applications such as social media platforms, chat applications, and IoT systems generate different types of data that do not always fit into fixed tables.
This is where a NoSQL Database becomes a better choice.
A NoSQL Database is designed to store structured, semi-structured, and unstructured data. Unlike a Relational Database, it does not require a fixed table structure. Instead, it stores data in flexible formats such as documents, key-value pairs, columns, or graphs, depending on the application's requirements.
In simple words, a NoSQL Database stores data in a flexible format, making it a good choice for applications that need high scalability, fast performance, and changing data structures.
Because of this flexibility, NoSQL databases are widely used in modern distributed applications that process large volumes of data and handle millions of user requests.
Flexible data model.
Supports structured, semi-structured, and unstructured data.
Easy to scale horizontally.
Handles large volumes of data efficiently.
Supports distributed architecture.
Optimized for fast read and write operations.
Social media platforms
Real-time analytics
Chat applications
Content management systems
IoT applications
MongoDB
Cassandra
Redis
Couchbase
Amazon DynamoDB
Traditional SQL databases provide strong consistency and reliable transactions, but scaling them across multiple servers can be difficult. On the other hand, NoSQL databases scale easily but may not always provide the same level of transactional consistency.
To overcome these limitations, NewSQL Databases were introduced.
A NewSQL Database combines the strong consistency and ACID transactions of traditional SQL databases with the horizontal scalability of NoSQL databases. It also supports SQL, allowing developers to build large-scale applications without sacrificing transactional consistency.
In simple words, a NewSQL Database combines the reliability of SQL databases with the scalability of NoSQL databases.
Because of this, NewSQL databases are a good choice for applications that need high performance, strong consistency, and the ability to scale across multiple servers.
Supports SQL.
Provides ACID transactions.
Supports horizontal scaling.
High availability.
Designed for distributed systems.
Financial systems
Large enterprise applications
Cloud-native applications
High-traffic transactional systems
Google Spanner
CockroachDB
TiDB
VoltDB
SQL Database | NoSQL Database |
|---|---|
Stores data in tables. | Stores data in flexible formats such as documents, key-value pairs, graphs, or columns. |
Uses a fixed schema. | Uses a flexible schema. |
Best for structured data. | Supports structured, semi-structured, and unstructured data. |
Follows ACID properties. | Usually follows BASE or eventual consistency (depending on the database). |
Scales mainly by adding more resources to a single server (Vertical Scaling). | Scales by adding more servers (Horizontal Scaling). |
Best for applications requiring strong consistency. | Best for applications requiring high scalability and flexibility. |
Examples: MySQL, PostgreSQL, Oracle. | Examples: MongoDB, Cassandra, Redis. |
There is no single database that is best for every application. The right choice depends on the type of data, scalability requirements, and business needs.

After learning about SQL, NoSQL, and NewSQL databases, a common question is: Which database should you choose?
The answer depends on your application's requirements. Factors such as the type of data, consistency, scalability, performance, and expected workload all influence the choice of a database.
There is no one-size-fits-all solution. Each database is designed for different use cases, so choosing the right one depends on what your application needs.
Let's look at when each type of database is the best choice.
Choose a SQL database if your application:
Requires strong data consistency.
Stores structured data.
Has complex relationships between tables.
Needs ACID transactions.
Performs complex queries and reporting.
Examples
Banking systems
Hospital management systems
E-commerce order management
Student management systems
Accounting software
Choose a NoSQL database if your application:
Handles large volumes of data.
Requires horizontal scalability.
Uses flexible or frequently changing data structures.
Needs high read and write performance.
Runs in a distributed environment.
Examples
Social media platforms
Chat applications
Content management systems
IoT applications
Real-time analytics
Choose a NewSQL database if your application:
Requires SQL support.
Needs strong consistency.
Must scale across multiple servers.
Handles a large number of transactions.
Examples
Financial systems
Enterprise applications
Global payment platforms
Cloud-native applications

Large applications often use more than one type of database because different parts of the system have different data and performance requirements.
Amazon uses SQL databases for transactional data such as orders and payments, while NoSQL databases manage product catalogues and user session data.
Facebook uses NoSQL databases to store and process the massive amount of data generated by millions of users every day.
Netflix relies on NoSQL databases to manage user activity, recommendations, and streaming data across many servers.
Banks mainly use SQL databases because financial transactions require strong consistency and data integrity.
These examples show that modern applications often combine SQL and NoSQL databases to meet different business and performance requirements.
A database stores and manages application data.
SQL databases are best for structured data and strong consistency.
NoSQL databases are suitable for flexible data models and high scalability.
NewSQL databases combine SQL consistency with distributed scalability.
The right database depends on your application's data, scalability, and performance requirements.
Many modern applications use a combination of SQL and NoSQL databases based on different use cases.
Understanding these database concepts provides a strong foundation for advanced System Design topics such as Database Replication, Sharding, Partitioning, Indexing, and Distributed Databases.