By mid-2008, one of these Ruby message queues completely crashed and
developers needed two and a half hours to shove the dropped Tweets back
through the system. When your game is micro-blogging, that's a
lifetime. Then, in his spare time, one developer ported the code to
Scala. According to Payne, the Scala queue could process the same
message backlog in 20 seconds.
By the end of this year, Payne said, Twitter hopes to have its entire
middleware infrastructure and its APIs ported to the new language. Ruby
will remain, but only on the front end. "We're still happy with Rails
for building user facing features... performance-wise, it's fine for
people clicking around web pages. It's the heavy lifting, asynchronous
processing type of stuff that we've moved away from."
For this sort of heavy lifting, languages like Java and C++ may be as
fast as Scala. But Payne wants more than speed. He prefers Scala
because it combines functional and object-oriented techniques.
"Functions are objects, and objects are functions," he said. "Scala
asks can you have the best of these two worlds together? And you can."
"The biggest selling point for certain organizations is that Scala is
100 per cent compatible with your existing JVM code. There's no
wrappers. There's no bullshit. You just load up your JVM code and call
in to it, and there's no performance penalty. If you have a big
investment in Java infrastructure, Scala is the ideal language."
Excerpt taken from:
http://www.theregister.co.uk/2009/04/01/twitter_on_scala/
More on Scala:
http://www.scala-lang.org/
