Re: ZODB with Lazy evaluation / Caching / Data Flow programming

Jim Fulton <[email protected]> Sat, 28 Apr 2018 13:13:09 -0600
Newsgroups gmane.comp.web.zope.zodb
Message-ID <CAPDm-FjLztSP2XoAZ2+drhPN8b26QsBKBpbFqSO-3AW5VW0Qpw@mail.gmail.com>
On Thu, Apr 26, 2018 at 11:32 PM, Christopher Lozinski <
[email protected]> wrote:
...

> Jim, please correct me if I am wrong, but here is how I believe that the
> ZODB works.  If both ZEO clients are reading a value, no problem.  If both
> are writing a value, one is first, its write completes, the other computer
> gets an error.


Yes, unless the conflict can be resolved.



>   But if one is reading, while the other is writing, but before the cache
> is invalidated, the read goes through.  Even though the data is a bit out
> of date, it is not a problem in most cases.  Jim, is that a correct
> understanding?


Not really.  Or more specifically, it's not the right way to think about it.

Data read are consistent for the database as of some point in time.  When a
transaction starts, the view of the database is frozen for the client and
the client sees data for the database as of that point in time. The data
are "up to date" for that point in time.  If the client saw data written
later, the data would be inconsistent. This is generally how most modern
databases work.

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

Jim

-- 
Jim Fulton
http://jimfulton.info

-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.