Monday, November 01, 2010

MySQL as the first NoSQL database

I was watching yesterday a presentation at GeekMeet Timisoara about how to scale your websites and all the MySQL-related advices were as expected, but upon thinking about it, entirely agains normal database mantras:

  • You should de-normalize the database (copies are easier to access and cheap)
  • You should disable transactions (ie. use a MySQL storage engine that isn't transactional).
  • MySQL Master-Slave replication (which is asynchronous!)

This made me realize that MySQL is successful precisely because of all the things I discredited it for.

You see, in my book MySQL was never a real database because, initially, it wasn't transactional. For the project where I could choose the database, I picked PostgreSQL and I always used MySQL knowing in the back of my head that, in fact, it was a bit of a sham.

But this might just be MySQL's good fortune: by providing a simple storage engine with some SQL front-end, they proved that most people don't need ACID compliance.

Furthermore, as more and more people need to scale their applications horizontally (since it's cheaper and because... Google does it), they need even less of an actual database.

NoSQL was a movement that started after people got tired of the constraints of SQL databases and started thinking about what do they really need when storing data. It was liberating to see that one must not assume from the start that "external data==database" and actually put some though into the specific needs of their application.

And by being such a lightweight and unconstrained implementation, MySQL is right here, still serving the needs of people that want to scale out.

MySQL was basically the first NoSQL database. By relaxing what a database must provide, they proved in the long run that this is what people actually need. So besides the pure NoSQL tools like the various key-value stores they are building nowadays, MySQL could very well remain the most used place to store your data precisely because it allows you to pick which of the database-specific features you actually need.

1 comment:

dwight said...

Very interesting observation.

dwight/mongodb

The Trouble with Harry time loop

I saw The Trouble with Harry (1955) a while back and it didn't have a big impression on me. But recently I rewatched it and was amazed a...