What is NoSQL?
NoSQL stands for "Not Only SQL".
It’s a type of database that does not use the traditional relational (tables, rows, columns)
model like SQL databases.
Instead, NoSQL databases store data in flexible formats (documents, key-value pairs,
graphs, wide-column stores).
They are designed for scalability, speed, and handling unstructured/semistructured data.
Types of NoSQL Databases
1. Document-based → stores data as JSON-like documents. (e.g., MongoDB)
2. Key-Value store → stores data as key–value pairs. (e.g., Redis)
3. Column-based → stores data in columns instead of rows. (e.g., Cassandra)
4. Graph-based → stores data as nodes and edges (relationships). (e.g., Neo4j)
Key Features of NoSQL:
1. Dynamic schema:.
2. Horizontal scalability:
3. Document-based:
4. Key-value-based:
5. Column-based:
6. Distributed and high availability:
7. Flexibility:
8. Performance
Advantages of NoSQL: There are many advantages of working with NoSQL databases such as
MongoDB and Cassandra. The main advantages are high scalability and high availability.
1. Schema Agnostic:
2. Flexibility
3. High availability
4. Scalability
5. Performance
6. Cost-effectiveness
7. Agility
Disadvantages of NoSQL: NoSQL has the following disadvantages.
1. Lack of standardization:
2. Lack of ACID complianc
3. Narrow focus.
4. Open-source:
5. Lack of support for complex queries:.
6. Lack of maturity
7. Management challenge
8. GUI is not available
9. Backup:
10. Large document size
When should NoSQL be used:
1. When a huge amount of data needs to be stored and retrieved.
2. The relationship between the data you store is not that important
3. The data changes over time and is not structured.
4. Support of Constraints and Joins is not required at the database level
5. The data is growing continuously and you need to scale the database regularly to handle
the data.
AGGREGATE DATA MODELS
Aggregate means a collection of objects that are treated as a unit. In NoSQL
Databases, an aggregate is a collection of data that interact as a unit. Moreover,
these units of data or aggregates of data form the boundaries for the ACID
operations.
Types of Aggregate Data Models in NoSQL Databases
The Aggregate Data Models in NoSQL are majorly classi 昀椀 ed into 4 Data Models
listed below:
Key-Value Model
The Key-Value Data Model contains the key or an ID used to access or fetch the
data of the aggregates corresponding to the key. In this Aggregate Data Models
in NoSQL, the data of the aggregates are secure and encrypted and can be
decrypted with a Key.
Use Cases:
• These Aggregate Data Models in NoSQL Database are used for
storing the user session data.
• Key Value-based Data Models are used for maintaining schema-less user
pro 昀椀 les.
• It is used for storing user preferences and shopping cart data.
Document Model
The Document Data Model allows access to the parts of aggregates. In this
Aggregate Data Models in NoSQL, the data can be accessed in an in 昀 氀
exible way. The Database stores and retrieves documents, which can be XML,
JSON, BSON, etc. There are some restrictions on data structure and data types
of the data aggregates that are to be used in this Aggregate Data Models in
NoSQL Database.
Use Cases:
• Document Data Models are widely used in E-Commerce platforms
• It is used for storing data from content management systems.
• Document Data Models are well suited for Blogging and Analytics
platforms.
Column Family Model
Column family is an Aggregate Data Models in NoSQL Database usually with
big-table style Data Models that are referred to as column stores. It is also called a
two-level map as it offers a two-level aggregate structure. In this Aggregate Data
Models in NoSQL, the 昀椀 rst level of the Column family contains the keys that act as a
row identi 昀 椀 er that is used to select the aggregate data. Whereas the second level
values are referred to as columns.
Use Cases:
• Column Family Data Models are used in systems that maintain
counters.
• These Aggregate Data Models in NoSQL are used for services that
have expiring usage.
• It is used in systems that have heavy write requests.
Graph-Based Model
Graph-based data models store data in nodes that are connected by edges. These
Aggregate Data Models in NoSQL are widely used for storing the huge volumes of
complex aggregates and multidimensional data having many interconnections
between them.
Use Cases:
• Graph-based Data Models are used in social networking sites to store
interconnections.
• It is used in fraud detection systems.
• This Data Model is also widely used in Networks and IT operations.
Distributed and high availability:
1. Flexibility:
2. Performance