Should anyone ask, Twitter can't blame Ruby on Rails

Twitter has been having scalability problems. No surprise. Their architecture is based around pumping all data into a DB and then polling the DB. This is nuts. They are asking a DB to act like a router, something that it is pretty bad at doing. Putting a DB into the flow IS THE PROBLEM. It’s not the language, it’s not politics, it’s not even about friendships or past contributions to a community.

Remove the DB and rewrite, using a messaging protocol like XMPP. Send the messages directly to the correct nodes or clients and *only* if the nodes are off-line, store in a DB.

There is an O(n^n) problem here when users send messages to every other user through a database. If you replace that with the idea of subscriptions and use a decent messaging protocol, the problem goes away.

Relational databases are not the solution to all problems. And if necessary stick with Ruby for the presentation layer.

Related Articles


Powered by Blogger.

Follow by Email

Should anyone ask, on building strong teams

My thinking about building strong teams My work goal is: work with smart people, on interesting problems, that improve our lives. So I start...