Actions

NoSQL

Revision as of 20:15, 3 December 2021 by User (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

What is NoSQL[1]

A NoSQL (originally referring to "non-SQL" or "non-relational") database provides a mechanism for storage and retrieval of data that is modeled in means other than the tabular relations used in relational databases. Such databases have existed since the late 1960s, but the name "NoSQL" was only coined in the early 21st century, triggered by the needs of Web 2.0 companies. NoSQL databases are increasingly used in big data and real-time web applications. NoSQL systems are also sometimes called "Not only SQL" to emphasize that they may support SQL-like query languages or sit alongside SQL databases in polyglot-persistent architectures. The term NoSQL was used by Carlo Strozzi in 1998 to name his lightweight Strozzi NoSQL open-source relational database that did not expose the standard Structured Query Language (SQL) interface, but was still relational.



History of NoSQL Databases[2]

NoSQL databases emerged in the late 2000s as the cost of storage dramatically decreased. Gone were the days of needing to create a complex, difficult-to-manage data model in order to avoid data duplication. Developers (rather than storage) were becoming the primary cost of software development, so NoSQL databases optimized for developer productivity.


History of NoSqL


As storage costs rapidly decreased, the amount of data that applications needed to store and query increased. This data came in all shapes and sizes — structured, semi-structured, and polymorphic — and defining the schema in advance became nearly impossible. NoSQL databases allow developers to store huge amounts of unstructured data, giving them a lot of flexibility.

Additionally, the Agile Manifesto was rising in popularity, and software engineers were rethinking the way they developed software. They were recognizing the need to rapidly adapt to changing requirements. They needed the ability to iterate quickly and make changes throughout their software stack — all the way down to the database. NoSQL databases gave them this flexibility.

Cloud computing also rose in popularity, and developers began using public clouds to host their applications and data. They wanted the ability to distribute data across multiple servers and regions to make their applications resilient, to scale out instead of scale up, and to intelligently geo-place their data. Some NoSQL databases like MongoDB provide these capabilities.


Types of NoSQL[3]

Most nonrelational, high-performance databases, sometimes called “not only SQL,” can also handle highly structured data—they just aren’t limited to fixed data models like relational (SQL) databases. The four most common types of NoSQL databases are:

  • Key-value: Key-value stores pair keys and values using a hash table. Key-value types are best when a key is known and the associated value for the key is unknown.
  • Document: Document databases extend the concept of the key-value database by organizing entire documents into groups called collections. They support nested key-value pairs and allow queries on any attribute within a document.
  • Columnar: Columnar, wide-column, or column-family databases efficiently store data and query across rows of sparse data and are advantageous when querying across specific columns in the database.
  • Graph: Graph databases use a model based on nodes and edges to represent interconnected data—such as relationships between people in a social network—and offer simplified storage and navigation through complex relationships.


NoSQL vs SQL Databases[4]

Modern application developers have many choices when faced with deciding when and how to persist a piece of data. While SQL databases are great at solving traditional application problems like data normalization, strictly consistent data, and complex queries to access that data, NoSQL databases turn out to be great at processing unstructured data dynamically.


SQL Vs. NoSQL


1) NoSQL is not a replacement for RDBMS.
2) SQL databases are relational, NoSQL databases are non-relational.
3) SQL databases use structured query language and have a predefined schema. NoSQL databases have dynamic schemas for unstructured data.
4) SQL databases are better for multi-row transactions, NoSQL is better for unstructured data like documents or JSON.
5) Most SQL databases require you to scale-up vertically, NoSQL databases allow you to scale-out horizontally.
6) Queries in NoSQL databases can be faster than SQL databases.


Why Use SQL[5]

