NOSQL Database
NOSQL Database
NOSQL Database
https://www.mongodb.com/nosql-explained
Overview
To help you better understand NoSQL, this page covers:
What is NoSQL and what is a NoSQL database good for?
Why use NoSQL?
How does NoSQL work?
Conclusion
NoSQL databases store data in documents rather than relational tables. Accordingly,
we classify them as "not only SQL" and subdivide them by a variety of flexible data models.
Types of NoSQL databases include pure document databases, key-value stores, wide-column
databases, and graph databases. NoSQL databases are built from the ground up to store and
process vast amounts of data at scale and support a growing number of modern businesses.
What is NoSQL and what is a NoSQL database?
NoSQL database technology stores information in JSON documents instead of columns and
rows used by relational databases. To be clear, NoSQL stands for “not only SQL” rather than
“no SQL” at all. This means a NoSQL JSON database can store and retrieve data using literally
“no SQL.” Or you can combine the flexibility of JSON with the power of SQL for the best of
both worlds. Consequently, NoSQL databases are built to be flexible, scalable, and capable of
rapidly responding to the data management demands of modern businesses. The following
defines the four most-popular types of NoSQL database:
Document databases are primarily built for storing information as documents, including, but
not limited to, JSON documents. These systems can also be used for storing XML documents,
for a NoSQL database example.
Key-value stores group associated data in collections with records that are identified with
unique keys for easy retrieval. Key-value stores have just enough structure to mirror the
value of relational databases (as opposed to non-relational databases) while still preserving
the benefits of the NoSQL database structure.
Wide-column databases use the tabular format of relational databases yet allow a wide
variance in how data is named and formatted in each row, even in the same table. Like key-
value stores, wide-column databases have some basic NoSQL structure while also preserving
a lot of flexibility
Graph databases use graph structures to define the relationships between stored data
points. Graph databases are useful for identifying patterns in unstructured and semi-
structured information.
Why use NoSQL?
Customer experience has quickly become the most important competitive differentiator and
ushered the business world into an era of monumental change. As part of this revolution,
enterprises are interacting digitally – not only with their customers, but also with their
employees, partners, vendors, and even their products – at an unprecedented scale. This
interaction is powered by the internet and other 21st century technologies – and at the heart
of the revolution of NoSQL are a company’s big data, cloud, mobile, social media, and IoT
applications.
1
How are these applications different from legacy enterprise applications like ERP, HR, and
financial accounting? Today’s web, mobile, and IoT applications share one or more (if not all)
of the following characteristics. They need to:
Support large numbers of concurrent users (tens of thousands, perhaps millions)
Deliver highly responsive experiences to a globally distributed base of users
Be always available – no downtime
Handle semi- and unstructured data
Rapidly adapt to changing requirements with frequent updates and new features
Building and running these massively interactive applications has created a new set of
technology requirements. The new enterprise NoSQL technology architecture needs to be far
more agile than ever before, and requires an approach to real-time data management that
can accommodate unprecedented levels of scale, speed, and data variability. Relational
databases are unable to meet these new requirements, and enterprises are therefore turning
to NoSQL database technology.
Global 2000 enterprises are rapidly embracing NoSQL databases to power their mission-
critical applications:
Tesco, Europe’s No. 1 retailer, deploys NoSQL for e-commerce, product catalog, and other
applications
Marriott deploys NoSQL for its reservation system that books $38 billion annually
Gannett, the No. 1 U.S. newspaper publisher, uses NoSQL for its proprietary content
management system, Presto
GE deploys NoSQL for its Predix platform to help manage the Industrial Internet
Five trends creating new technical challenges that NoSQL DBs address
These companies and hundreds more like them are turning to NoSQL because of five trends
that present technical challenges that are too difficult for most relational databases.
Digital Economy
Requirements
trends
4. Applications are • Scaling on demand to support more customers, store more data
2
Digital Economy
Requirements
trends
3
Figure1 : RDBMS – An explicit schema prevents the addition of new attributes on demand.
By contrast, a NoSQL database fully supports agile development and does not statically
define how the data must be modeled. Instead, NoSQL defers to the applications and
services, and thus to the developers as to how data should be modeled. With NoSQL, the data
model is defined by the application model. Applications and services model data as objects.
Figure2 : JSON – The data model evolves as new attributes are added on demand.
Figure 3 : RDBMS – Applications “shred” objects into rows of data stored in multiple tables.
Figure 4 : RDBMS – Queries return duplicate data, applications have to filter it out.
5
By contrast, in a document-oriented database defined as NoSQL, JSON is the de facto format
for storing data – helpfully, it’s also the de facto standard for consuming and producing data
for web, mobile, and IoT applications. JSON not only eliminates the object-relational
impedance mismatch, it also eliminates the overhead of ORM frameworks and simplifies
application development because objects are read and written without “shredding” them (i.e.,
a single object can be read or written as a single document), as illustrated in Figure 5.
Figure 5 : JSON – Applications can store objects with nested data as single documents.
SQL++
Figure 6 : RDBMS – The server is too big or too small, leading to unnecessary costs or poor
performance.
A distributed NoSQL database, however, leverages commodity hardware to scale out – i.e.,
add more resources simply by adding more servers. The ability to scale out enables
enterprises to scale more efficiently by (a) deploying no more hardware than is required to
meet the current load; (b) leveraging less expensive hardware and/or cloud infrastructure;
and (c) scaling on demand and without downtime.
7
Figure 7 : NoSQL – Add commodity servers on demand so the hardware resources match the
application load.
In addition to being able to scale effective and efficiently, distributed NoSQL databases are
easy to install, configure, and scale. They were engineered to distribute reads, writes, and
storage, and they were engineered to operate at any scale – including the management and
monitoring of clusters small and large.
Availability for always-on, global deployment
As more and more customer engagements take place online via web and mobile apps,
availability becomes a major, if not primary, concern. These mission-critical applications have
to be available 24 hours a day, 7 days a week – no exceptions. Delivering 24×7 availability is
a challenge for relational databases that are deployed to a single physical server or that rely
on clustering with shared storage. If deployed as a single server and it fails, or as a cluster
and the shared storage fails, the database becomes unavailable.
Figure 8 : RDBMS – The failure of a server or storage device brings down the entire database.
8
In contrast to relational technology, a distributed, NoSQL database partitions and distributes
data to multiple database instances with no shared resources. In addition, the data can be
replicated to one or more instances for high availability (intercluster replication). While
relational databases like Oracle require separate software for replication (e.g., Oracle Active
Data Guard), NoSQL databases do not – it’s built in and it’s automatic. In addition, automatic
failover ensures that if a node fails, the database can continue to perform reads and writes by
sending the requests to a different node.
As customer engagements move online, the need to be available in multiple countries and/or
regions becomes critical. While deploying a database to multiple datacenters increases
availability and helps with disaster recovery, it also has the benefit of increasing performance,
because all reads and writes can be executed on the nearest datacenter, thereby reducing
latency.
Ensuring global availability is difficult for relational databases in cases where the requirement
of separate add-ons increases complexity (e.g., Oracle requires Oracle GoldenGate to move
data between databases) – or when replication between multiple datacenters can only be
used for failover because only one datacenter is active at a time. Also, when replicating
between datacenters, applications built on relational databases can experience performance
degradation or find that the datacenters are severely out of sync.
Conclusion
So what are NoSQL databases and why do they matter now? As enterprises shift to the Digital
Economy – enabled by cloud, mobile, social media, and big data technologies – developers
and operations teams have to build and maintain web, mobile, and IoT applications faster and
faster, and at greater scale. Flexible, high-performance NoSQL is increasingly the preferred
database technology to power today’s web, mobile, and IoT applications.
Hundreds of Global 2000 enterprises, along with tens of thousands smaller businesses and
startups, have adopted NoSQL. For many, the use of NoSQL started with a cache, proof of
concept, or a small application, then expanded to targeted mission-critical applications, and is
now the foundation for all application development.
With NoSQL, enterprises are better able to both develop with agility and operate at any scale
– and deliver the performance and availability required to meet the demands of Digital
Economy businesses.
10