3 ms·
Using Ruby on Rails is an issue, I would think. You do not need a framework for storing and sending out 140 byte messages but if you do use one, its overhead wi
by mtts 18y ago
Using Ruby on Rails is an issue, I would think. You do not need a framework for storing and sending out 140 byte messages but if you do use one, its overhead will actively hurt performance.
The fact that they chose to use RoR anyway hints that they may not be one hundred percent technically competent.
- raganwald 18y agoNot sure I understand how to integrate what you are saying with what I read in the post. If RoR is dog-slow--let's pick 100x slower than something you would code in the weekend--but scales, then what they can serve with 100 servers = what you serve with one server. To double capacity, you add one server and they go from 100 to 200. And so it goes. Scalability is a second-order issue: if you go from 1 server to 2, but they need to go from 100 servers to 400 servers to handle the same load, then not only are they slower than you are, but they can't scale as well as you can. I get why using a framework for the UI and business logic could make them 100x slower than something custom-coded. And from the original post, I get why a conventional database+read cache may not be appropriate for a messaging application. But what I don't get is the connection between RoR and scalability. Unless you are speaking of its default configuration, namely RoR+ActiveRecord+MySQL. Which speaks more to the architecture choice (tables, rows) than to the framework choice (views, models, controllers). or am I missing something?????
- mtts 18y agoThere is no connection. The fact that they're using RoR to build what is really a very, very simple web site suggests their problem is not knowing which tools to use, which is a problem you can not solve by throwing more hardware at it. Talk about scalability is a red herring in this case. The real issues are elsewhere.
- raganwald 18y agoAh, so it's a case of "I believe their choice of Tool A is wrong for solving Problem B, thus although I cannot see what they have done with Architecture C to solve Problem D, I don't have a lot of confidence they made the right decisions." Thanks for explaining your reasoning.
- fendale 18y agoI am pretty certain it was mentioned in a blog post recently (I cannot find it now) that Ruby on Rails is only used for a small part of what Twitter is doing - ie the front end, and there is a lot of non Rails or Ruby code in the background.
- justindz 18y agoCorrect. Blaine Cook blogged (in the post this article riffs from) that they don't use ActiveRecord, for example. I believe someone has made the defensible claim that most of their activity occurs via clients (twhirl, alert thingy) and SMS over the API rather than through the website. Unless they are using ActionController and ActionView to do the rendering and output there, it seems they would be using "traditional RoR" in a very limited capacity. I'm not being an apologist, but I think if people are discussing Twitter and scaling for the purposes of learning something useful and not just framework bashing, language bashing or avoiding doing homework, we should probably avoiding talking as if they use the full stack in a significant way as it's a red herring.
- fendale 18y agoWell said - I remember reading somewhere before that the database was mentioned (as usual) as the problem area. Someone else in the comments mentioned 400K messages a day, plus personal messages, say thats even another 400K. I have zero experience working on a high traffic web application, but I work on a serious database application were we can push somewhere in the region of 1M transactions in a 6-8 hour window. Each of these transactions comes in the form of an XML string and results in as many as 20 plus selects and maybe 10 - 20 inserts. Our application is build on top of Oracle and implemented in PLSQL - not too sexy, but it seems to get the job done. The point I am trying to make is that with a bit of a caching layer it takes some serious throughput to reach the limits of database scalability (certainly with Oracle, where is where my experience lies).