Rolling on Rails: Under the Hood at Twitter
There's been a lot of interest in how things run under the hood here at Twitter. If you're one of the curious, join me for a geeky interlude.
Twitter started out on Rails because it's the best framework for a rapidly evolving web application. We've never had more than three engineers working on Twitter since its inception, and with that small team we've managed to accomplish a ton thanks to the elegance of Ruby and the power of Rails. We can happily say that neither Ruby nor Rails will be out of the Twitter picture any time soon. We stand by the superb engineers at Powerset in saying that "Ruby as a whole is ready for the big show."
We hit some scaling stumbling blocks a few months back, but not because Ruby or Rails was working against us. Once Twitter reached a certain amount of traffic we were forced to rethink our architecture; you don't build a messaging system the same way you build a content management system. We set about developing custom solutions both inside and outside our Rails application. We also made good use of web scaling standbys: caching, database optimization, more hardware, and shared experience. Throughout this scramble to scale, Ruby and Rails were assets for their speed of development and creative, helpful communities.
For stressed engineers, it's tempting to think that another solution - anything but what you're using now! - will solve all your problems. Maybe you start dreaming up the perfect framework on a whiteboard, or maybe you start scouring the web for the fastest, newest, most experimental technology. In the long run, picking a foundation you're comfortable with and making sensible iterations towards your performance goals will yield a bigger win. You have to be careful while iterating: watch your database, test thoroughly, and be ready to roll back when things break (and they will).
With great tools, constant learning, and hard work, you can be successful without reinventing the wheel. Rails is our chosen wheel, and we're rolling right along with it. If you'd like to know more about our successes with Ruby and Rails, check out our presentations from the Silicon Valley Ruby Conference 2007 and RailsConf 2007. We hope to have some code to share along with our experience in the near future.
Twitter started out on Rails because it's the best framework for a rapidly evolving web application. We've never had more than three engineers working on Twitter since its inception, and with that small team we've managed to accomplish a ton thanks to the elegance of Ruby and the power of Rails. We can happily say that neither Ruby nor Rails will be out of the Twitter picture any time soon. We stand by the superb engineers at Powerset in saying that "Ruby as a whole is ready for the big show."
We hit some scaling stumbling blocks a few months back, but not because Ruby or Rails was working against us. Once Twitter reached a certain amount of traffic we were forced to rethink our architecture; you don't build a messaging system the same way you build a content management system. We set about developing custom solutions both inside and outside our Rails application. We also made good use of web scaling standbys: caching, database optimization, more hardware, and shared experience. Throughout this scramble to scale, Ruby and Rails were assets for their speed of development and creative, helpful communities.
For stressed engineers, it's tempting to think that another solution - anything but what you're using now! - will solve all your problems. Maybe you start dreaming up the perfect framework on a whiteboard, or maybe you start scouring the web for the fastest, newest, most experimental technology. In the long run, picking a foundation you're comfortable with and making sensible iterations towards your performance goals will yield a bigger win. You have to be careful while iterating: watch your database, test thoroughly, and be ready to roll back when things break (and they will).
With great tools, constant learning, and hard work, you can be successful without reinventing the wheel. Rails is our chosen wheel, and we're rolling right along with it. If you'd like to know more about our successes with Ruby and Rails, check out our presentations from the Silicon Valley Ruby Conference 2007 and RailsConf 2007. We hope to have some code to share along with our experience in the near future.
Labels: engineering

