I’m currently developing a “microblog” type application. I’m using Rails3 and MySQL. I’m starting to wonder if this really is a good idea. The status table after 2-3 years might contain many millions of rows.
Can MySQL handle this amount or should I convert to a NoSQL solution like Mongo? I’m early in development so it would not be a problem to convert the app in this state.
What do you think? This is not a question about SQL vs. NoSQL. It’s about what’s best suited for this kind of app?
/ Tobias
This is a hard question to answer without more information about the aspirations of your microblog app. It depends on how you design it and how people will use it.
However, generally (waving hands here), this type of application can be best modeled by a NoSQL solution.
You’ll have a couple of basic models: Users, Blogs, Posts, Comments, Attachments
With a solution like MongoDB you can model the Posts as objects that contain some (or all) of the information related to comments, and attachments, likes, saves (doing a little denormalization) as embedded objects instead of separate collections/tables that would otherwise have to be joined together to get that same information.
This is cool because when you retrieve a post object from the datastore, you have all this rich metadata along with it (without incurring the extra cost of joining that data in)
However if your blog is of the type where this information is rarely used or displayed this type of design will not get you much in terms of performance.
That being said, you could obviously denormalize using a traditional database as well but the NoSQL approach fits the data model better.