简体   繁体   中英

Read record after write in eventual consistency environment

How can I read a record back after I write to a NoSQL eventual consistency environment? For instance, I went to a large ecommerce site and after I placed an order, I got order confirmation page but when I clicked on the order number, I got order not found message, but worked fine after a minute, due to eventual consistency. How can I overcome that problem in a NoSQL environment like Cassandra?

I think that in your example, the problem was not in the real eventual consistency, but in the separation of the systems - quite often, order ID is generated by some subsystem, and then pushed into DB via some queue, or something like.

Talking about eventual consistency in Cassandra - in case if you want to have strong consistency, you can play with consistency settings of read & write operations. If you have R + W > RF , then you achieve strong consistency. But this could be achieved different ways, depending on performance requirements - quite often people simply use QUORUM for both reads & writes - in this case it will guarantee that you always get back the result that you wrote.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM