Chat Zalo Chat Messenger Phone Number Đăng nhập
What Is NoSQL? NoSQL Databases Explained - MongoDB

What Is NoSQL? NoSQL Databases Explained – MongoDB

NoSQL databases have one important thing in common: they are not based on the traditional row and column schema that relational databases use. But from that point, NoSQL databases diverge. Here we explore the main types of NoSQL databases along with examples of how they are used in practice.

Document

database example Document

databases

store data in a document data model using JavaScript Object Notation (JSON) or XML objects. Each document contains markup that identifies fields and values. Values can vary over common types, including strings, numbers, Booleans, arrays, and nested data.

To improve flexibility, the data model of the document may vary from record to record. It is popular with developers because JSON documents capture structures that normally align with the objects that developers are working with in code.

NoSQL databases are typically deployed with a scale-out architecture that provides a clear path to support large amounts of data or traffic.

Creating a single view of data (sometimes called a 360 client) is a major challenge for many companies. In many organizations, data has been isolated by department: shipping data is separated from product data, which in turn is separated from customer data, of which sales and customer service can have a version.

AO.com, one

of the UK’s largest electronics stores, needed to create a single view of its data to support applications, including its call centre, fraud team, and GDPR compliance efforts. After reviewing several NoSQL databases, AO.com chose MongoDB Atlas. According to Jon Vines, software development team leader at AO.com, “It soon became clear that the MongoDB document model was the best fit for us. It supports rich client objects that we can further enrich at any stage without costly schema migrations.”

Key-value databases

use a very simple schema: a single key is paired with a collection of values, where values can be anything from a string to a large binary object. One way that databases that use this structure gain in performance is that there are no complex queries.

The MediaWiki software is used by Wikipedia as well as tens of thousands of other websites. Memcached is an in-memory key-value store that MediaWiki uses to cache values to reduce the need for costly calculations and reduce the load on database servers. This provides a high-performance distributed system that accelerates dynamic web applications.

In this example of a key-value store, a unique key is used to store small arbitrary pieces of data (strings and other objects) from results of database calls, API calls, or page rendering. Performance is increased by caching the results of a database query in Memcached for an arbitrary period of time, such as 5 minutes, and then querying Memcached first for the results instead of the database.

Wide

column store example

A wide column store handles data by using a modified table model. Data is stored using key rows that can be associated with one or more dynamic columns. What makes this model so flexible is that the structure of column data can vary from row to row. Wide column stores are often used to store large amounts of data: billions of rows with millions of columns.

Ebay uses the Cassandra wide-column store as part of its inventory management system, which supports critical use cases and applications that need analytics and real-time capabilities.

Example of a graphical database

Connecting data in relational databases requires the creation of JOINs between tables. Such JOINs take a long time.

If you’re building an application where you need to traverse connections between data quickly, a graph database may be a good choice. Think of real-time recommendations on an e-commerce site, where the app needs to connect data about what the user is looking for, what the user has bought in the past, what users like this user have bought, what preferences and interests the user has, what products go well with the product being viewed, what’s currently in stock, and more. The ability to connect all that data in real time at best leads to a suggestion that captures the user’s attention and interest, representing a new sale or a complement to an existing order. This is an example of a use case for a graph database.

Sometimes the answer to a data problem is not one type of NoSQL database, but several data stores. Storing data in multiple databases is known as polyglot persistence.

For example, Zephyr built a platform that integrates diverse healthcare data using a document database (MongoDB) and a graph database (Neo4j). Zephyr (which was subsequently purchased by Anju Life Sciences Software) stores most of its data in MongoDB in a flexible JSON format, while Neo4j is used to store relationships between data elements such as nodes and edges, with pointers to the entire data in MongoDB.

Frequently Asked Questions

What are some examples of how NoSQL

databases are used?

NoSQL databases are used in several ways. Graph databases are used to analyze connections in data, while key-value stores are often used for caches and in microservices architectures. Because of the flexibility of the document model, document databases are used for a wide range of applications, from building mobile applications to consolidating many data sources into a single view and supporting real-time event-driven architectures.

Are multiple NoSQL databases used together?

yes. Depending on their needs, organizations sometimes use more than one type of database, both relational and NoSQL, to meet their application needs. Storing data in more than one database is known as polyglot persistence.

Related

  • ResourcesWhat is NoSQL? NoSQL databases explained
  • What are the main differences between NoSQL and SQL?

  • When should a NoSQL database be used
  • ? What are

  • the 4 different types
  • of NoSQL databases?

  • What are the advantages of NoSQL databases? NoSQL
  • Data Modeling and Schema Design

Contact US