Shu, Xinxin wrote:
Hi list ,
Recently I read docs about lmdb , there are two sentences
- readers do not block writers
- writers do not block readers
I can understand 'readers do not block writers' , but cannot
understand the second one , can someone help explain , how lmdb achieve 'writers do not block readers', below is my understandings , please correct me if anything wrong.
if the access pattern is write - read, since lmdb only support two
version of data , when the write has been started but not committed , the concurrent read may read stale data since write has not been committed.
This is fundamental to ACID transactions. The reader's data is not "stale" because in ACID, data doesn't actually exist until it's committed. This is what Atomicity and Isolation are all about.
Sounds to me like you have never used a real transactional database before; you need to do more reading on them because this is a very basic principle.