What is NoSQL ?
A NoSQL Database is a non-relational data management system that does not need a pre-defined schema. It doesn’t need any joins and is simple to scale. The primary use of a NoSQL database is for remote data stores with large data storage requirements. Big data and real-time mobile applications both use NoSQL.
History
- Carlo Strozzi coined the term “NoSQL” in 1998
- In 2009, Eric Evans and Johan Oskarsson resurrected the term to describe non-relational databases
NoSQL — CAP Theorem
- C — Consistency
- A — Availability
- P — Partition Tolerance
Consistency
Consistency assumes that all clients see the same data at the same time, no matter which node they are connected to. When data is written to one node, it must be automatically forwarded or repeated to all other nodes in the system before the write is considered “efficient.”
Availability
Availability ensures that any client making a data request will receive a response, even though one or more nodes are down. Another way to state this all operating nodes in the distributed system return a legitimate response to any message, without exception.
Partition Tolerance
A partition is a connectivity split within a distributed system, a missing or momentarily interrupted link between two nodes. Partition tolerance ensures that the cluster must continue to operate despite the amount of contact gaps between the nodes in the system.
Types of NoSQL Databases
Here are the four major categories of NoSQL database:
- Key-value stores
- Document databases
- Column-oriented databases
- Graph databases
Key-Value Stores
A key-value store is the most basic kind of NoSQL database. Any database data variable is stored as a key value pair, which consists of an attribute name (or “key”) and a value.
Ex — Redis, Riak, Memcached
Document Databases
Data is stored in JSON, BSON, or XML documents in a text archive. Documents in a paper archive may be nested. For easier querying, specific items may be indexed.
Ex — MongoDB
Column-Oriented Databases
A column store is arranged as a series of columns, while a relational database stores data in tables and reads data row by row. This means that if you only need to analyze a few columns, you can read those columns directly without wasting memory with unnecessary data.
Ex — Cassandra
Graph Databases
The relationship between data elements is the focus of a graph database. Any unit is represented by a node (such as a person in a social media graph).
Ex — Neo4j
Benefits of NoSQL Databases
- With a scale-out architecture, you can handle large volumes of data at high speeds
- Data can be stored in an unstructured, semi-structured, or structured format
- Make schema and field updates simple
- Be developer-friendly
- Utilize the cloud to ensure that there is no downtime.