4 ms·
Riak does. You say, when writing, "please don't return until this data is replicated on 2 servers." And when reading, "please only return a successful read if t
by orthecreedence 14y ago
Riak does. You say, when writing, "please don't return until this data is replicated on 2 servers." And when reading, "please only return a successful read if this data is read from 2 servers."
So you have R = 2, W = 2, R+W = 4, and if your replication (N) val is 3, you're fine (you're always going to get consistency if R+W > N).
Riak is cool.
- achompas 14y agoI believe Cassandra does as well, not 100% sure though.
- ash211 14y agoCassandra does, you can write with a write consistency of W and read with a read consistency of R, and as long as their sum is greater than the replication factor (number of copies to store across the cluster) you have consistent reads. W + R > N. http://wiki.apache.org/cassandra/ArchitectureOverview#line-190 http://wiki.apache.org/cassandra/ArchitectureOverview#line-1...
- splix 14y agoMongoDB has such feature (maybe its depends on driver, but at least JVM drivers have - http://api.mongodb.org/java/2.9.1/com/mongodb/WriteConcern.html http://api.mongodb.org/java/2.9.1/com/mongodb/WriteConcern.h...). As for me, it's mostly the quesion of perfomance, and application architecture, most time you don't want to wait until it's replicated to slaves.
- mgummelt 14y agoAs far as I can tell, WriteConcerns don't protect from inconsistent reads in all cases. It looks like the most conservative setting is Majority, but even then there is no assurance that reads won't occur during the replication, nor that they won't occur to one of the minority of non-replicated servers.
- mrkurt 14y agoYou can set it to the total number of slaves you have and ensure data is on all of them. Normally that slows writes down enough that it's undesirable, though.
- mgummelt 14y agoDoes Riak support distributed transactions? If not, I don't see how they handle the possibility of a read occuring during the replicated write.
- sausagefeet 14y agoNo, Riak is nontransactional. But neither is mongo if it's important here. Riak is apparently getting some kind of strong consistency though. Calvin looks interesting for a nosql with distributed transactions.
- mgummelt 14y agoThis is also something we desperately needed at my last company, but we couldn't find FOSS that supported it. mysql offers XA, but I've heard mixed reviews.
- varworld 14y agoRiak is cool and what you have described is correct however under failure conditions[1] you may not get this desired behavior. [1]http://docs.basho.com/riak/latest/references/appendices/concepts/Eventual-Consistency/#Failure%20Scenarios http://docs.basho.com/riak/latest/references/appendices/conc...