[[post-media:eyFEwfFmygnzDuGoltEj]]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.