Cloud Zone is brought to you in partnership with:

Avi is a DZone MVB and is not an employee of DZone and has posted 16 posts at DZone. You can read more from them at their website. View Full User Profile

SQL vs NoSQL in the Cloud: Which Database Should You Choose?

07.15.2011
| 52126 views |
  • submit to reddit
Let’s start with a simple question: What is the real difference between NoSQL and SQL?  In my view, the different access patterns provided by NoSQL and SQL result in very different scalability 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 is returned. 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 are made regarding the access patterns, and these assumptions are translated into predefined optimizations like index definitions. SQL is by definition a generic language that allows access to data in various ways. The programmer also has limited control over the execution of the SQL statements; mostly, the database engine is responsible for optimizing the execution of the statements. In other words, in SQL, the data model does not enforce a specific way to work with the data — it is built with an emphasis on data integrity, simplicity, data normalization and abstraction, which are all extremely important for large complex applications.

Why NoSQL

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 structures and 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 fast. Hooray, 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 on 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 developer level, but are highly visible at the system, architecture and operational levels.

  1. At the system level, data models are key. Not having a skilled authority to design a single, 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 their mapping to the persistency model. At the system level one must also understand the limitations of the chosen data service, whether it is size, ops per second, concurrency model, etc.
  2. At the architecture level, two major issues are interfaces and interoperability. Interfaces for the NoSQL data services are yet to be standardized. Even DHT, which is one of the simpler interfaces, still has no standard semantics, which includes transactions, none blocking API etc. Each DHT service used comes with its own set of interfaces. Another big issue is how different data structures, such as DHT and a binary tree, just as an example, share data objects. There are no intrinsic semantics for pointers in all those services. In fact, there’s usually not even strong typing in these services — it’s the developer’s responsibility to deal with that.Interoperability is an important point, especially when data needs to be accessed by multiple services. A simple example: backoffice works in Java, web serving works in php, can the data be accessed easily from both domains? Clearly one can use web services in front of the data as a data access layer, but that complicates things even more, and reduces business agility, flexibility and performance while increasing development overhead.
  3. Moving to the operational realm, here, from my experience, lies the toughest resistance, and rightfully so…The operational environment requires a set of tools that is not only scalable but also manageable and stable, be it on the cloud or on a fixed set of servers. When something goes wrong, it should not require going through the whole chain and up to the developer level to diagnose the problem. In fact, that is exactly what operation managers regard as an operational nightmare. Have you ever tried getting a developer to diagnose why a payment system is not functioning while he’s at a bar and a few beers in? I’m sure the developer’s date would be impressed by his dedication to his work, but that’s a pretty expensive way to impress someone :)Operation needs to be systematic and self contained. With the current NoSQL services available in the market, this is not easy to achieve, even in managed environments such as Amazon.

So, how can we gain the major advantages of the NoSQL approach while keeping the advantages of the SQL approach?

SQL and NoSQL Joined:

A SQL database implementation that uses NoSQL infrastructure is a good solution. A SQL database that is scalable, manageable, cloud-ready, highly available and built entirely on NoSQL infrastructure, but still provides all the advantages of a SQL database, such as interoperability, well-defined semantics and more.

This hybrid would not be as fast as a NoSQL service, but it may be good enough for the 80% of the market that needs stronger scalability and organic cloud behavior.

Such a solution would also allow migrating existing applications easily into cloud environments, thus protecting huge investments made by organizations in those applications.

It is my opinion that a SQL database built on NoSQL foundations can provide the highest value to customers who wish to be both agile and efficient while they grow.

References
Published at DZone with permission of Avi Kapuya, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Tags:

Comments

Kai Wähner replied on Mon, 2011/07/18 - 5:46am

Good article. I agree that a SQL database built on NoSQL foundations would be the best solution, and sufficient in 80 percent. Nevertheless, I wonder if such a solution will be available soon.

