Let’s start with a simple question: What is the real difference between NoSQL and SQL?
the different access patterns provided by NoSQL and SQL result in very differentscalability and performance.
NoSQL elements allow data access only in a
narrow predefined access pattern
. For example,DHT (Distributed Hash Table) is accessible via hashtable API; given the exact key, the value isreturned. The access pattern for other NoSQL data services is similarly narrow and well-defined,and as a result scalability and performance structure are predictable and reliable.In SQL, the access pattern is not known in advance, the tables are modeled, assumptions aremade regarding the access patterns, and these assumptions are translated into predefinedoptimizations like index definitions. SQL is by definition a generic language that allows accessto data in various ways. The programmer also has limited control over the execution of the SQLstatements; mostly, the database engine is responsible for optimizing the execution of thestatements. In other words, in SQL, the data model does not enforce a specific way to work withthe data
it is built with an emphasis on
data integrity, simplicity, data normalization andabstraction,
which are all extremely important for large complex applications.
The NoSQL approach presents huge advantages over SQL databases because it allows one to
scale an application to new levels
. The new data services are based on truly scalable structuresand architectures, built for the cloud, built for distribution, and are very attractive to the
application developer. There’s no need for DBA, no need for complicated SQL queries and it is
freedom for the people
!This is no small matter
a good programmer’s freedom to choose a data model, write a
program or an application with familiar tools, reduce dependencies on other people, test and
optimize the code without doing guesswork or counting on a black box (DB). Yes, it’s slow o
the test system, but someone will take care of it later by tuning the DB…these are all major
advantages of the NoSQL movement.
And Why Not…
There are some disadvantages to the NoSQL approach. Those are
less visible at the developerlevel, but are highly visible at the system, architecture and operational levels.
At the system level, data models are key
. Not having a skilled authority to design asingle, well-defined data model, regardless of the technology used, has its drawbacks.The data model may suffer from duplication of data objects (non-normalized model).This can happen due to the different object model used by different developers and theirmapping to the persistency model. At the system level one must also understand thelimitations of the chosen data service, whether it is size, ops per second, concurrencymodel, etc.