NoSQL databases are a great fit for many modern applications such as mobile, web, and gaming that require flexible, scalable, high-performance, and highly functional databases to provide great user experiences.

  • Flexibility: NoSQL databases generally provide flexible schemas that enable faster and more iterative development. The flexible data model makes NoSQL databases ideal for semi-structured and unstructured data.
  • Scalability: NoSQL databases are generally designed to scale out by using distributed clusters of hardware instead of scaling up by adding expensive and robust servers. Some cloud providers handle these operations behind-the-scenes as a fully managed service.
  • High-performance: NoSQL database are optimized for specific data models and access patterns that enable higher performance than trying to accomplish similar functionality with relational databases.
  • Highly functional: NoSQL databases provide highly functional APIs and data types that are purpose built for each of their respective data models.


Trends and their Technical Challenges that NoSQL Addresses[6]

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 Trends Requirements
1. More customers are going online
  • Scaling to support thousands, if not millions, of users
  • Meeting UX requirements with consistent high performance
  • Maintaining availability 24 hours a day, 7 days a week
2. The internet is connecting everything
  • Supporting many different things with different data structures
  • Supporting hardware/software updates, generating different data
  • Supporting continuous streams of real-time data
3. Big data is getting bigger
  • Storing customer generated semi-structured/unstructured data
  • Storing different types of data from different sources, together
  • Storing data generated by thousands/millions of customers/things
4. Applications are moving to the cloud
  • Scaling on demand to support more customers, store more data
  • Operating applications on a global scale – customers worldwide
  • Minimizing infrastructure costs, achieving a faster time to market
5. The world has gone mobile
  • Creating “offline first” apps – network connection not required
  • Synchronizing mobile data with remote databases in the cloud
  • Supporting multiple mobile platforms with a single backend


Advantages and Disadvantages of NoSQL[7]

Advantages of NoSQL
There are many advantages of working with NoSQL databases such as MongoDB and Cassandra. The main advantages are high scalability and high availability.

  • High scalability: NoSQL database use sharding for horizontal scaling. Partitioning of data and placing it on multiple machines in such a way that the order of the data is preserved is sharding. Vertical scaling means adding more resources to the existing machine whereas horizontal scaling means adding more machines to handle the data. Vertical scaling is not that easy to implement but horizontal scaling is easy to implement. Examples of horizontal scaling databases are MongoDB, Cassandra etc. NoSQL can handle huge amount of data because of scalability, as the data grows NoSQL scale itself to handle that data in efficient manner.
  • High availability: Auto replication feature in NoSQL databases makes it highly available because in case of any failure data replicates itself to the previous consistent state.

Disadvantages of NoSQL
NoSQL has the following disadvantages.

  • Narrow focus: NoSQL databases have very narrow focus as it is mainly designed for storage but it provides very little functionality. Relational databases are a better choice in the field of Transaction Management than NoSQL.
  • Open-source: NoSQL is open-source database. There is no reliable standard for NoSQL yet. In other words two database systems are likely to be unequal.
  • Management challenge: The purpose of big data tools is to make management of a large amount of data as simple as possible. But it is not so easy. Data management in NoSQL is much more complex than a relational database. NoSQL, in particular, has a reputation for being challenging to install and even more hectic to manage on a daily basis.
  • GUI is not available: GUI mode tools to access the database is not flexibly available in the market.
  • Backup: Backup is a great weak point for some NoSQL databases like MongoDB. MongoDB has no approach for the backup of data in a consistent manner.
  • Large document size: Some database systems like MongoDB and CouchDB store data in JSON format. Which means that documents are quite large (BigData, network bandwidth, speed), and having descriptive key names actually hurts, since they increase the document size.


See Also


References

  1. Definition - What Does NoSQL Mean? Wikipedia
  2. Brief history of NoSQL databases MongoDB
  3. Types of data models with NoSQL databases Microsoft
  4. NoSQL vs SQL Databases K21 Academy
  5. Why should you use a NoSQL database? AWS
  6. Five trends creating new technical challenges that NoSQL DBs address Couchbase
  7. Advantages and Disadvantages of NoSQL Geeks for geeks