Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is key-value store the most stable scalable architecture? Reddit, I believe, uses the same idea


To restate your other reply, key-value allows you to sweep consistency problems under the rug. What happens if two transactions try to update the same row? One of the transactions fails. What happens if two clients write different values to the same key in a multi-master key-value store? The last one in wins and the first write is just lost.

Many of the NoSQL databases have provisions for these situations so they can handle both writes but bubble the decision up to the application layer. CouchDB, for instance, will tell you you've got multiple versions and has a way for you to tell it how to resolve the conflict. CRDTs let you bake the logic in for handling a conflict. MySQL does not do any of that. If your database consists of "likes" and other low-value data like that, you may not care if you're losing data at some low rate. Reddit is in that situation, and the decision seems to work for them. But I don't think it generalizes to all situations.


If you give up ACID (the C) you can scale more (the P), sure.

https://en.wikipedia.org/wiki/CAP_theorem




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: