1. Introduction to NoSQL
NoSQL, or “Not Only SQL,” is a database management
system (DBMS) designed to handle large volumes of
unstructured and semi-structured data. Unlike traditional
relational databases that use tables and pre-defined
schemas, NoSQL databases provide flexible data
models and support horizontal scalability, making them
ideal for modern applications that require real-time data
processing.
2. Why Use NoSQL?
•Scalability – Can scale horizontally by adding more nodes
instead of upgrading a single machine.
•Flexibility – Supports unstructured or semi-structured data
without a rigid schema.
•High Performance – Optimized for fast read/write
operations with large datasets.
•Distributed Architecture – Designed for high availability
and partition tolerance in distributed systems.
5. 1. Document databases
•Data is stored as documents that can contain varying
attributes.
•Examples: MongoDB, CouchDB, Cloudant
•Ideal for content management systems, user profiles,
and catalogs where flexible schemas are needed.
6. • A document-oriented database stores data in documents
similar to JSON (JavaScript Object Notation) objects.
• Each document contains pairs of fields and values. The values
can typically be a variety of types, including things like strings,
numbers, booleans, arrays, or even other objects.
• A document database offers a flexible data model, much suited
for semi-structured and typically unstructured data sets.
• They also support nested structures, making it easy to
represent complex relationships or hierarchical data.
7. Key-value databases
• A key-value store is a simpler type of database where each
item contains keys and values.
• Each key is unique and associated with a single value.
• They are used for caching and session management and
provide high performance in reads and writes because they
tend to store things in memory.
• Examples are Amazon DynamoDB and Redis. A simple view of
data stored in a key-value database is given below:
• Key: user:12345
• Value: {"name": "foo bar", "email": "foo@bar.com",
"designation": "software developer"}
8. Wide-column stores
• Wide-column stores store data in tables, rows, and dynamic
columns.
• The data is stored in tables.
• However, unlike traditional SQL databases, wide-column stores
are flexible, where different rows can have different sets of
columns.
• These databases can employ column compression techniques to
reduce the storage space and enhance performance.
• The wide rows and columns enable efficient retrieval of sparse
and wide data.
• Some examples of wide-column stores are Apache Cassandra
and HBase
9. name id email dob city
Foo bar 12345 foo@bar.com Some city
Carn Yale 34521 bar@foo.com 12-05-1972
10. Graph databases
• A graph database stores data in the form of nodes and edges.
• Nodes typically store information about people, places, and
things (like nouns), while edges store information about the
relationships between the nodes.
• They work well for highly connected data, where the
relationships or patterns may not be very obvious initially.
• Examples of graph databases are Neo4J and Amazon
Neptune. MongoDB also provides graph traversal capabilities
using the $graphLookup stage of the aggregation pipeline.
Below is an example of how data is stored: