News for hackers. Stuff that matters.
Re:Spanner, TrueTime and the CAP Theorem [pdf] by manigandham on Thursday December 14, 2017 @12:58PM (#15924590)
To head off the usual comments, Spanner (as quoted in the source) is a CP system and this is a rather disingenuous and unfortunate marketing spin by Eric Brewer that conflates availability of the network infrastructure with availability of a distributed quorum in a network partition.

How reliable your network is has nothing to do with what happens when it inevitably does have a failure.

Re:Spanner, TrueTime and the CAP Theorem [pdf] by thesandlord on Thursday December 14, 2017 @02:39PM (#15926091)
(I work for Google Cloud)

Half this paper covers what happens during a network partition, the other part talks about the historic data backing up the claims that they are super rare. There is even a whole section called "What happens during a Partition".

On the first page:

> The purist answer is “no” because partitions can happen and in fact have happened at Google, and during (some) partitions, Spanner chooses C and forfeits A. It is technically a CP system. We explore the impact of partitions below.

And the conclusion states as a fact that outages will occur:

> Spanner reasonably claims to be an “effectively CA” system despite operating over a wide area, as it is always consistent and achieves greater than 5 9s availability. As with Chubby, this combination is possible in practice if you control the whole network, which is rare over the wide area. Even then, it requires significant redundancy of network paths, architectural planning to manage correlated failures, and very careful operations, especially for upgrades. Even then outages will occur, in which case Spanner chooses consistency over availability.

Re:Spanner, TrueTime and the CAP Theorem [pdf] by zzzcpan on Thursday December 14, 2017 @03:20PM (#15926569)
You can think of this a bit differently, that the network is asynchronous and is effectively always partitioned. This helps to highlight the trade offs between CP and AP, since it becomes obvious that you need to wait to get consistency and if you don't wait you can get it only eventually. Also becomes obvious that CA systems cannot actually exist, and 5 9s availability has absolutely nothing to do with any of that.
Re:Spanner, TrueTime and the CAP Theorem [pdf] by theptip on Thursday December 14, 2017 @06:36PM (#15928402)
This is a much more sophisticated way of carving up the problem -- for those interested in reading more, Kleppmann has discussed this extensively:

https://martin.kleppmann.com/2015/05/11/please-stop-calling-...

Re:Spanner, TrueTime and the CAP Theorem [pdf] by muxator on Thursday December 14, 2017 @05:19PM (#15927727)
Fair point. This is a very clever way of looking at it, thanks.
Re:Spanner, TrueTime and the CAP Theorem [pdf] by manigandham on Thursday December 14, 2017 @03:45PM (#15926836)
That's my point. Overall this paper tries to make the case for "effectively CA" which is not real. It's a marketing tactic that basically just adds confusion to the conversation.

If you want to talk about the fantastic reliability of the infrastructure, that's a separate topic than data availability during a failure.

Re:Spanner, TrueTime and the CAP Theorem [pdf] by elvinyung on Thursday December 14, 2017 @01:49PM (#15925420)
I remember having an argument with a distributed systems professor about whether banks were AP or CP. He said that they were strongly consistent because they would always have redundant network links to prevent partitions, and refused to consider the hypothetical case of a network partition.

That was the day I dropped the course.

Re:Spanner, TrueTime and the CAP Theorem [pdf] by eternalban on Thursday December 14, 2017 @10:56PM (#15929582)
Banks are logically CP. ("Your deposit will be available by the next business day.")

Technological advances are however, per Professor, reducing (or entirely eliminating) service availability gaps. But should the branch office partition from the main office, then the system will revert to strict CP.

Re:Spanner, TrueTime and the CAP Theorem [pdf] by manigandham on Thursday December 14, 2017 @11:49PM (#15929721)
That's AP. It's better customer service to be available so you always get an answer, it's just out of date. Deposit being available next day means eventually your balance will be made consistent after all the settlement occurs.

Banking is an AP, eventually consistent, event-sourced system. All transactions are logged as pending and then processed later. If something is invalid, then it gets denied or reversed as another transaction. This is why you see deposits held, limits on ATM withdrawals, and charges on credit cards that take days to show up.

Some systems do the processing constantly so it seems instant but its never "real-time". In fact, Eric Brewer himself talks about this concept, usually called BASE as an alternative to ACID:

https://www.infoq.com/presentations/NoSQL-History

http://highscalability.com/blog/2013/5/1/myth-eric-brewer-on...

Re:Spanner, TrueTime and the CAP Theorem [pdf] by solipsism on Thursday December 14, 2017 @05:07PM (#15927615)
Pardon the eyeroll, but that's incredibly pedantic. Brewer is not being disingenuous here, he's being forthright. Spanner is a product. "Effectively CA" is what customers care about. The fact that it's "technically not CA" is only important academically, and for the very small subset of customers for whom even the very tiny chance of loss of availability is problematic.
Re:Spanner, TrueTime and the CAP Theorem [pdf] by theptip on Thursday December 14, 2017 @06:41PM (#15928446)
The point that the GP is making is there is no such thing as "effectively CA". CA is a specific academic term with a specific meaning; there's no reason to introduce it into the conversation if you're not going to follow that meaning.

By all means call this system a "ultra-high availability strongly consistent datastore", but it's still not CA.

(It's all the more disappointing that it's Brewer himself, the original author of the CAP theorem, that's engaging in this hand-waving).

Re:Spanner, TrueTime and the CAP Theorem [pdf] by manigandham on Thursday December 14, 2017 @06:13PM (#15928196)
Accuracy is not pedantic, especially when claiming something which is impossible. If customers don't care about availability than they also don't care about the difference between CP or CA, so why not just stick to CP which is real?

Perhaps disingenuous was too harsh, but my issue is that it took plenty of time for CAP to be well-understood and this marketing material does more harm than good by creating confusion. There are better ways of product marketing that don't try to fudge descriptions with technicalities.

Re:Spanner, TrueTime and the CAP Theorem [pdf] by wwarner on Thursday December 14, 2017 @01:53PM (#15925473)
For me, the paper was of interest because of the ways that Spanner reduces the surface area of faults through controlling the networking and the application of a global clock.
Re:Spanner, TrueTime and the CAP Theorem [pdf] by vikiomega9 on Thursday December 14, 2017 @04:19PM (#15927157)
But isn't network reliability a necessary condition for distributed consensus?
Re:Spanner, TrueTime and the CAP Theorem [pdf] by manigandham on Thursday December 14, 2017 @06:05PM (#15928138)
No. A query takes place and the network is either working or not at that instant, and the system reacts accordingly. CP means it might not be available, but if it is then you'll get the latest data. AP means you'll always get an answer, but it might not be the latest data.

You can make your network reliable in the sense that better infrastructure lowers failures, but nothing is 100% so CAP is about what happens in the inevitable failure scenario. Whether you have 0 failures or 1 per hour doesn't affect CAP at all and has nothing to do with magically making something CA.

Re:Spanner, TrueTime and the CAP Theorem [pdf] by vikiomega9 on Thursday December 14, 2017 @06:53PM (#15928533)
My comment is that you cannot have CP without a reliable network, an unreliable network is equivalent to a partition event. This might be a naive assertion, but how else do you have a partition event? I'm confused about what you were trying to say. The post talks about being effectively CA which is what I understood about spanner when I came across the system.
Re:Spanner, TrueTime and the CAP Theorem [pdf] by manigandham on Thursday December 14, 2017 @07:37PM (#15928800)
The network is either working or not at any given instant. During that instant, CAP determines how the system responds.

Reliability is the graph of many instants over some period of time, so 50% reliability over a day means it's not working roughly half of the instants measured for 24 hours.

So it doesn't whether your network is 1%, 99%, or 100% reliable because CAP is saying that when a partition exists, this is how the system works. If the network is 100% reliable, then sure, partitions never happen and you can be CA, but since that is not possible and partitions will always happen eventually, you have to be either CP or AP - and Spanner chooses CP, which is the only accurate description.