NoSQL Database - The Definitive Guide To NoSQL Databases
NoSQL Database - The Definitive Guide To NoSQL Databases
a a
NoSQL Databases: The ultimate
Guide a U
a
by Ahinóam Rodríguez | Last updated Mar 18, 2024 | Pandora FMS
Shares
Today, many companies generate and store huge amounts of data. To give
you an idea, decades ago, the size of the Internet was measured in
Terabytes (TB) and now it is measured in Zettabytes (ZB).
NoSQL
NoSQL databases
databases have a distributed architecture that allows them to
scale horizontally and handle continuous and fast data flows. This makes
[Link] 1/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a
platforms where data processing takes place in real time. a
a
Given the interest in NoSQL databases in the current context, we believe
a
it is essential to develop a user guide that helps developers understand
and effectively use this technology. In this article we aim to clarify some
Shares
basics about NoSQL, giving practical examples and providing
Content:
[Link] 2/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a
need to structure information in complex tables. Thus, NoSQL supports a a
wide variety of denormalized data such as JSON documents, key values,
columns, and graph relationships. a a
Each NoSQL
NoSQL database
database type
type is optimized for easy access, query, and
Shares
modification of a specific class of data. The main ones are:
Key-value:
Key-value: Redis, Riak or DyamoDB. These are the simplest NoSQL
databases. They store the information as if it were a dictionary
based on key-value pairs, where each value is associated with a
unique key. They were designed to scale quickly ensuring system
performance and data availability.
Documentary:
Documentary: MongoDB, Couchbase. Data is stored in documents
such as JSON, BSON or XML. Some consider them an upper
echelon of key-value systems since they allow encapsulating key-
value pairs in more complex structures for advanced queries.
Column-oriented:
Column-oriented: BigTable, Cassandra, HBase. Instead of storing
data in rows like relational databases do, they do it in columns.
These in turn are organized into logically ordered column families in
the database. The system is optimized to work with large datasets
and distributed workloads.
Graph-oriented:
Graph-oriented: Neo4J, InfiniteGraph. They save data as entities
and relationships between entities. The entities are called “nodes”
and the relationships that bind the nodes are the “edges”. They are
perfect for managing data with complex relationships, such as
social networks or applications with geospatial location.
[Link] 3/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
This feature allows NoSQL DBMSs to scale horizontally and manage large
volumes of data using partitioning techniques. a a
What is NoSQL databasea
partitioning? a
When you need to reduce latency. In this case you get to balance
the workload on different cluster nodes to improve performance.
Although partitioning is used in large databases, you should not wait for
the data volume to become excessive because in that case it could cause
system overload.
Many programmers use AWS or Azure to simplify the process. These
platforms offer a wide variety of cloud services that allow developers to
skip the tasks related to database administration and focus on writing the
code of their applications.
Partitioning techniques
[Link] 4/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
Consistent
Consistent Hashing
Hashing
It is an algorithm that is used to efficiently allocate data to nodes in
a distributed environment.
The idea of consistent hashes was introduced by David Karger in a
research paper published in 1997 and entitled “Consistent Hashing
and Random Trees: Distributed Caching Protocols for Relieving
Hot Spots on the World Wide Web“.
In this academic work, the “Consistent Hashing” algorithm was
proposed for the first time as a solution to balance the workload of
servers with distributed databases.
It is a technique that is
is used
used in
in both
both partitioning
partitioning and
and data
data
replication
replication, since it allows to solve problems common to both
processes such as the redistribution of keys and resources when
adding or removing nodes in a cluster.
[Link] 5/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a a
a a
Shares
It consists of creating
creating copies
copies of
of the
the data
data on
on multiple
multiple machines
machines. This
process seeks to improve database performance by distributing queries
among different nodes. At the same time, it ensures that the information
will continue to be available, even if the hardware fails.
The two main ways to perform data replication (in addition to the
[Link] 6/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
Writing is made to the primary node and from there data is replicated to
Shares
secondary nodes.
Peer to peer
All nodes in the cluster have the same hierarchical level and can accept
writing. When data is written to one node it spreads to all the others. This
ensures availability, but can also lead to inconsistencies if conflict
resolution mechanisms are not implemented (for example, if two nodes
try to write to the same location at the same time).
[Link] 7/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
Consistency:
Consistency: All requests after the writing operation get the same
a
value, regardless of where the queries are made.
a
Availability:
Availability: The database always responds to requests, even if a
failure takes place. a a
Partition
Partition Tolerance:
Tolerance: The system continues to operate even if
communication between some nodes is interrupted.
Shares
[Link] 8/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
databases,
databases, consistency
consistency is
is not
not one
one hundred
hundred percent
percent guaranteed
guaranteed, since
a
changes must propagate between all nodes in the cluster. a
BASE
BASE is a concept opposed to the ACID
ACID properties (atomicity,
consistency, isolation, durability) of relational databases. In this approach,
we prioritize data availability over immediate consistency, which is
especially important in applications that process data in real time.
The BASE acronym means:
Basically
Basically Available:
Available: The database always sends a response, even if it
contains errors if readings occur from nodes that did not yet receive
the last writing.
Soft
Soft state:
state: The database may be in an inconsistent state when
reading takes place, so you may get different results on different
readings.
Eventually
Eventually Consistent:
Consistent: Database consistency is reached once the
information has been propagated to all nodes. Up to that point we
talk about an eventual consistency.
Even though the BASE approach arose in response to ACID, they are not
exclusionary options. In fact, some NoSQL databases like MongoDB offer
configurable consistency.
[Link] 9/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
B Trees
They are balanced trees and perfect for distributed systems for their
ability to maintain index consistency, although they can also be used in
relational databases.
The main feature of B trees is that they can have several child nodes for
each parent node, but they always keep their height balanced. This
means that they have an identical or very similar number of levels in each
tree branch, a particularity that makes it possible to handle insertions and
deletions efficiently.
They are widely used in filing systems, where large data sets need to be
accessed quickly.
T Trees
They are also balanced trees that can have a maximum of two or three
child nodes.
Unlike B-trees, which are designed to make searches on large volumes of
data easier, T-trees work best in applications where quick access to
sorted data is needed.
AVL Trees
[Link] 10/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
KD Trees
They are binary, balanced trees that organize data into multiple
dimensions. A specific dimension is created at each tree level.
They are used in applications that work with geospatial data or scientific
data.
Merkle Trees
[Link] 11/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a a
a a
Shares
Data is grouped into larger datasets and related to the main nodes until all
the data within the system is gathered. As a result, the Merkle
Merkle Root
Root is
obtained.
How
How is
is the
the Merkle
Merkle Root
Root calculated?
calculated?
The Merkle root is at the top of the tree and is the value
value that
that securely
securely
represents
represents data
data integrity
integrity. This is because it is strongly related to all
datasets and the hash that identifies each of them. Any changes to the
original data will alter the Merkle Root. That way, you can make sure that
the data has not been modified at any point.
This is why Merkle trees are frequently employed to verify the integrity of
data blocks in Blockchain transactions.
NoSQL databases like Cassandra draw on these structures to validate
data without sacrificing speed and performance.
[Link] 12/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
MongoDB
It is a documentary
documentary DBMS
DBMS developed by 10gen in 2007. It is open source
and has been created in programming languages such as C++, C and
JavaScript.
Database
Database storage
storage with
with MongoDB:
MongoDB: MongoDB stores data in BSON
BSON
files (binary JSON). Each database consists of a collection of
documents. Once MongoDB is installed and Shell is running, you
[Link] 13/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
may create the DB just by indicating the name you wish to use. If
a
the database does not already exist, MongoDB will automatically
create it when adding the first collection. Similarly, a collection is
a
a
created automatically when you store a file in it. You just have to
add the first document and execute the “insert” statement and
a
MongoDB will create an ID field assigning it an ObjectID value that
is unique for each machine at the time the operation is executed.
Shares
DB
DB Partitioning
Partitioning with
with MongoDB:
MongoDB: MongoDB makes it easy to
distribute data across multiple servers using the automatic sharding
feature. Data fragmentation takes place at the collection level,
distributing documents among the different cluster nodes. To carry
out this distribution, a “partition key” defined as a field is used in all
collection documents. Data is fragmented into “chunks”, which have
a default size of 64 MB and are stored in different shards within the
cluster, ensuring that there is a balance. MongoBD monitors
continuously chunk distribution among the shard nodes and, if
necessary, performs automatic rebalancing to ensure that the
workload supported by these nodes is balanced.
DB
DB Replication
Replication with
with MongoDB:
MongoDB: MongoDB uses a replication system
based on the master-slave
master-slave architecture. The master server can
perform writing and reading operations, but slave nodes only
perform reads (replica
replica set
set). Updates are communicated to slave
nodes via an operation log called oplog
oplog.
Database
Database Queries
Queries with
with MongoDB:
MongoDB: MongoDB has a powerful API
that allows you to access and analyze data in real time, as well as
perform ad-hoc
ad-hoc queries
queries, that is, direct queries on a database that
are not predefined. This gives users the ability to perform custom
searches, filter documents, and sort results by specific fields. To
carry out these queries, MongoDB uses the “find
find” method on the
desired collection or “findAndModify
findAndModify” to query and update the
values of one or more fields simultaneously.
DB
DB Consistency
Consistency with
with MongoDB:
MongoDB: From version 4.0 (the most recent
one is 6.0), MongoDB supports ACID transactions at document
level. The “snapshot isolation” function provides a consistent view
of the data and allows atomic operations to be performed on
multiple documents within a single transaction. This feature is
especially relevant for NoSQL databases, as it poses solutions to
different consistency-related issues, such as concurrent writes or
[Link] 14/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a
comes very close to the stability of RDMSs.
a
Database
Database indexing
indexing with
with MongoDB:
MongoDB: MongoDB uses B trees to index
a
the data stored in its collections. This is a variant of the B trees with a
index nodes that contain keys and pointers to other nodes. These
indexes store the value of a specific field, allowing data recovery
and deletion operations to be more efficient.
Shares
DB
DB Security
Security with
with MongoDB:
MongoDB: MongoDB has a high level of security
to ensure the confidentiality of stored data. It has several
authentication mechanisms, role-based access configuration, data
encryption at rest and the possibility of restricting access to certain
IP addresses. In addition, it allows you to audit the activity of the
system and keep a record of the operations carried out in the
database.
Apache Cassandra
[Link] 15/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a a
a a
Shares
Let’s take a look at some of its key properties:
Database
Database storage
storage with
with Apache
Apache Cassandra:
Cassandra: Cassandra uses a
“Column Family” data model, which is similar to relational
databases, but more flexible. It does not refer to a hierarchical
structure of columns that contain other columns, but rather to a
collection of key-value pairs, where the key identifies a row and the
value is a set of columns. It is designed to store large amounts of
data and perform more efficient writing and reading operations.
DB
DB Partitioning
Partitioning with
with Apache
Apache Cassandra:
Cassandra: For data distribution,
Cassandra uses a partitioner that distributes data to different
cluster nodes. This partitioner uses the algorithm “consistent
hashing” to assign a unique partition key to each data row. Data
possessing the same partition key will stay together on the same
nodes. It also supports virtual nodes (vnodes), which means that the
same physical node may have multiple data ranges.
DB
DB Replication
Replication with
with Apache
Apache Cassandra:
Cassandra: Cassandra proposes a
replication model based on Peer to peer in which all cluster nodes
accept reads and writes. By not relying on a master node to process
requests, the chance of a bottleneck occurring is minimal. Nodes
communicate with each other and share data using a gossiping
protocol.
DB
DB Queries
Queries with
with Apache
Apache Cassandra:
Cassandra: Like MongoDB, Cassandra also
supports ad-hoc queries, but these tend to be more efficient if they
[Link] 16/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
are based on the primary key. In addition, it has its own query
a
language called CQL (Cassandra Query Language) with a syntax
similar to that of SQL, but instead of using joins, it takes its chances
a
on data denormalization.
a a
DB
DB Indexation
Indexation with
with Apache
Apache Cassandra:
Cassandra: Cassandra uses secondary
indexes to allow efficient queries on columns that are not part of
the primary key. These indices may affect individual columns or
Shares
multiple columns (SSTable Attached Secondary Index). They are
created to allow complex range, prefix or text search queries in a
large number of columns.
DB
DB Coherence
Coherence with
with Apache
Apache Cassandra:
Cassandra: By using Peer to Peer
architecture, Cassandra plays with eventual consistency. Data is
propagated asynchronously across multiple nodes. This means that,
for a short period of time, there may be discrepancies between the
different replicas. However, Cassandra also provides mechanisms
for setting the consistency level. When a conflict takes place (for
example, if the replicas have different versions), use the timestamp
and validate the most recent version. In addition, perform
automatic repairs to maintain data consistency and integrity if
hardware failures or other events that may cause discrepancies
between replicas take place.
DB
DB Security
Security with
with Apache
Apache Cassandra:
Cassandra: To use Cassandra in a safe
environment, it is necessary to perform configurations, since many
options are not enabled by default. For example, activate the
authentication system and set permissions for each user role. In
addition, it is critical to encrypt data in transit and at rest. For
communication between the nodes and the client, data in transit
can be encrypted using SSL/TLS.
[Link] 17/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a
Cassandra prioritizes availability with the Peer to peermodel). a
Unlike RDMS, which share many similarities, in NoSQL databases there is
a
no common paradigm and each system has its own APIs, languages and a a
different implementation, so getting used to working with each of them
can be a real challenge.
Shares
Considering that monitoring is a fundamental component for managing
any database, we must be pragmatic and rely on those resources that
make our lives easier.
Both MongoDB and Apache Cassandra have commands that return
How to do so?
[Link] 18/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
place. These and other automation options help us save considerable time
and resources in maintaining NoSQL databases. a a
a
Create a free account and discover all Pandora FMS utilities to boost
a
your digital project!
And if you have doubts about the difference between NoSQL and SQL
Shares
you can consult our post “NoSQL vs SQL: main differences and when to
choose each of them“.
Ahinóam Rodríguez
I studied Philology, but life circumstances led me to work in
the Marketing sector as a content writer. I am passionate
about the world of blogging and the opportunity to learn that
comes with each new project. I invite you to follow my posts
on the Pandora FMS blog to discover the technological
trends that are transforming the business world.
SEARCH BLOG
Search
[Link] 19/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a a
a a
Shares
[Link] 20/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a a
a a
Shares
[Link] 21/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a a
a a
Shares
[Link] 22/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a a
a a
Shares
Latest articles
[Link] 23/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
NIS2 Directive and Cybersecurity: Requirements, Risk Management,
and Monitoring
Last updated Feb 26, 2025 | Pandora FMSa a
a
Pandora ITSM 105: New Tools for More Efficient IT Management a
Last updated Feb 13, 2025 | ITSM
Shares
Blog categories
Cloud & Virtualization (35)
Community (368)
Enterprises (28)
Features (156)
Howto (35)
Integrations (31)
ITSM (9)
Monitoring (3)
Network (67)
Releases (24)
Servers (55)
Tech (363)
Tips (12)
Trends (1)
[Link] 24/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
Products a Solutions a
Monitoring
Remote Monitoring & Management (RMM)
a Network Monitoring
Log Management
a
Remote Control (RC) Infrastructure
ITSM User experience
SIEM Cloud and virtualization
Shares
Free Trial Security monitoring
Version Comparison Mainframe Monitoring
Resources
Request personalized demo →
IT Topics
+34 91 559 72 22
Plugin library
Downloads C/ Cólquide 6, 2-3E 28231 Las Rozas de
Documentation Madrid, España
Client cases
Blog
Forums Company
About Us
Learn Press Room
[Link] 25/26
3/17/25, 9:14 AM NoSQL Database: The Definitive Guide to NoSQL Databases
a a
What is Single Pane of Glass? Ethical code
MTTR (Mean Time to Repair)
What is Telemetry?
What is a Server? a a
See all →
Shares
Support
Technical Support
Professional Services
Training
Community
FAQ
© 2025 Pandora FMS | Privacy Policy | Terms of use | Cookie Policy | Security
[Link] 26/26