What do you think about building a scalable Twitter today, but on Rails 7?

Recently had a chat with a friend. I was pretty excited about Rails 7 and made the mistake of sharing it with a Java developer. The entire chat devolved into a brief argument on "scalability" and I didn't have the time or patience to pursue it.

This got me wondering: how scalable *IS* Rails today compared to back when everyone attacked it due to the Twitter fiasco?

How does Rails scale now? What does Rails 7 bring to the table that improves this?

Please note, I'm not actually asking if it makes sense in comparison with other languages and frameworks - I'm really wanting to know if it's possible and, if so, how could it be done?

Any thoughts and details about what has changed over the last several years and now especially recently?

11 thoughts on “What do you think about building a scalable Twitter today, but on Rails 7?”

  1. It simply isn’t. Ruby at scale doesn’t hold up to Golang for the same dev cost or Node with cheaper devs. For speed, it doesn’t hold up to either with CPU intensive tasks and has always been bad with asynchronous, non-blocking I/O even with Falcon etc.

    Rails is great for a starter monolith that becomes a moderate monolith.

    For Anything close to webscale, Ruby and Rails just don’t make sense anymore. Not with performance or with develoment costs.

    But that’s my two cents, people may disagree. But I have made a career out of rearchitecting Rails monoliths for the cloud. Sometimes we keep chunks in RoR because it’s not worth porting. But for new , high-scale things, almost no architect I bring in says… yes let’s KEEP investing in ruby. The only ones protecting RoR in those conversations are the devs afraid to learn something else.

  2. Rails + sidekiq + leverage serverless for short timed tasks using python/node/go

    That s how i would tackle it and then adapt as its scaling.

  3. >What does Rails 7 bring to the table that improves this?

    Not a lot, I guess, but the important thing is that the whole webdev changed a lot. Back in the days of “Twitter failure” it was all about verticals scaling, as setting up another server was a costly thing – you needed to have a Sysop with their secret script to set everything up, updates ware a pain, there was no infrastructure-as-code. Rails was bad (and still is) for vertical scaling.

    But these days it’s all about horizontal scaling. More Rails instances in a kubernetes cluster? Just change this one line in the YAML config. So, I would say that problems that Ruby and Rails have are not that important in 2021 as they were in 2009. I don’t know if it’s pure luck or just some insane future foretelling from Rails team, but whe universe played in their favour.

  4. So like to actually answer the question instead of just respond to comments:

    What Twitter did with Rails is irrelevant – its been 15 years. Both the framework and the language it uses have evolved a lot since then, as well as other things like underlying devops and physical infrastructure technologies. It’s sort of like asking people why they use React or Node and then pointing to how shitty JS was in 2001 as a justification.

    Rails scales fine. Its not as performant as other options, but you can build world class websites on it. You don’t use Rails if your problem requires high tier performance considerations.

    But the reality here is also that once you get into the territory of “world class websites”, you aren’t going to rely on just one language anyway. Amazon isn’t fully Java, Facebook isn’t fully PHP, Shopify isn’t fully Ruby or Rails. You pick the tools you need to get the job done, and websites of these calibre aren’t built with just one codebase/technology/etc..

    So, could you use Rails to start walking down the road of building a Twitter clone? Yes, absolutely. It’s also already been done – Yammer was a Twitter clone for businesses that was built on Rails, scaled up, and was sold to Microsoft.

  5. In a sense it _did_ _scale_ & might scale again as it got them to the point where they had the money to rewrite everything. & that’s the hardest part.

    Rails scale discussions miss the point. RoR is incredibly fast to develop in. It’s the quickest way to get to an MVP. Quickest way to a mil users. Quickest to 5 mil.

    Odds are your app fails or sputters along no matter what language you use. Thats ok. That’s the biz.

    To think every app you make will face Twitter scale issues on inception is ludicrous.

  6. You can fuck up an app written in any language. Rails is excellent for quickly building out a web application. If it’s built correctly, it will be plenty fast enough and can handle 90% of what it might be used for. If you build something poorly, you can use Go/NoSQL/Blockchain/buzzword of the day and it will perform poorly no matter what technology you throw at it. If you have a special use case where you need realitime streaming or something, maybe Rails is a bad choice from the get go but for most things, Rails willl get you up and running and keep you going for a long long time.

  7. Rails had scaling issues in lower versions but rails scales without issue today. Just look at shopify and github for examples

  8. Success is an effective answer to all criticism: hey, basecamp, shopify, and github – rails can “scale”…..rails is usually not the problem…..pick the right tool, and engineer it appropriately – and for the vast majority of cases, you can do plenty fine.

  9. An actual comment about Rails 7:

    If you use Hotwire’s Turbo frame tags, you can load parts of your page separately and cache those partials easier than rendering full pages. I haven’t enabled serious caching in my app yet though so I’m not sure how much you gain.


Leave a Comment