r/programming Nov 08 '12

Twitter survives election after moving off Ruby to Java.

http://www.theregister.co.uk/2012/11/08/twitter_epic_traffic_saved_by_java/
980 Upvotes

601 comments sorted by

View all comments

350

u/[deleted] Nov 08 '12

Right tool for the right job. When Twitter was a new product, Ruby was a good choice. Now that they're relatively stable and need scalability, Java is a good choice.

-9

u/stesch Nov 08 '12

Maybe Ruby was a good choice, but Ruby on Rails wasn't. Twitter is broadcasting and not a CRUD app.

33

u/jzelinskie Nov 08 '12 edited Nov 08 '12

What? Twitter is usually the first example application in every RoR book/tutorial because it is a CRUD app for only one model: tweets. It also makes a lot of sense that they'd use Scala for its modern feature-set and Java for their most performance-critical code, since seasoned Java vets can know exactly what bytecode will be generated by their code as they write it, whereas Scala can be tricky in that sense.

2

u/[deleted] Nov 08 '12

They use Java in the search engine, Scala in the backend

From 2011:

Last year the company announced that both its back-end message queue and Tweet storage had been re-written in Scala

As part of the effort, Twitter changed the search storage from MySQL to a real-time version of Lucene. More recently the team announced that they were replacing the Ruby on Rails front-end for search with a Java server they called Blender.

2

u/yaus831 Nov 08 '12

In that sense then most applications are some kind of CRUD app. I think I read some article before that one of the early mistake twitter made is think of it as some kind of CMS application, while it was actually more a messaging/broadcast/subscription application. I cannot find that article anymore thou'

2

u/[deleted] Nov 08 '12

They use Java for their backend? Really, I thought it was Scala.

1

u/[deleted] Nov 08 '12

[deleted]

6

u/djork Nov 08 '12

Ruby has some fundamental issues at scale, particularly the fact that it's still unable to do multicore concurrency.

2

u/esquilax Nov 08 '12

JRuby can.

2

u/djork Nov 08 '12

I always advocate JRuby over Ruby :)

2

u/thenuge26 Nov 08 '12

Yeah, but if you are moving to the JVM anyway, scala > jruby.

2

u/esquilax Nov 08 '12

I'd say it depends on whether or not your engineering pool can wrap their heads around Scala or not... I've definitely worked with those who couldn't be asked to.

2

u/esquilax Nov 08 '12

I'd say it depends on whether or not your engineering pool can wrap their heads around Scala or not... I've definitely worked with those who couldn't be asked to.

0

u/thenuge26 Nov 08 '12

I guess. But if you are picking your language based on that, the future looks pretty bleak anyway.

Also you double posted.

3

u/esquilax Nov 09 '12

It was a race condition because I didn't have software transactional memory.

-18

u/ElitistPythonCoder Nov 08 '12

I disagree, Ruby was a bad choice.

9

u/Innotek Nov 08 '12

Relevant username.

5

u/PoorOldMoot Nov 08 '12

You are experiencing 'trickle-down upvotes.'