Re:CAP: Don't settle for eventual consistency
by aidenn0 on Wednesday June 28, 2017 @03:37PM
(#14657510)
If your client has to work when the database isn't available anyways, then isn't that an even stronger argument for a CP database?
Re:CAP: Don't settle for eventual consistency
by naasking on Wednesday June 28, 2017 @03:42PM
(#14657552)
To be CP, your client and the server database have to both view the same consistent data, so your client can't be available if the database isn't available.
If your client is available even in this case, then you have some kind of eventual consistency.
Re:CAP: Don't settle for eventual consistency
by aidenn0 on Wednesday June 28, 2017 @03:48PM
(#14657596)
The article was specifically comparing database software, not entire systems; if your client is available when the DB is unavailable, then you can have an AP system regardless of the design of the database.
Re:CAP: Don't settle for eventual consistency
by ProblemFactory on Wednesday June 28, 2017 @04:20PM
(#14657936)
I think the argument is that people expect mobile and client-side web apps to continue working offline, and eventually sync and merge changes across clients. So you need a good solution for resolving inconsistent updates made by two offline clients. The same solution could be used for resolving inconsistent updates made on two database servers.
Re:CAP: Don't settle for eventual consistency
by naasking on Wednesday June 28, 2017 @07:38PM
(#14659555)
> So you need a good solution for resolving inconsistent updates made by two offline clients. The same solution could be used for resolving inconsistent updates made on two database servers.
Exactly what I was trying to get at, thanks. The line between client state, server state and db state is a thin illusion. As REST makes explicit, every client operates on a representation of some server resources, which means CAP can come into play in even the most trivial online apps.
Re:CAP: Don't settle for eventual consistency
by marknadal on Wednesday June 28, 2017 @04:35PM
(#14658110)
This is so beautifully said, I wish I could have been that concise. Thank you for this comment, very well worded. That is exactly what I'm trying to do with my own system, for anybody curious: https://github.com/amark/gun (MIT / ZLIB / Apache 2 licensed).
Re:CAP: Don't settle for eventual consistency
by aidenn0 on Wednesday June 28, 2017 @04:58PM
(#14658325)
Okay, that makes sense.
Re:CAP: Don't settle for eventual consistency
by zzzcpan on Wednesday June 28, 2017 @04:00PM
(#14657716)
CP system is about not working when it is not available, otherwise you have no consistency at all and it is in fact very important to consider the whole system, not only the database part. Eventual consistency lets you fetch and store a tiny view of the database in the client and allows the user to work completely within the local storage, synchronizing with the global storage only when the internet connection is available. Which enables fast and always available user experience.
Re:CAP: Don't settle for eventual consistency
by velzevur on Wednesday June 28, 2017 @03:26PM
(#14657412)
This! I can not stress this enough: algorithms, languages and paradigms are just tools and some are suitable for a certain job and some are not. How do you choose a language to complete a task? It depends on the task at hand.
In handling money you must be consistent but in some other cases - eventual consistency is just good enough.
When building a server should I kick all users out just because we've lost a couple of nodes in the cluster? It always depends, it always is a trade off.
It is true that if you assume your client app is not important that a CP system is the right choice. And I would also say this /was/ true up till about 2004 when Gmail was released. But it definitely stopped being true in 2007 when the iPhone was released and you started having installed apps.
Since then, users have slowly grown to expect both mobile apps and SPAs to work regardless of whether the servers work, regardless of load balances, regardless of connectivity.
If you look at the market trends, things are increasingly going in this direction. From self-driving cars, to IoT devices, to drone delivery, to even traditionally server-dependent productivity tools like gDocs and others - people need to get work done even if the internet to your server doesn't exist.
Will banking applications still need mostly server-dependent behavior? Yes. Is CP still important? Yes. But it is biased to say that CP systems are better. Choose the right tool for the right job. CP systems are definitely the right choice for a strongly consistent database, but they aren't the right choice for everything. My database is an AP system, but it should not be used for many apps out there. Neither of these are "better", they are just tradeoffs you have to decide upon.