I also discussed the problem "NoSQL vs. SQL" shortly in my article about Google App Engine (GAE) with Spring Roo: http://www.kai-waehner.de/blog/2011/07/18/rapid-cloud-development-with-spring-roo-%E2%80%93-part-1-google-app-engine-gae.

I think that there are some reasons why Google developers do not support SQL (yet), but only NoSQL using BigTable. Is uses several different concepts - and these concepts seem to be necessary for offering good scalability in the cloud at the moment.

Everyone should be aware that GAE is the only production-ready PaaS solution in the Java environment at the moment. For instance, VMware Cloud Foundry will support MySQL from the beginning, but it is still in BETA status. I assume that it is not that easy to offer good scalability using MySQL as database in the cloud. I also assume that Google developers know what they do and why they do not offer a SQL solution for GAE yet. Nevertheless, I am really looking forward to the final release of Cloud Foundry.

 

Best regards,

Kai Wähner (Twitter: @KaiWaehner)

Sirikant Noori replied on Sat, 2012/03/31 - 6:38am

I want to like NoSQL … I really liked the AE datastore when I used it, but that was mostly because it has a nice familiar ORM-like API and what appears to be a relational model of sorts. Which all might mean I wasn’t using it to its capacity.

jsp

John Smith replied on Sat, 2013/02/16 - 5:05am

 Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. There tend to be not many people who can certainly write not so simple posts that artistically. Continue the nice writing
      adonis index review

Ron Sim replied on Mon, 2013/02/25 - 8:34am

 Hi! Thanks for the great information you havr provided! You have touched on crucuial points!

          buy youtube retention views

Ron Sim replied on Tue, 2013/02/26 - 4:54am in response to: Kai Wähner

 Thanks for posting this info. I just want to let you know that I just check out your site and I find it very interesting and informative. I can't wait to read lots of your posts.

            http://www.virtual-casinos.info

Zahid Iqbal replied on Sun, 2013/03/17 - 12:39pm

I really like it! I'll always appreciate your brief sharing in this awesome stuffs sincerely,this discussion has put light on this topic.Glasgow airport cab 

Sohail Akik replied on Mon, 2013/03/18 - 4:17am

I get a lot of great information here and this is what I am searching for. Thank you for your sharing. I have bookmark this page for my future reference.how to buy youtube views 

Laik Iakaik replied on Mon, 2013/03/18 - 11:36am

Your post had provided me with another point of view on this topic. I have learned a lot from this post. the tao of badass pdf 

John Lewis replied on Thu, 2013/05/23 - 1:37pm

 When you have nice post then content helps you with latest information. here it is the same situation, i have new tips to reduce your fat in most quick way. Power Ranch Homes for Sale 

Passion Lab replied on Mon, 2013/06/03 - 9:36am

I just see the site and I want to say that I am very much benefited for this site. If anyone visit the site he understood that what he get from it. I really enjoy it and in the next I will visit the site again. 1-devismutuelle.fr

Links Mega replied on Sun, 2013/06/30 - 3:12am

 I know it is quite hard to be relevant on each topic but the way you described this topic, is quite amazing. You would freelancer  be glad to know that there are online courses like which are offered online and you may learn the way you want. I am here to say that you would be glad to learn more through this online facility.

Links Mega replied on Thu, 2013/07/04 - 4:11am

 One of the amazing written stuff and i like the methodology of this article which is supremely expressed and well translated like we have online courses which would help you to enhance your knowledge in  freelance writing  , because it has same taste of writing style and conveying power to readers, Hope you would like it.

King Tiger replied on Wed, 2013/11/13 - 10:58pm

 Pretty adequate post. I merely stumbled aloft your web log and basic to say that I acquire extremely enjoyed annual your web log posts.check icon 

King Tiger replied on Wed, 2013/11/20 - 5:34am

If you make use of like that wordpress. com perhaps you can construct and create lots of sites without any subsequent cost. solar panels for the home 

King Tiger replied on Mon, 2013/11/25 - 3:03am

