Rearchitecting Core Services at X
twitter.com
twitter.com
What I find odd about all of this is that while they (finally) split reads from writes, there’s no distinction between hot and cold data. I assume 80% of all tweets are only read 20% of the time, if that. This would heavily influence my architecture regarding caching for example.
RPC is also mentioned, leading to “pull” architecture, when I would assume most of the work to be a “push” pipeline, and work to be embarrassingly parallel. So there’s no real software complexity from interconnected data, just a large amount of it but it’s easily sharded and solved by good hardware? So in summary it doesn’t actually sound interesting from an algorithm perspective. What services are they talking about for RPC, analytics? Do those really need to be so dynamic?
They talk about “granular field-level access” — that’s just a SELECT statement. They talk about separating the read only workloads — that’s read scale out replicas. They talk about Arrow and similar technologies that sound an awful lot like SQL queries.
When you discuss a problem at a high enough level of abstraction, then yes everything looks like a database, and at a high enough level of traffic all databases need to be partitioned/replicated.
The much more interesting question would be "why doesn't the thing I'm familiar with solve this problem"?
It doesn't matter if you're syncing between a database and server, between a presentation layer and an object model, or across two devices over a network.
Fundamentally you're dealing with an impedance mismatch that only has so many types of solutions.
I think it's more likely that once you get down the details (which are going to much more intricate than a post like this can convey), then it may turn out to actually be a hard problem that requires a bunch of engineering.
For a relevant example of the "how hard could it be"-mindset: See George Hotz's short stint at Twitter.
Do you have any more information about this, or could provide a link?
- Volume of reads: how many people are reading tweets? - Volume of tweets: how many unique tweets are being served to people? - Data skew: Elon's tweets see hundreds of millions of reads, vs some tweets only see like 10. - Size of data: A tweet looks like only a few characters of data, but every tweet has probably hundreds of columns of metadata.
These are just a few considerations. Plus, scaling out replicas isn't always the feasible after a point. Otherwise, why not just spin up 1 server per tweet and keep things simple.
That these software devs then go out and build slightly different offshoots because of business requirements and technical requirements is, in many ways, incidental. Devs at smaller companies end up writing poor-man's equivalent of various techs all the time, or write interesting things in their spare time. It just doesn't get the same attention because they're not as big.
Elon Musk was supposed to be an uber-genious charisma who've overcome that problem. I suppose he no longer is.
I’ve thought Twitter was over-engineered years before that event and feel a tiny bit vindicated in holding that opinion against the HN gestalt.
That tweet viewed by a million people isn't just a million tweet database reads, it's also a million tracking database writes.