The Battle of (No)SQL
April 19, 2015
There is an on-going debate in the tech world. It is one of thoroughly convinced, anonymous opinions. It is SQL vs. noSQL. For the unitiated, or newbs like me, SQL reads as "sequel" and it stands for Structured Query Language. This isn't a debate about the presence of SQL vs its lack, but rather when to use SQL. Many consider SQL less functional and unable to handle modern data loads. They propose the the alternative NoSQL. NoSQL doesn't mean No Sql or Not Sql. It is commonly understood to mean Not Only SQL, and it accepts many more data relationships than SQL. The queation is, what are the differences between SQL and NoSQL?
SQL is what is called a Relationship Database Model. It is comprised of a set of columns of data points all tied to the singular relationship of the singular Primary Key. Therefore, a set of data about people may be all tied to a either a birthdate, or more likely, a Social Security Number. The set of data is organized into a fixed "Schema" that is fixed, and cannot be changed unless the database is remodeled offline. The major argument, or one of them, is that SQL isn't scalable except vertically. By that, the data must all remain in one place and requires larger storage the larger it gets. NoSQL offers all the flexibility that SQL lacks.
The first major difference for NoSQL is the freedom in the relationship model. This allows for a host of databases rather than one structure. Each one can consist of a different model, and yet they can still interact with one another. The most employed structure are document, graph, key-value and columnar. For the document style data is stored in documents, and these documents are grouped together in collections. Each document can have a completely different structure. The key-value model is stored in an associative array of key-value pairs. The key is an attribute name, which is linked to a value. The graph model stores data in the way a graph would be mapped. Finally, the columnar stores data in column "families". The major difference between this and SQL is that you don't need to know the size of the data when designing the database. This leeads to another difference, and that is dynamic schema structure. Lastly, NoSQL can be scaled horizontally. This means that when space on one server runs out, the designer has the ability to link the database to he new server rather than uploading the entire old database.
That about does it for the scope of this blog. Tune in next time!
Again Soon,
Staunton