Aug 28 2010

Moving from SQL to NoSQL

Are you thinking on moving your database from a SQL implementation to a NoSQL one ?

Sometimes when you decide to move to a different approach lots of doubts pop out of your mind, there are a couple of actions that can make your decision more solid and secure. I’ll try to provide some tips that would help you to choose the right NoSQL implementation.

When do you need to think about NoSQL ?

Often web application start by being implemented on top of MySQL, the one day your application got traction and performance issues start to be a real pain due to high load of read/write queries on your system.

At this point you have 2 choices:

  1. “Shard” your data to partition it across several sites
  2. Go for a licensed SQL DBMS or move to  a NoSQL DBMS

Basically, you need to scale with less amount of money spent possible. Michael Stonebraker written a good article on this.

NoSQL use cases

  1. Massive data volumes
  2. Extreme query load
  3. Schema mutation (often called as evolution)

NoSQL most popular pro’s

  • Scalability and Elasticity (at low cost)
  • High Availability
  • Flexible schemas (semi-structured data)
  • Distributed (easily)
  • Low Cost

NOSQL most popular con’s

  • Weak integrity models
  • Consistency (called eventual consistency)
  • Transactions (You can do it by code)
  • Complex queries
  • No standardization
  • Messy access control (Some popular implementations already doing this)

Basically, NoSQL runs away from the ACID (atomicity, consistency, isolation, durability) terminology.

NoSQL most popular implementations

As every topic, there are come popular and trendy implementations of NoSQL: CouchDb, MongoDB , Cassandra, Memcache.

For a complete list, please refer to wikipedia.

Interesting to read articles/presentations on NoSQL.

  1. NoSQL Databases – Part 1 – Landscape” at VineetGupta.com
  2. “Why Digg Digs Cassandra” by Om Malik at Gigaom
  3. “NoSQL at Twitter (NoSQL EU 2010)” by Kwvin Weil at Slideshare
  4. “NoSQL databases” by Marin Dimitrov at Slideshare

But the sky isn’t always blue, you should read the voices that are against NoSQL also:

  1. I Can’t Wait for NoSQL to Die by Ted Dziupa
  2. NoSQL is Software Darwinism by Jeremy Zawodny

So how do you choose the right NoSQL implementation ?

I must answer with the magic sentence: It depends!

You must choose you database storage system based on the problem you are trying to solve, but there is one thing that is universal to all of them, you have to make tests with more than one and only by making results analysis you will be able to take decisions, unless you are a guesser, i am not.

My advice is, choose your most common use cases and perform small proof of concepts, and only after having the numbers you should choose.

What use cases do you have with NoSQL ?

3 comments on “Moving from SQL to NoSQL

  1. Pingback: Next Gen Enterprise: Enterprise headlines and excerpts, 2010-08-31, Software help online

  2. Pingback: NoSQL Daily – Thu Nov 4 › PHP App Engine

  3. Pingback: ehcache.net

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>