Skip to main content

Advances, Systems and Applications

Table 1 A fragment of new-order transaction containing two pieces

From: 2PC*: a distributed transaction concurrency control protocol of multi-microservice based on cloud computing platform

transactionnew_order_fragment:

#simplified new-order “buys” one of item1, item2

input: item1 and item2

begin

F1: # reduce stock level of item1

Read(tab = “Stock”, key = item1) → stock if (stock > 1):

Write(tab = “Stock”, key = item1) ← stock - 1 ...

F2: # reduce stock level of item2

Read (tab = “Stock”, key = item2) → stock if (stock > 1):

Write (tab = “Stock”, key = item2) ← stock - 1 ...

end