Thanks a lot for providing individuals with a spectacular possibility, I am always searching online for articles that can help me...bestcustomwritingservices5.webnode.com 

Lukas Eder replied on Mon, 2013/12/30 - 2:39am

I'm always very sorry to read this as an argument in favour of NoSQL:

without doing guesswork or counting on a black box (DB). Yes, it’s slow on the test system, but someone will take care of it later by tuning the DB

An RDBMS is indeed a very sophisticated beast. However, it is one that is well understood not only by DBA, but also by experienced SQL developers. If the query is slow already on the test system, chances are that you didn't get your indexes / constraints right. Or maybe, you're just using MySQL, a second-class RDBMS


Choosing NoSQL for the above reason is like choosing C instead of Java because you don't understand (and don't want to understand) OO .

Uchenna Ani-Okoye replied on Mon, 2014/01/20 - 6:50am

Interesting, I haven't heard much about NoSQL until now, of course SQL is very common, along with it's benefits. It's almost a timeless database system, because despite it being around for so long, there still hasn't been any real replacements for it. Who knows, maybe in the future there will be.

King Tiger replied on Sat, 2014/03/01 - 8:03am

 A lot of companies have chosen to downsize, and maybe that was the right thing for them.

usa binary options

King Tiger replied on Thu, 2014/03/06 - 12:07pm

 Great post! I am actually getting ready to across this information, is very helpful my friend. Also great blog here with all of the valuable information you have. Keep up the good work you are doing here. capture his heart: rebelmouse.com/mikefiorecapturehisheartreview/

King Tiger replied on Sat, 2014/03/08 - 3:39am

 Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. Nordstrom promo code april 2014

King Tiger replied on Sat, 2014/03/08 - 3:40am

 Great job for publishing such a beneficial web site. Your web log isn’t only useful but it is additionally really creative too. promo code 2014 april

King Tiger replied on Sat, 2014/03/08 - 8:29am

 Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.  helpful resources - www.las-vegasseo.com

King Tiger replied on Wed, 2014/03/12 - 9:23am

 I read this article. I think You put a lot of effort to create this article. I appreciate your work. 

binary trading brokers usa

King Tiger replied on Wed, 2014/03/12 - 12:25pm

 Thanks for writing such a good article, I stumbled onto your blog and read a few post. I like your style of writing.  Sears Coupon Code 2014 

Cool Ahmed replied on Thu, 2014/04/24 - 2:00am

  Being the richest man in the cemetery doesn't matter to me. Going to bed at night saying we've done something wonderful, that's what matters to me. www.eyesecretsshop.co.uk 

Cool Ahmed replied on Thu, 2014/04/24 - 2:53am

  Nice information, valuable and excellent design, as share good stuff with good ideas and concepts, lots of great information and inspiration, both of which I need, thanks to offer such a helpful information here. Crazy Mass

Cool Ahmed replied on Thu, 2014/04/24 - 4:45am

 What else may I get that kind of info written in such a perfect approach? I’ve a undertaking that I am simply now operating on, and I have been at the look out for such info. fad504dud  

Cool Ahmed replied on Tue, 2014/05/06 - 11:11am

 Det skal ikke forklares, -det skal ses. Hvilken forandring en gulvafslibning giver i boligen er ikke til at forklare. Men et gammel og trist trægulv der pludselige får det oprindelige og lyse skær tilbage, kan kun give et flot resultat. buy scentsy

Virat Gaywala replied on Wed, 2014/05/07 - 6:22am

Good article. I am also agree that a SQL database built on NoSQL foundations would be the best solution, and sufficient in 80 percent.

But right now as per my knowledge there is no wrapper available that will wrapped together both the system and if we have to choose any one of them we really need to consider some parameter which you already mentioned in your article but for kink of detailed view. Please check this .

Cool Ahmed replied on Mon, 2014/05/12 - 6:33am

  Advantageously, the article is really the best on this notable topic. I harmonize with your conclusions and will thirstily look forward to your approaching updates www.prlog.org

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.