Simon Willison’s Weblog

Subscribe

What are the pros and cons of switching from MySQL to one of the NoSQL databases?

6th January 2011

My answer to What are the pros and cons of switching from MySQL to one of the NoSQL databases? on Quora

Pro: If your own benchmarks tell you you need to switch to a specific NoSQL solution, you’ll know exactly what the pro is.

Pro: If you’re doing something that’s hard to model in a regular schema you might find it easier to use a document database such as CouchDB or MongoDB.

Pro: Depending on how you approach the problem, you may find NoSQL makes schema modifications a LOT less painful than using a relational database.

Con: For many projects, losing out on the relational model is a big disadvantage. Most NoSQL solutions require you to design your data storage with your queries in mind. When you are building a product you often don’t know what kind of queries you are going to run. This has bitten me with AppEngine projects in the past. See also Edmond Lau’s answer to What did Marissa Mayer mean when she said that Orkut failed because of “infrastructure issues”?

For my money, the smart way of taking advantage of NoSQL is in conjunction with a relational engine. Use a regular database for your core data, but take advantage of Redis or MongoDB for things like counters, smart caches, rolling log storage etc. Polyglot persistence is the way to go.

This is What are the pros and cons of switching from MySQL to one of the NoSQL databases? by Simon Willison, posted on 6th January 2011.

Next: What are the JSON security concerns in web development?

Previous: What are the best things to do, see, or eat in Marrakech?