views:

123

answers:

2

What are the advantages of using NoSQL databases? I've read a lot about them lately, but I'm still unsure why I would want to implement one, and under what circumstances I would want to use one.

+2  A: 

NoSQL solutions are usually meant to solve a problem that relational databases are either not well suited for, too expansive to use (Oracle) or require you to implement something that breaks the relational nature of your db anyway.

Advantages are usually specific to your usage, but unless you have some sort of problem modeling your data in a RDBMS I see no reason why you would choose NoSQL.

I myself use MongoDB and Riak for specific problems where a RDBMS is not a viable solution, for all other things I use MySQL (or SQLite for testing).

If you need a NoSQL db you usually know about it, possible reasons are:

  • client wants 99.999% availability on a high traffic site.
  • your data makes no sense in SQL, you find yourself doing multiple JOIN queries for accessing some piece of information.
  • you are breaking the relational model, you have CLOBs that store denormalized data and you generate external indexes to search that data.

If you don't need a NoSQL solution keep in mind that these solutions weren't meant as replacements for an RDBMS but rather as alternatives where the former fails and more importantly that they are relatively new as such they still have a lot of bugs and missing features.

Oh, and regarding the second question it is perfectly fine to use any technology in conjunction with another, so just to be complete from my experience MongoDB and MySQL work fine together as long as they aren't on the same machine

Asaf
Thanks for the answer. Your examples of when to use NoSQL are vague at best. I was hoping for a more specific use case so I can decide if any of my data would be better stored in a NoSQL database.
smfoote
I try not to answer the same question twice, look at my previous answer to a very similar questionhttp://stackoverflow.com/questions/3621415/what-are-some-real-use-cases-for-going-with-a-nosql-document-store-db/3621568#3621568
Asaf
+1  A: 

Relational databases enforces ACID. So you will have schema based , transaction oriented data stores. Its proven and suitable for 99% of the real world applications. You can do anything with that.

But there are limitations on speed & scaling when it comes to massive high availability data stores. For example Google search or amazon, have terabytes of data stored in big data centers.Querying & inserting is not performant in these scenarios because of blocking/Schema/Transaction nature of the RDBMs. That's the reason they have implemented their own dbs(actually key value stores) for massive performance gain & scalability.

NoSQL(just the term is new) is not a new one, its been around for long time. Graph/Object/Column/XML/Docuement are some examples.

For your 2nd question: Is it okay to use both on the same site?

Why not. Both serves different purposes right.

Cheers

Ramesh Vel
I don't think ACID is exclusive to relational databases. You can have durability guarantees, transactions, view consistency in non-relational databases.
Thilo