by apeace · 9y ago · 0 comments
> - The demands of a consumer Web site/API or multitenant enterprise application simply exceed the computing capacity of any one machine.
> - An enterprise moves an existing application, such as a three-tier system, onto a cloud service provider in order to save on hardware/data-center costs.
When you've exhausted the capacity of a single machine, typically you don't jump straight to a distributed system. You can scale out horizontally with a stateless application layer, as long as the data storage on the backend can handle all the load. You can also scale database reads horizontally, using read replicas.
This horizontal scale-out is not a distributed system, since consensus ("source of truth") still lives in one machine.
So I think a better phrasing of #1 would be "When your write patterns exceed the computing capacity of any one machine".
But just because your storage layer is abstracted behind an API doesn't mean eventual consistency isn't your concern.
Take S3 for example.
LIST calls lag deletes but exists() doesn't, so exists() could return 404 for a document that's still included in the result of LIST. Plus, all exists() calls go through a caching load-balancer, so you could receive different answers in two subsequent exists() calls.
That's just a small subset. There's a good comment here[1] on S3's consistency semantics.
Point is, 12FA makes things easier but any time you have more than one computer involved (i.e, always), consistency becomes complicated.
Modern computers are not only CPU bound, they are also interrupt bound, and sadly very limited in "available reliable timestamp" capacity. And controlling which clock you use is hellish.
And if the availability of a monotonic raw clock was not enough, I feel bad that in 2017 we still rely on 8254.
Documentation for having a reliable clock on every OSes is close to 0.
Without reliable clocks, without reliable synchronisation, we are anyway unable to provide "good" distributed systems at low costs (yes GPS is a solution that can be easily hijacked).
x86 has won because of legacy supports, but the legacy support means we are stuck with outdated components
I'm sure some apps need to be distributed systems, but I bet it's a tiny minority.
If anything, considering the fat client trend we're in, I'd go the other direction and claim a single web server backend with multiple clients (browsers) is a distributed system.
I think this is a key idea, though my experience with it only comes from writing game servers. Things are much simpler when there is a single "source of truth" per user. In my system, there is an "active" state maintained in an "instance" where the user is rapidly updated in memory, and a "persisted" state stored to the database when a user joins an instance. This keeps the frequency of database writes down. (And enables many users to be able to interact with each other in realtime.)