5 Question Interview with Twitter Developer Alex Payne

by Josh Kenzer on March 29th, 2007

Alex Payne - Twitter Developer

I reached out to one of the developers on the Twitter team and asked if he would answer 5 questions. Alex not only answered them but is very honest and up front with his answers. Thanks Alex!

  1. How did you end up on the Twitter team? What is a little of your background?Pretty simple: they posted on their blog that they were looking for
    people in late 2006, and I jumped on it! I think I replied within a
    few hours of the posting. I starting doing contract work on Twitter
    earlier this year, and earlier this month I accepted a full-time job
    after working in the Obvious office for a week. I’m moving out to
    San Francisco in mid-April, and I can’t wait to be out there with the
    rest of the team.I’ve lived most of my life in the Washington, DC area. As one might
    guess, being in the nation’s capital means that everything revolves
    around politics. Most of my early jobs were developing web
    applications for various non-profits, non-governmental organizations,
    and for-profits supporting campaigns and such. I’ve also done some
    information security work (an equally ubiquitous industry around DC).I came to Rails after working in PHP like many developers, but I’ve
    never been a language purist. I was looking at developing some Ruby-
    based blogging software with a friend a couple years before Rails was
    on the scene, but at that time it just wasn’t a friendly language for
    web endeavors. When Rails first crossed my eyes I remember thinking,
    “cool, someone made Ruby work for web apps!” I jumped right in to
    working with the early releases.
  2. How has Ruby on Rails been holding up to the increased load?By various metrics Twitter is the biggest Rails site on the net right
    now. Running on Rails has forced us to deal with scaling issues -
    issues that any growing site eventually contends with – far sooner
    than I think we would on another framework.The common wisdom in the Rails community at this time is that scaling
    Rails is a matter of cost: just throw more CPUs at it. The problem
    is that more instances of Rails (running as part of a Mongrel
    cluster, in our case) means more requests to your database. At this
    point in time there’s no facility in Rails to talk to more than one
    database at a time. The solutions to this are caching the hell out
    of everything and setting up multiple read-only slave databases,
    neither of which are quick fixes to implement. So it’s not just
    cost, it’s time, and time is that much more precious when people can['t]
    reach your site.None of these scaling approaches are as fun and easy as developing
    for Rails. All the convenience methods and syntactical sugar that
    makes Rails such a pleasure for coders ends up being absolutely
    punishing, performance-wise. Once you hit a certain threshold of
    traffic, either you need to strip out all the costly neat stuff that
    Rails does for you (RJS, ActiveRecord, ActiveSupport, etc.) or move
    the slow parts of your application out of Rails, or both.It’s also worth mentioning that there shouldn’t be doubt in anybody’s
    mind at this point that Ruby itself is slow. It’s great that people
    are hard at work on faster implementations of the language, but right
    now, it’s tough. If you’re looking to deploy a big web application
    and you’re language-agnostic, realize that the same operation in Ruby
    will take less time in Python. All of us working on Twitter are big
    Ruby fans, but I think it’s worth being frank that this isn’t one of
    those relativistic language issues. Ruby is slow.
  3. How difficult has it been to add hardware to the environment?We’re hosted at Joyent, and they make the “throw more CPUs at it”
    approach easy. We’ve been able to get new server containers
    provisioned within hours, generally.I’d like to experiment with Amazon EC2 to handle load spikes, but the
    prospective database latency is prohibitive.
  4. How large is the current Twitter road map? How many features are you guys looking to add?Not to be evasive, but it’s hard to say right now. There’s a lot
    that we’d like to do while still maintaining a simple, focused, easy-
    to-use service. Lots of people are interested in a groups feature,
    and that’s definitely on our radar. There’s lots of good stuff coming!
  5. How do you see Twitter affecting the blogosphere, IM, SMS, and Email?I don’t think Twitter is a replacement for blogging, just as I don’t
    think blogging is a replacement for journalism. As far as
    communicating ideas to an audience, one-to-many, Twitter works best
    for those particular ideas that are terse yet expressive, and don’t
    benefit greatly from an in-place thread of replies. For more
    personal (some might say mundane) updates, I think Twitter is a
    better fit than a blog. People are going to talk about their cats,
    inevitably, but do you really want someone talking about their cat in
    more than 140 characters?I think the real power of Twitter is its ability to channel over
    different mediums at the user’s whim. IM, SMS, email, and the web
    are just transports as far as Twitter is concerned. Generally, you
    have to go out and get information via whatever medium that
    information is on. With Twitter, information can come to you via
    whatever medium you prefer. Or, if you want some space, you can
    easily turn off the information tap with a simple “off” command.
    That’s powerful.


  • Alex jumped into the opportunity when he had it and grabbed it totally. Seeing it happened just in 2006, it's hard to imagine how far Twitter had came in just 2 years.
  • I was expecting Alex to be much older for somebody who's so experienced.
  • We tend to think that the owners of grat companies are senior ctizens, but uin the net they are just young like us that had a great idea and implemented it.
  • Alex's really cute looking.
  • I dont think so
  • Young and talented... :)
  • Why does all the cool developers look so sexy?
  • Nicely done interview, Josh! it gave a peek on the "inside" of twitter.
  • I think so
  • Thanks macnatic. By the way, I know you were running late for your photowalk with Scoble and Thomas Hawk. Did you make it?
  • Nice work!
  • Martin, I assume you are complimenting Alex on the nice work of Twitter. I know Alex was deeply involved in the new API released this week including the potential difficulties (and advantages) of using Google Docs.
  • This is a great look behind the scenes of Twitter, especially for all of the Rubyists out there.

    I started using Twitter yesterday and I like it a lot.
  • yes I like it a lot, Twitter is one of the most popular services online
  • Twitter was the best idea since google.
  • That's correct! one of the coolest innovations. Probably now a lot of people are interested in it.
  • This is truly the most informative piece of blogging on Twitter that I've seen to date. I've written some how-to stuff, and some social neato stuff, but wow. This was really interesting. A true peak under the kitty cats. Thanks!
  • Great quote: "I don’t think Twitter is a replacement for blogging, just as I don’t
    think blogging is a replacement for journalism." Kinda sums it all up! Thanks for the interview.
  • If you're looking for all of the dynamic-language, rapid-development pleasure of Rails, plus *much* better performance, give Django a shot: djangoproject.com.
  • I don't think the term "syntactical sugar" is what you wanted to use, since the connotation of "syntactical sugar" typically infers not only that the syntax makes it a little easier to do something, but also that the syntax change doesn't have a performance penalty. Unless you are referring to what others have called "syntactical sugar" and your point is that it isn't really "syntactical sugar".
  • Maybe I can start pointing to this interview to get the Ruby on Rails community to stop trying to force Rails down our throats...

    Great post! ;)
  • I still don't know exactly what "Ruby on Rails" is? Some guy tried to sell me some last night, said it would get me "high as a mother fucker". I'm not wearing pants.
  • Its interesting to hear someone talk about a language that is slow and not talk about how to better do it in a faster language. I am talking about php/python. Would Twitter be better off running on a more "mainstream" system? Just a thought - don't kill me ;)
  • I'm not entirely buying the Ruby speed argument. Sure, we know Ruby is slower than other languages, but when dealing with the Web, databases, etc, it really doesn't matter unless you need to do some serious processing.. which hardly any Web app does.

    Put it this way, I've taken some reasonably well performing Perl daemon code I have that serves hundreds of millons of requests per month, and managed to port it to Ruby and make it even faster.. so I'm just not buying that Ruby's performance is really an issue with Web applications.
  • Peter:
    So what is the argument then for a language? Comfort? Given that the speed of web apps is neg-lable, one should program in any language they choose? I started out in perl and understand that perl can be 100% awesome vs a PHP hack or something. How about the (sorry) fastCGI issue? doesn't that hinder the performance of the web app? I am sorry to just call that out but if it is an issue then I must. This is not a disagreement but a debate, please contribute to it, anyone ;)
  • My personal opinion is that languages can win and lose on factors like the quality of libraries, quality of deployment systems (case in point, mod_php vs everything else), ability of the language to interface with other things, qualit of frameworks, etc. Those things are related to the ecosystem of a language rather than the core performance of the language per-se.
  • I appreciate the honesty in this interview.

    I just soft-launched my rails-based video tracker and I am using the caching all over the place. It is easy to do and every rails developer should put it in before launching.

    The language is amazingly cool to develop in, and rails saves a lot of time even if the data modelling approach is somewhat simplistic. But I can definitely see a performance difference between ruby and languages such as perl, php, and even java.

    As with everything in engineering, you have to deal with difficult trade-offs. With Memecat, I chose to pay for coding happiness with more processor heat and server memory.
  • You really should have limited his responses to 140 characters.

    Great interview.
  • Re: #2 -- Acts As Partitioned http://partitioned.rubyforge.org/
  • I would argue that Revolution Health, http://www.revolutionhealth.com is a larger site that Twitter.
  • JustAnOutsider
    @Adrian Holovaty: Dude, this is so lame. Is this all you guys can do? look for disaffected companies and try to pitch your framework? almost like ambulance chasing..

    @Peter: Dear Pete, Ruby is slow, it eats CPU for breakfast, and please show us your million hits per month code. I'm sure its proprietary and you can't show it to us.

    Rails is braindamaged when it comes to scaling. Reason? It was developed by an MIS/Marketing student with delusions of programming grandeur. DHH doesn't know his RDBMS from his buttocks! And that's the godawful truth.

    And now he's squirming like a little you know who, because the rubber is hitting the road, and the thing doesn't scale on the DB end. Well, this is what you get when you don't understand the issues involved, and bitchslap anyone who brings them up in the initial phases in the name of "opinionation".

    Don't know what will come, maybe it will be an Erlang framework (No Thanks ErlyWeb, you're just as ugly as rails, but we can be hi-bye friends..) or seaside or whatever.. but something is going to really cut rails and all its hype down a few notches (despite all the efforts of the blogocircuit talking heads milking the hell out of php-converts)

    No Wonder PragProg is offering an Erlang book to seed a "new wave" of "pragmatic" cash-cow-milking, but hey, you can never blame an entrepreneur.. especially a pragmatic one.

    Al3x, I hope DHH and 37S don't get you fired from this, because what you're dealing with is a sleazy marketing machine wrapping itself up in the post-rape sheets of opensource. They don't like it when people mess with their revenue streams and their little conference-filling cash cow called "Ruby on Rails"
  • JustAnOutside: It's not all proprietary, but I don't need to show it either. Just rig up a basic script that uses Mongrel (at library level) and returns stuff cached in Memcached, and you'll easily hit 700m~1bn requests per month on a single box. It takes half an hour to run up such a test. Ruby is almost irrelevant in this example as the amount of processing to send stuff to HTTP clients is minimal.

    Then it all comes down to what percentage of requests have to hit a database or do some sort of logic, but as long as it's under a certain percentage, you're good.
  • Note, I'm not talking about Rails.. which is slow. I'm talking about actually developing your own stuff with Ruby. My argument is that Ruby's speed is nearly irrelevant when it comes to fielding data between databases and networks.. since databases and networks are always slower than Ruby! (but not Rails)
  • JustAnOutsider
    @PeterCooper: Agreed. Ruby's speed is almost irrelevant, though it does affect the overall performance of an app especially through a framework which adds layers of abstraction (for developer productivity no doubt but still).

    A general comment:

    My general point is that Rails was not developed with performance in mind, which is very typical of run-of-the-mill developers, DHH being no exception. He created something which made sense to him and his rather superficial understanding of the performance issues and that is just as well. But let us not forget that DHH's major problem while creating BASECAMP was _NOT_ performance and scaling, but Time to Market, and rails did that beautifully _for them_ It doesn't mean DHH or rails community should start pretending it will work in all situations because Rails is beauty this and joy that and it just fits their brains and all that new-agey non-sense that DHH tries to spread all the time.

    My issue is with 37S and gang protecting RoR as a corporate brand without stating it in so many words, and attacking even their most valued customers (RoR users are the other side of the Brand coin) who are in reality helping to test the framework to its limits.

    They are not going to get far with this type of attitude attacking someone and accusing them of being lazy if the users dare to point out some deficiencies in the framework which are well known in the community to begin with.

    DHH hints that multi-database solutions are possible with rails without offering so much as a link. If they are and a team running an 11k hps site doesn't know it, then they should all be summarily fired! but I'm quite sure that is not the case and this is just another technical nit-picking by DHH in a tranparent attempt to save face.

    Ruby is almost equivalent to PHP speedwise (without all the crap) , and if stupid-pet-tricks are kept to a minimum (or at least made optional), there is no reason Ruby based web applications cannot scale to the same size that most PHP/Perl mega-sites do ( WikiPedia, Craigslist come to mind)

    The problem is that Rails makes it very easy to make the commitment on the front-end of the project which is the design and development part, but once you hit the critical size, and have hundreds of thousands of users it just becomes a Monkey on your back!.

    I don't agree with the sentiment that Twitter should be thankful to RoR team for giving them a framework which got them to 11k hps. If you fail primarily and specifically because of your choice of framework not scaling, the failure is just as bad as failing in the beginning. If I hyped up and gave (for free) NASA a rocket with a claim it would take their astronauts to the moon and land them and bring them back, but it only took them to moon orbit where they were stuck, should NASA be thankful to me for FUCKING UP the mission? Should I chide NASA by presenting the fact that the rocket "at least" took them to the moon? whoopty frikking do.

    Given these constraints, it is best to do your initial demos and early version in RoR, but you better have contingency plans for when you hit critical mass because things will become extremely painful even if you DO have the VC cash to throw at the beast.

    I happened to invite quite a few people when twitter was having these performance problems and most of them refused to join or even go back there based on their initial impression of the slowness of the site. How that critical-user-mass loss figures in as total strategic loss for Twitter remains to be seen, but one thing is clear, the choice of RoR would have played a key part in that if we were to quantify the reasons for Twitter's success or failure. Things are still touch and go for them, as they always are for most startups.

    I wouldn't be surprised if Twitter was seriously looking into a rewrite in pure Ruby or perhaps another framework . Django Dev' comments would have very little to do with it, but if I was Twitter, I'd be looking to cut my losses - these are business decisions and once you get to that size, your loyalties change. You may love Ruby, but I bet you'd really love that million dollar check in your pocket if you could pull it off, and if RoR stood in your way, you'd know what to do.

    I doubt they'd go the Python route, because the rework overhead would be just too risky. Unless of course they pull a reddit as it were.

    The only thing that can save Rails is a fork with some people with good grasp of SDLC (including deployment and operations) at the helm.

    Perhaps it should be called Ruby on Brains.
  • I really think you should refrain from bragging about how awesome Rails scales, until you figure out how to make Twitter work reliably over 99 percent of the time. Twitter is as slow as constipation for me.
  • @JustAnOutsider: Jesus, I'm glad somebody finally took the time to type that up.
  • lucas
    Ruby and Rails are very high level languages and as such are slow. Ruby is slow and and Rails to that and it's even slower. Thank you for affirming this!

    What Rails is suitable for is small apps. If you're a web design firm with a small client, use Rails. It'll get you up and running fast, but if you want performance and have a realistic chance at gaining millions of users, you have to use lower level languages.

    The proliferation of frameworks means in general that sites will come out faster but run slower. Great for prototyping but not so good for deploying.

    However, if you believe in agile programming then you do deal with problems when they come up, not before. So until you get to be as big as twitter, you can act like you're designing for, say, a 100,000 users.
  • Ruby is not slower any more. Atually, it is much faster than PHP and faster than Python (I mean JRuby & Ruby 1.9) See: http://www.slideshare.net/mattetti/merb-present... and http://blogs.sun.com/Jacobkessler/entry/it_s_ov...
  • lucas
    everybody stick with PHP we'll all be better off!
  • We have linked you your article. Nice interview.

    The Unofficial Twitter Community and Forums
    http://www.twittown.com
  • Nice to see such a heavy site developed on ruby on rails. Eventhough I am not exactly sure what to do with twitter. :)
  • very interesting "frank" advice about rails. here's hoping one day we'll be there as well.
  • rjordan
    Sounds like ruby/rails was fast enough to expose the un-scaleability of underlying database framework. I would suggest you first determine if your DBA is doing his job, if he is, it shouldn't be that difficult to create an activerecord adapter that uses a connection pool to serve queries. Thus making it possible to use multiple backend databases yet still be transparent or at least mostly transparent to your application.
  • I embedded my employer's blog that I customized from a template, rather than my Vaspers the Grate blog, because my employer is thinking about converting from PHP5 to Ruby on Rails for our small to medium business web design/hosting clients.

    If anyone has such transition experience, from PHP5 to RoR, in a Linux, Agile, MySQL environment, please contact me.

    Thanks.
  • Nice.
  • Agreed, sometimes what seems like the best idea might just come back to bite ys...
  • Interesting interview and nice to get inside insight from a developer on the social networking tool.
  • Hosam Hammady
    Hey Alex, haven't you heard of Neverblock (http://www.espace.com.eg/neverblock)? It will solve your scalability issues!
  • sucks
    This payne sucks. Look at his twitter page, he thinks he is a computer genius
  • David kicked his ass
    "Second, when you work with open source and you discover new requirements not met by the software, it’s your shining opportunity to give something back. Rather than just sit around idle waiting for some vendor to fix your problems, you get the unique chance of being a steward of your own destiny." ~ DHH
  • Good to know the discussion about Ruby. He tells Python is good. Is that really good, as he never developed in Python!
  • When opportunity comes knocking on your door, take it. More often than not, it eventually leads to good stuff.
  • It seems in general twitter has not made as huge inroads in singapore as it could..
  • It's pretty much picking up everywhere now...
  • Twitter's kind of lucky in getting him. Not the other way round.
  • I guess pretty genius being so young and working for such a great company...
  • SEO
    The way Alex answered these five questions, he is looking as very keen, devoted and honest with his work.. It’s looking as he know what he has to do in order to achieve his goal..
  • My personal opinion is that languages can win and lose on factors like the quality of libraries, quality of deployment systems (case in point, mod_php vs everything else), ability of the language to interface with other things, qualit of frameworks, etc. Those things are related to the ecosystem of a language rather than the core performance of the language per-se.
  • Alex is really the brain behind tweeter
  • That guy that inevnted tweeter is a genious. its just so addictivbe
  • Interesting interview and nice to get inside insight from a developer on the social networking tool.
  • One suggestion i have for tweetr is making it possible to use multiple backend databases yet still be transparent or at least mostly transparent to your application.
  • This is truly the most informative piece of blogging on Twitter that I've seen to date. I've written some how-to stuff, and some social neato stuff, but wow. This was really interesting. A true peak under the kitty cats. Thanks!
  • Great interview. Twitter becomes really popular nowadays.
  • Alex is a great guy! Well done
  • What a good interview... he comes across very level headed I thought. Will be interesting to see where they are in a year against facebook and other social network tools that are coming out daily.
  • great post sir..
    thanks for sharing. really helped a lot here.
    --------------------------------------------------
    Ugg Boots | Uggs
  • gogoboot
    well done
  • ugg
    Alex jumped into the opportunity when he had it and grabbed it totally.
  • It's amazing how far Alex has come when he's still so young.
  • We tend to think that the owners of grat companies are senior ctizens, but uin the net they are just young like us that had a great idea and implemented it
  • Thanks for the great widget! Going to add it to my installation next week.
    I've also posted about it on the BlogEngine Forums
  • marque - kindly explain to me how is revolution health bigger than twitter and how the hell does it relate to this.

    Odd and funny comparison my mate..
  • I was expecting Alex to be much older for somebody who's so experienced.
  • I was expecting Alex to be much older for somebody who's so experienced.
  • Rails is braindamaged when it comes to scaling. Reason? It was developed by an MIS/Marketing student with delusions of programming grandeur. DHH doesn't know his RDBMS from his buttocks! And that's the godawful truth.
  • I use social media to create multiple sources of traffic to my website.
  • yes, i agree.We have linked you your article.Going to add it to my installation.thanks for sharing. really helped a lot here.
  • Nice work!
  • hello,your blog is interesting.
    welcome to my page!
  • This is a great look behind the scenes of Twitter, especially for all of the Rubyists out there.
  • Thank s for share this articles
  • Well done..
  • Well done..
blog comments powered by Disqus