17 Comments:
Will the twitter source code ever be posted for download?
Robbie: No, we're not planning on giving away the source code for the whole site. We hope to share some of the components we've built, though.
thx for posting this article about how twitter is build. I use it daily, so it's nice to now the geeky stuff behind all these.
Can you communicate a bit when you have 6 hours off downtime? Thanx!
Blom: notification of last night's planned downtime was posted on everyone's Twitter homepage in advance. We'll try to allow for more advance notice next time. Thanks!
@al3x how about a twitter id that we can follow for scheduled downtime updates (or a setting to get these updates via our chosen delivery mech).
@jay: You can follow http://twitter.com/twitter_status which we try to keep current. Developers can follow API updates at http://twitter.com/api_updates
Keep up the good the work.
I recently learned about your site here: http://www.nobosh.com/Article/Twitter%3A-Generation-Broadcast-Me/660/
And love what you are doing.
This post has been removed by the author.
Can't login to twitter...site down? 7.21.07 @ 8:30am Central
There was a note at OSCON 2007 on a board about tools talking about cross language, platform message queues. A comment there indicated that Twitter folks had developed a lightweight memcache like queue mechanism. I wondered if you'd consider open sourcing that code?
wow gold
wow power leveling
wow power leveling
wow power leveling
wow powerleveling
wow powerleveling
wow powerleveling
World Of Warcraft power leveling
World Of Warcraft power leveling
World Of Warcraft power leveling
World Of Warcraft powerleveling
World Of Warcraft powerleveling
World Of Warcraft powerleveling
wow power level
wow power level
wow power level
cheap wow power leveling
cheap wow power leveling
cheap wow powerleveling
cheap wow powerleveling
codeheart article
Warcraft Gold
wow gold
wow power leveling
wow power leveling
wow power leveling
wow powerleveling
wow powerleveling
wow powerleveling
World Of Warcraft power leveling
World Of Warcraft power leveling
World Of Warcraft power leveling
World Of Warcraft powerleveling
World Of Warcraft powerleveling
World Of Warcraft powerleveling
wow power level
wow power level
wow power level
cheap wow power leveling
cheap wow power leveling
cheap wow powerleveling
cheap wow powerleveling
codeheart article
Warcraft Gold
runescape money runescape gold runescape money runescape gold wow power leveling wow powerleveling Warcraft Power Leveling Warcraft PowerLeveling buy runescape gold buy runescape money runescape items runescape gold runescape money runescape accounts runescape gp dofus kamas buy dofus kamas Guild Wars Gold buy Guild Wars Gold runescape accounts buy runescape accounts runescape lotro gold buy lotro gold lotro gold buy lotro gold lotro gold buy lotro gold lotro gold buy lotro gold runescape money runescape power leveling runescape money runescape gold dofus kamas cheap runescape money cheap runescape gold Hellgate Palladium Hellgate London Palladium Hellgate money
runescape money runescape gold runescape money runescape gold wow power leveling wow powerleveling Warcraft Power Leveling Warcraft PowerLeveling buy runescape gold buy runescape money runescape items runescape gold runescape accounts runescape gp dofus kamas buy dofus kamas Guild Wars Gold buy Guild Wars Gold runescape accounts buy runescape accounts runescape lotro gold buy lotro gold lotro gold buy lotro gold lotro gold buy lotro gold lotro gold buy lotro gold runescape money runescape power leveling runescape money runescape gold dofus kamas cheap runescape money cheap runescape gold Hellgate Palladium Hellgate London Palladium Hellgate money Tabula Rasa gold tabula rasa money 陈楚生 压力开关 压力传感器 流量开关 流量计 液位计 液位开关 温湿度记录仪 风速仪 差压开关 可燃气体检测仪 过滤器 强磁水处理器 自清洗过滤器 自动反冲洗过滤器 保鲜棕榈树 棕榈树
wow power leveling
wow powerleveling
wow power leveling
wow gold
wow items
feelingame.com
wow tips
Most Valuable WOW Power Leveling Service
wow power leveling faq
cheap wow power leveling
wow power leveling
wow powerleveling
wow power lvl
wow power leveling
wow powerleveling
world of warcraft power leveling
ffxi power leveling
ffxi powerleveling
lotro powerleveling
lotro power leveling
wow power leveling
wow powerleveling
world of warcraft power leveling
ffxi power leveling
ffxi powerleveling
ffxi
ffxi gil
lotro powerleveling
lotro power leveling
lotro gold
wow power leveling
wow powerleveling
world of warcraft power leveling
wow powerleveln
wow power leveln
world of warcraft power leveln
world of warcraft powerleveln
ffxi powerleveling
coh powerleveling
cov power leveling
Post a Comment
Links to this post:
Create a Link
<< Home