by sausagefeet · 2y ago · 0 comments
The author, additionally, seems to not be well-versed in the existing distributed database literature.
Essentially they have added a queue in-front of all database operations. That queue is totally ordered, so you can't have consistent issues. That queue apparently does all operations via a two-phase commit (without calling it that and being unclear on semantics, so I am not 100% sure).
Ok. So you've moved the question of availability and consistency to your queue. Is that a single queue? If so, then it's a liability. Why not just use a single database at that point. Is it multiple queues? Then you still have a consensus problem to solve. Are you using two-phase commit? Well, now your availability is seriously impacted.
There is nothing there.
It's a shame because there are models that are much more interesting that provide a useful mental model for this. PACELC is my favorite. The essence is that when everything is going fine, your decision is around latency and consistency. When there is a partition, your question is between availability and consistency.
https://mark-burgess-oslo-mb.medium.com/using-promise-theory...
I haven’t done heavyweight distributed systems theory in a few years, and so who knows, maybe @aphyr shows up and Jepsen-stamps this thing, but after reading the paper and going over the commercial website personally I’m a pass. I’m one of about a zillion people on HN who have dealt in petabyte and trillion event days on logs as mundane subsystems for years on end and it’s just almost always: “there’s the lock, didn’t see it right away because of the bespoke nomenclature”.
History is replete with misunderstood geniuses who weren’t appreciated because they were so far ahead of everyone else (Galois is my favorite example personally), and we might all end up eating crow over it, but this has a wink and a grin vibe that I’m going to regard as great satire rather than hyperventilating. I suspect the object of the satire would be blockchain.
The consistency-levels can go all the way to SNAPSHOT.
Say we have a database of customers, with two replicas - one in the USA, one in Europe. Say a customer in Europe wants to update their shipping address. We ship products every month to this customer from the USA to their current shipping address, on the 10th of that month.
The customer is updating their address on the 9th at 10 AM PST. However, we are in the midst of a massive network partition that started on the 9th at 02 AM PST and is expected to last until the 11th.
Do we perform the update in the European replica and tell the customer it succeeded (giving up consistency)? If we do, the US side of the business will ship the products to the old address, even though the update happened a full day earlier.
Alternatively, do we tell the customer the update failed (giving up availability)? If we do, then the customer can't even let the European side of the business know of their new address.
This is the CAP theorem in a nutshell, and it is obviously inescapable. It doesn't require appeals to immediacy that are anywhere close to the bounds of relativity. And while 3-day long network partitions are quite rare, partitions that last for many hours are not.
That's exactly the point of this section in the essay: https://medium.com/p/5e397cb12e63#7df1
Networks will have latency-spikes, but if you can stream time-information the same way you can stream others, you can use redundancies to mitigate the disruption of any single channel.
CAP theorem beaten by declaring P to be unlikely.
Even if there were two different US nodes, and only one node lost connectivity to the others, the problem wouldn't change at all - the branch which only has access to the disconnected node would still either send shipments to the wrong address or stop being able to read the status at all.
Could you please show a failure mode that this system can handle that CAP says is not possible?