Types of State Access
Last updated
Last updated
In Arcology, a "state access" refers to a specific action that a transaction performs on the data items stored in the StateDB. Operations are used to interact with the data, retrieve information or make changes. Each operation corresponds to a certain type of interaction with the data, and the Arcology processes these operations to manage the underlying database efficiently and maintain data integrity.
The concurrency control system monitors three types of state accesses during transaction processing:
Read: The read
operation retrieves data from the database without making any changes to it. Read operations provide information to the user or application and are essential for querying the StateDB.
Write: In Arcology's concurrent execution design, a write
operation refers to an action where a transaction modifies the value of a data. The write
operations involve updating data to reflect new information or changes made by the transaction.
Delta Write: A delta write
refers to a type of modification that is the difference between the new value and the original value.
Arcology supports delta-write on commutative variables only. In Arcology, a commutative variable refers to a type of thread-safe data that supports commutative operations. Commutative operations are those that can be applied in any order without changing the final outcome. Please refer to for more details.
Delta changes can reduce conflicts between transactions that attempt to modify the same data item. Since the actual update is deferred until later, transactions can accumulate their changes without immediately conflicting with each other's write operations.
For example, if you perform a delta write to a variable with an initial value of 4, adding 1, the final value would be 4 + 1 = 5, reflecting the commutative nature of the operation. However, for non-commutative variables, the delta write would simply overwrite the original value with the new one.
There are some key differences between the "write" and "delta write" operation:
Data Update: A write operation replaces the original data with the new data, while a "delta write" records the change that needs to be applied to the original data.
Immediate vs. Deferred Update: A write operation immediately updates the data, while a delta write defers the update until a read operation is performed, or the transaction is committed.
Read Overhead: Delta writes can introduce computational overhead during read operations because the delta changes need to be applied before providing the data to the user. Writes don't have this additional overhead during reads.