Wednesday, December 18, 2013

CAP theorem and NoSQL databases

I was talking to a friend yesterday who said "RDBMS is going to go away, everyone uses NoSQL these days". This served as the motivation behind writing this post. No, I dont think that is the case by any stretch of imagination. This got me into reading more about NoSQL databases. Lets travel down this path to understand why the NoSQL databases are so popular today and how they started.

To get started on this, lets first try to understand the CAP theorem. There are three ingredients in the CAP theorem namely:

  1. Consistency- Having the same data across all the nodes in the cluster at any given instant of time.

  2. Availability- Being able to serve always. No downtime and least possible response time.

  3. Partition Tolerance- The system continues to serve even if some link is  broken and your cluster is broken into two or more parts. There could be a loss of a message, some node may crash, but you still want to be able to serve. 


Now the CAP theorem states that you can carry home only two out of these three. This is where the difference in RDBMS and NoSQL lies! Lets look at the three combinations we can form here[2]:

  1. CA - data is consistent between all nodes - as long as all nodes are online - and you can read/write from any node and be sure that the data is the sam.

  2. CP - data is consistent between all nodes, and maintains partition tolerance by becoming unavailable when a node goes down.

  3. AP - nodes remain online even if they can't communicate with each other and will resync data once the partition is resolved, but you aren't guaranteed that all nodes will have the same data (either during or after the partition)


Now look at the case of some popular NoSQL customers and then return back to see why NoSQL is good and applicable to them but RDBMS in my opinion will co-exist.
Lets talk of amazon.com first. Their business model is such that they want to be available all the time. They wouldn't want their site to be down or have a higher response time at any moment. So it is very essential for them to have the 'A' and 'P' attributes of the CAP theorem. They would rather give away the 'C' for it to an extent. Getting a regret from amazon.com saying we don't have this item although we showed you it was available earlier is not as bad as the site itself going down. So if there was one item and two people simultaneously put it into their carts, that could happen but given their business model they can have alternatives to save their customers of this situation. For instance they could have some extra items in the stock always.

Similarly when you think of facebook.com, suppose you post a picture on your wall. Its not a great deal if one of your friends can see that picture and the other will be able to see the picture a few moments later. Again, it doesn't care as much about consistency as it does to the availability.

Lets now think why was the cluster or a farm of servers needed after all. Its because everything you do on internet is being stored in a database. Google, facebook, amazon etc are examples who keep all this data for providing personalized search or recommendations etc. This huge amount of data in the order of petabytes or zetabytes can not be stored on one disk. To try to store all of them on one disk and replicate it to more such disks is a pain and that is why google chose to use a farm of of several servers with smaller disks. Traditional RDBMS was built to best serve on a single disk and that is why people with this huge data came up with BigTable, DynamoDB etc.

And as we near the end of this article, its importnat to have a look at some NoSQL databases. There are many out there which can be broadly divided into 4 categories:

  1. ColumnHBaseAccumulo

  2. DocumentMarkLogicMongoDBCouchbase

  3. Key-value : DynamoRiakRedisCacheProject Voldemort

  4. GraphNeo4JAllegroVirtuoso


Note that there isnt a concrete line between the 4 types. As an example, the document oriented databases and the key-value databases could resemble the other type to seom extent at times. So the boundaries are a little fuzzy. To conclude with, I would say NoSQL databases are popular and are good in certain circumstances, but when you come to something like say banking you really need ACID compliance and therefore the RDBMS. So in my opinion they will co-exist as they today.

References:

  1. http://en.wikipedia.org/wiki/CAP_theorem

  2. http://stackoverflow.com/questions/12346326/nosql-cap-theorem-availability-and-partition-tolerance

  3. http://stackoverflow.com/questions/16779348/does-the-cap-theorem-imply-that-acid-is-not-possible-for-distributed-databases

  4. http://en.wikipedia.org/wiki/NoSQL

  5. https://www.youtube.com/watch?v=qI_g07C_Q5I

