Last week we talked about the big differences between NoSQL databases and the consequent responsibility on software architects to pick out the appropriate one for each project. You can read the post here: “The ultimate NoSQL comparison (Beyond MongoDB and CrunchDB)”.
As we mentioned before, there are hundreds of available NoSQL databases, we just need to know, how to choose the right one. According to their data model and storage they are usually divided in four categories and this classification is due to the fact that each kind of database offers different solutions for specific contexts.
- - Key-Value Stores: Key-value (KV) stores use the associative array (also known as a map or dictionary) as their fundamental data model. In this model, data is represented as a collection of key-value pairs, such that each possible key appears at most once in the collection.
- - Document Stores: The central concept of a document store is the notion of a "document". While each document-oriented database implementation differs on the details of this definition, in general, they all assume that documents encapsulate and encode data (or information) in some standard formats or encodings.
- - Graph databases: This kind of database is designed for data whose relations are well represented as a graph consisting of elements interconnected with a finite number of relations between them. The type of data could be social relations, public transport links, road maps or network topologies.
- - Column Stores: A wide column store is in fact a type of key-value database. It uses tables, rows, and columns, but unlike a relational database, the names and format of the columns can vary from row to row in the same table.
Enlarging the comparison of Open Source NOSQL databases:
Now well, before to choose a NoSQL database we must to evaluate a several quality attributes: availability, consistency, durability, maintainability, performance, reliability, robustness and scalability. NoSQL is still an in-development field, with an ever-increasing and ever-changing technology, but software engineers must to understanding the wide array of offerings in the NoSQL world from a quality attribute based overview. The intention of this post is to delve into this and help to understand how each of these attributes can affects the software quality of the database.
Availability
Availability concerns what percentage of time a system is operating correctly. NoSQL technology is inherently bound to provide availability more easily than relational systems. In fact, NoSQL databases oppose most relational databases by favoring availability instead of consistency. Thus, one can assert that the higher the availability of a NoSQL system, the less likely it is that it provides high consistency guarantees.
Consistency
Consistency is related to transactions and can be seen as the guarantee that transactions started in the future see the effects of transactions committed in the past, coupled with the insurance of database constraints.
Durability
Durability refers to the requirement that data be valid and committed to disk after a successful transaction. It is important to know that if a system suffers from consistency problems, its durability will also be at risk, leading to potential data loss.
Maintainability
Maintainability is a quality attribute that regards the ease with which a product can be maintained (upgraded, repaired, debugged and met with new requirements).
Performance
Regardless of the system type and records, the database has an optimization that is granted by its mechanisms used for storage, organization and retrieval of data. Summary, it is all about the database architecture.
Reliability
Reliability concerns the system’s probability of operating without failures for a given period of time. The higher the reliability, the less likely it is that the system fails.
Robustness
It is simple. Robustness is concerned with the ability of the database to cope with errors during execution. In general, more popular and used databases are more robust, although in practice, these systems are seen as less robust than their relational counterparts.
Scalability
Scalability concerns a system’s ability to deal with increasing workloads. In the context of databases, it may be defined as the change in performance when new nodes are added, or hardware is improved. NoSQL databases have been developed specifically to target scenarios where scalability is very important.