This is not that Rails does not scale, but rather requests for live data in Ruby (or any interpreted language) do not scale, since they are comparatively much more expensive in terms of processor and memory usage than their compiled languages.
Now, if Twitter was another type of service that had the same huge user base but served data that changed less frequently, Rails could be a viable option through caching; that is, completely eliminate direct requests to the Rails stack and unload them on an external server and / or in-memory cache. Great article on this topic:
How Basecamp Next got so damn fast
However, Twitter did not remove Rails to scale problems alone, they made a switch because Scala, as a language, provides certain built-in guarantees about the state of your application, which interpreted languages โโcannot provide: if it compiles, time wasted such as typos with fat fingers, incorrect method calls, incorrect type declarations, etc. simply cannot exist.
For Twitter, TDD was not enough. A quote from Dijkstra in Programming in Scala illustrates this point: "testing can only prove the existence of errors, not their absence." As their application grew, they found it increasingly difficult to track bugs. The mysterious magical tour was an obstacle that went beyond performance, so they made a switch. By all accounts, a successful success, Twitter is Scala, which is Facebook for PHP (although Facebook uses its own ultra-fast C ++ preprocessor, so little cheating ;-))
To summarize, Twitter has made a switch for both performance and reliability. Of course, Rails is generally at an innovative level, so 99% of non-Twitter apps around the world can handle the interpreted language perfectly (although, now I'm firmly on the compiled language side of the fence, Scala is too good!)
virtualeyes Mar 17 '12 at 10:40 2012-03-17 10:40
source share