to demands of low response time • CAP theorem depicts a tension between Consistency and Availability • Ideal world for developers = high availability + convergence + application safety • A modular and sequential proof to ensure this! 2
or CLOSED • Winner • Set of bids, each bid comprising • BidId • Placed • Amount 4 • Invariant • Bids can be placed only when the status is active • When auction is closed, there is a winner • Winner is the highest bid • Operations • Start auction • Place bid • Close auction
can happen at any time • Can be also called Concurrent Invariant • The weakest precondition to be upheld for the resulting state of merge to uphold the sequential invariant • Ensures all concurrent operations are still safe • Never block any merge!! 9
evolves with • A local update by operation • Merge • Merge is the only point of observable concurrency 10 Alice/ Australia Bob/ Belgium Charlie/ Canada Start auction Place bid Place bid
must satisfy the sequential invariant and concurrent invariant • Each update and merge should preserve both the sequential invariant and concurrent invariant 11
of external influence • Merge can happen any time • Properties • Modular • Each operation and merge reasoned in isolation • Sequential • Reasoning as if for a sequential application 12
can be placed only when the status is active 2. When auction is closed, there is a winner 3. Winner is the highest bid • Place bid • If auction concurrently closed in other replica, precondition of merge violated!
can be placed only when the status is active 2. When auction is closed, there is a winner 3. Winner is the highest bid • Place bid • If auction concurrently closed in other replica, precondition of merge violated!
can be placed only when the status is active 2. When auction is closed, there is a winner 3. Winner is the highest bid • Place bid • If auction concurrently closed in other replica, precondition of merge violated! • Close auction • Similar to place bid
can be placed only when the status is active 2. When auction is closed, there is a winner 3. Winner is the highest bid • Place bid • If auction concurrently closed in other replica, precondition of merge violated! • Close auction • Similar to place bid
bid and close auction operations • Issue: each place bid need synchronisation • Option 2: • Concurrency control similar to readers-write lock • Place bids work without synchronisation • Closing auction needs synchronisation 16
operation is monotonically non-decreasing • Merge is the least upper bound • Safety checks • Sequential safety -> each operation preserves the invariant • Concurrent safety -> each operation preserves the precondition of merge 19