81 comments:

  1. There are lots of information about latest technology and how to get trained in them, like Big Data Training in Chennai have spread around the web, but this is a unique one according to me. The strategy you have updated here will make me to get trained in future technologies(Big Data Training). By the way you are running a great blog. Thanks for sharing this.

    Hadoop Training in Chennai | Big Data Training in Chennai

    ReplyDelete
  2. To have spread around the web, however this is an one of a kind one as per me. The method you have redesigned here will make me to get prepared in future advancements.Thanks a lot.

    Manpower Consultancy in Chennai | Hadoop Training in Chennai

    ReplyDelete
  3. Nice information gathering your post about "CAP theorem". i know new one , keep on update Selenium Training in chennai || software Testing Training in chennai

    ReplyDelete
  4. Thank you for the useful article. It has helped a lot in training my students. Keep writing more.
    hadoop course in Chennai

    ReplyDelete
  5. I read your article and it’s totally awesome. You can consider including RSS feed in your site, so that we can follow your blog and get latest update direct on my inbox.
    Java Training in Chennai
    .Net Training in Chennai
    PHP Training in Chennai

    ReplyDelete
  6. The expansion of internet and intelligence in business process lead the way to huge volume of data. It is important to maintain and process these data to be efficient in data handling. Hadoop Training in Chennai | Big Data Training in Chennai

    ReplyDelete
  7. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
    Regards,
    SAP training in chennai|Best SAP training in chennai|SAP Course in Chennai|SAP Institutes in Chennai

    ReplyDelete
  8. Java is awesome. I believe I will still be able to use it even when I am 60 years of age. Java is a beautiful language. I also used it to develop my Msc research project. J2EE Training in Chennai | JAVA Training in Chennai

    ReplyDelete
  9. You have furnished a worthable content in here. I find this article useful to read and share. I have already bookmarked your content for future updates. Thanks for sharing.


    Android training institute in chennai | Best selenium training in chennai | software testing training in chennai

    ReplyDelete
  10. Thanks for your informative article on software testing. Your post helped me to understand the future and career prospects in software testing. Keep on updating your blog with such awesome article. Best software testing training institute in Chennai | Software Testing Training in Chennai | Software testing training institute Chennai

    ReplyDelete
  11. Excellent post!!! Training on android technology helps professionals to establish a career in android mobile application development. Android Training in Chennai Android Training

    ReplyDelete
  12. For management and troubleshooting of enormous databases, corporations square measure searching for qualified and licensed dispersions Hadoop experts for the duty. Hadoop Training in Chennai | Hadoop Training Chennai

    ReplyDelete
  13. Excellent post!!! The future of .net application development is on positive note. It offers huge career prospects for talented professionals all over the world. Training on .net technology will ensure good salary package. DOT NET Training in Chennai

    ReplyDelete
  14. Thanks for your informative article. Android SDK allows you to create stunning mobile application loaded with more features and enhanced priority. With basis on Java coding language, you can create stunning mobile application with ease. Android Training Institutes in Chennai | Android Training in Chennai

    ReplyDelete
  15. Very informative post, your article on IOS mobile application development training helped me to understand the future of mobile application development. It is recommended to enroll in ios developer training in chennai at reputed IT training and placement institute for better career prospects.

    ReplyDelete
  16. I prefer salesforce tool for CRM. It is a cloud based crm tool preferred by many professionals.
    Salesforce training in Chennai|Salesforce training institute in Chennai

    ReplyDelete
  17. I agree with your post, the Introduction of automation testing product shortens the development life cycle. It helps the software developers and programmers to validate software application performance and behavior before deployment. You can choose testing product based on your testing requirements and functionality. QTP Training in Chennai | QTP training

    ReplyDelete
  18. Dear admin, The way you have explained the concept is mezmerizing. Thank you so much for sharing tis worth able content with us. The concept taken here will be useful for my future programs and i will surely implement them in my study. Keep blogging article like this.


    Best JAVA Training institute in Chennai | Best JAVA Training in Chennai | Android training in chennai

    ReplyDelete
  19. very informative blog. Helps to gain knowledge about new concepts and techniques. Thanks for posting information in this blog
    Hadoop Training in Chennai

    ReplyDelete
  20. Great blog..You have clearly explained about the concept..Step by step explanation is too good to understand..Its very useful for me to understand..Keep on sharing..
    Android training in chennai

    ReplyDelete
  21. nice and informative , the cap topic is really awesome keep on update this kind of blog it is useful for mnay people thanks for sharing.


    software testing training in chennai

    ReplyDelete
  22. I agree with your post. Selenium is most used automation tool to test web application and browser. This automation tool offers precise and complete information about a software application or environment. Selenium Training in Chennai

    ReplyDelete
  23. nice blog..
    SEO training in hyderabad by experts in digital markeing And by prosessional experts in seo.All the training by placement and also guide by the professionals.SEO training in hyderabad

    ReplyDelete
  24. Nice article, I read your post form the beginning. It’s sound interesting to read. Thanks for sharing the useful blog.
    Regards,
    Selenium Training in Chennai

    ReplyDelete
  25. nice posts..
    SAS Institute introduced the SAS Certified Professional Program,training proper understanding of how the SAS software works. Among the five certification programs that SAS Institute has come up with, SAS training can be considered as the entry point into the big data and the data analytics industry.
    SAS online training in hyderabad

    ReplyDelete
  26. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Web designing Course in Chennai | Hadoop Training in Chennai

    ReplyDelete
  27. cap therorem and nossql nice posts..

    Hadoop online training .All the basic and get the full knowledge of hadoop.
    hadoop online training

    ReplyDelete
  28. Struts2 Training Institutes in Chennai Struts2 Training Institutes in Chennai Spring Training Institutes in Chennai Spring Training Institutes in Chennai Java MicroServices Training Institutes In Chennai Java MicroServices Training Institutes In Chennai

    ReplyDelete
  29. Thanks for sharing your ideas.It is really helpful and informative.Keep sharing more with efficient new like this.
    Regards,
    Software Testing courses in Chennai | Testing Training in Chennai | Software Testing institutes in Chennai

    ReplyDelete
  30. Thanks for sharing this amazing post keep doing more

    Best Spring Training in Chennai

    ReplyDelete
  31. Wonderful Post. With one of a kind substance, I truly motivate enthusiasm to peruse this post. I trust this article help huge numbers of them who looking this pretty data.
    Regards,
    SAS Training in Chennai | SAS Courses in Chennai

    ReplyDelete
  32. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Android training in Chennai | Android course in Chennai

    ReplyDelete
  33. Thanks for posting this useful content, Good to know about new things here, Let me share this,
    AngularJS Training in Chennai | AngularJS Training | Best AngularJS Training Institute in Chennai

    ReplyDelete
  34. Good info! Thanks for the great share sounds great to hear about the techs, newbie though, this article helps in Mobile application development in chennai


    ReplyDelete
  35. Excellent sharing. Testing is a wonderful field for IT peoples. Want to learn Selenium Online Training reach GangBoard. Hadoop Online Training

    ReplyDelete
  36. Nice sharing. R is a language and environment for statistical computing and graphics. Want to make a career in R Programming. Learn R Programming Online Training course @ GangBoard. We are the best provider of online training on evergreen technologies.

    ReplyDelete
  37. You have done really great job. Your blog is very unique and informative. Thanks. Devops Online Training | Data Science Online Training

    ReplyDelete
  38. Great post! I am actually getting ready to across this information, It's very helpful for this blog.Also great with all of the valuable information you have to Keep up the good work you are doing well.
    Selenium Training in Chennai | Selenium Training Center in Chennai

    ReplyDelete
  39. Thanks for your informative article. As the demand quality apps and games increases in the mobile market, there is huge demand for the android developers in the job market
    Hi we at Colan Infotech Private Limited , a company which is Situated in US and India, will provide you best java web service and our talented java application development team will assure you best result and we are familiar with international markets, We work with customers in a wide variety of sectors. Our talented team can handle all the aspects of Java web application development, we are the best among the
    Java development company
    .

    We have quite an extensive experience working with java development services. we are the only Java application development company which offer custom services to a wide range of industries by exceeding our client’s expectations. You can even interact directly with the team regarding your project, just as you would with your in-house team.Our pro team will provide you the best java appliaction development services. We are best among the java development companies in Chennai, please review our customer feedbacks so that you may find a clue about us. If you want one stop solution for java development outsourcing, Colan infotech is the only stop you need to step in. Colan Infotech is the unique java web development company were our team of unique java application developer were ranked top in java enterprise application development.

    ReplyDelete
  40. Thank you for this valuable information. I have got some important suggestions from it. Web Designing Training Institute in Chennai | Web Designing Training Institute in Velachery.

    ReplyDelete
  41. Excellent post. Keep updating.I have got some useful information form this article.
    erp solution providers in chennai

    ReplyDelete
  42. Thanks for the awesome share

    Hi we at Colan Infotech Private Limited , a company which is Situated in US and India,
    will provide you best java web service and our talented java application development team will assure you best result
    and we are familiar with international markets,
    We work with customers in a wide variety of sectors. Our talented team can handle all the aspects of Java web application development,
    we are the best among the
    Java development company
    .

    We have quite an extensive experience working with java development services .
    we are the only Java application development company which offer custom services to a wide range of industries by
    exceeding our client’s expectations.
    You can even interact directly with the team regarding your project, just as you would with your in-house team.
    Our pro team will provide you the best java appliaction development services .
    We are best among the java development companies in Chennai ,
    please review our customer feedbacks so that you may find a clue about us. If you want one stop solution for java development outsourcing,
    Colan infotech is the only stop you need to step in.
    Colan Infotech is the unique java web development company were our team of unique
    java application developer were ranked top in java enterprise application development

    ReplyDelete
  43. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharng this information,this is useful to me...
    Android training in chennai
    Ios training in chennai

    ReplyDelete
  44. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    Selenium Training in Chennai

    ReplyDelete
  45. this blog post is really helpful especially with me that is just starting learning about devops Jobs in Hyderabad follow in 2017.It is very informative and you explain it well

    ReplyDelete
  46. Very nice post here and thanks for it .I always like and such a super contents of these post.Excellent and very cool idea and great content of different kinds of the valuable information's.
    PEGA Training in Chennai

    ReplyDelete
  47. Nice and good article.. it is very useful for me to learn and understand easily.. thanks for sharing your valuable information and time.. please keep updating.

    Dot Net Training in chennai | Oracle Training in chennai

    ReplyDelete
  48. Good and nice blog post, thanks for sharing your information.. it is very useful to me.. keep rocks and updating


    Software Testing Training in chennai | Android Training in chennai

    ReplyDelete
  49. Thanks for sharing informative article… Know about How to Change BSNL WiFi Password from techfizy.

    ReplyDelete

  50. Testing an application is become essential for any product to get an effective result. Your post help you to gain more info on Selenium Testing

    Selenium Course in Chennai |
    selenium training in anna nagar 

    ReplyDelete
  51. Guys, please do include java development company in the list of java companies.

    ReplyDelete
  52. Also if you are looking to hire offshore SEO company? Please do tell

    ReplyDelete
  53. Thanks a lot for sharing this with all of us, I like it and we can communicate. Do you need buy app ratings and reviews. To boost app ranking and double app downloads now.

    ReplyDelete
  54. your explanation is too good, Thanks for sharing this information about MSBI Online Training

    ReplyDelete
  55. I like the post format as you create user engagement in the complete article. It seems round up of all published posts. Thanks for gauging the informative posts.
    cara menggugurkan kandungan

    ReplyDelete
  56. Great Information you are shared with us. check it once through MSBI Online Training Bangalore

    ReplyDelete