NoSQL and Couchbase

03/02/2020
share

NoSQL databases

NoSQL databases currently surf on a popularity wave. Does that mean they will replace the traditional relational database vision? I don’t think so! They can be useful sometimes because of big data needs and full text searches, but be careful because they don’t work for all.

NoSQL mainly means “not a relational database” (Not SQL) but some of us also say “Not only SQL” because it supports SQL-like queries.

In the family of NoSQL, there are four categories:

  • Document database
  • Graph database
  • Key-value store
  • Wide column store

Couchbase

Couchbase is a NoSQL, Document database, like ElasticSearch and MongoDB. It stores data in document-like structures such as JSON. One of its particularities is that you can store non-normalized, unrelated data. It is a schema-less structure without notion of table, key or reference, unlike traditional databases. Another particularity is that it usually favors availability and speed over consistency.

Couchbase also provides the notion of clusters and nodes to make horizontal scaling. To extend abilities of calculation, you have two solutions: vertical scaling and horizontal scaling. The vertical scaling means adding more power in an existing machine (RAM, CPU). The horizontal scaling means adding machines/nodes in a collection called cluster. Each node communicates with the others to perform a set of operations at high level rates. Of course, both can be used at the same time.

What does that genuinely mean? It means that you don’t have data checks (except for Json format) and the synchronization between nodes is faster than in relational databases, but it also means you can temporarily lose the accuracy of the data. SQL-like queries are useful but only with the accurate index associated. Sophisticated queries are to be banished because they engage heavy indexes and more calculation resources. All these specificities cut both ways. A NoSQL database can be used for large sets of data updated frequently through different systems or in the cloud.

Comparison SQL and NoSQL databases
Image from scylladb.com, article NoSQL vs SQL

NoSQL systems are also used for data « not so easy » to integrate in relational database tables like documents, images, twitter flow and other « big data » (as different types). Data in relational databases are easy to split in atomic types until the smallest component can be handled. For sample, the name of a customer is rarely stored in one unique field, it is usually split in last name, first name and civility. It allows to make an alphabetic last name query or to get the percentage of gentlemen versus ladies. On the other hand, it is maybe ineffective to split an image in a pixel table. What is the SQL query to search landscape or person image?  

Couchbase already boasts of serving Coyote for a safer and more efficient driving experience, PayPal for the payment processing and big data integration, Pfizer to deliver robust indexing capabilities for their reporting, Ryanair to increase their app performance and enhance their user experience, Viber for their support skyrocketing and many others.

Subscribe to receive new publications