4 ms·
Sigh, quoting from an earlier comment I made here: (https://news.ycombinator.com/item?id=14648745 https://news.ycombinator.com/item?id=14648745) It is true tha
by marknadal 9y ago
Sigh, quoting from an earlier comment I made here: (https://news.ycombinator.com/item?id=14648745 https://news.ycombinator.com/item?id=14648745)
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.
- velzevur 9y agoThis! 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.
- aidenn0 9y agoIf your client has to work when the database isn't available anyways, then isn't that an even stronger argument for a CP database?
- naasking 9y agoTo 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.
- aidenn0 9y agoThe 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.
- zzzcpan 9y agoCP 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.
- ProblemFactory 9y agoI 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.
- marknadal 9y agoThis 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 https://github.com/amark/gun (MIT / ZLIB / Apache 2 licensed).