Isolation Level of rkv (regionless key value store) - CentaurusInfra/regionless-storage-service GitHub Wiki

This wiki dedicates to isolation: which isolation level our rkv provides.

Isolation level, is the statements of guarantees that the system (typically databases, but could be any others) promises when multiple transactions (operations or operation groups) are concurrently happening.

ISO-SQL Isolation Levels

First, lets clarify the implications of various isolation levels people commonly refer to as ISO-SQL Standard:

  • READ-UNCOMMITTED
    not much guarantee; almost anything could be possible.
  • READ-COMMITTED
    guarantee to have no dirty read. The dirty read is that data interim change exposed prematurely outside of the transaction.
  • REPEATABLE-READ
    guarantee to have no dirty read, nor non-repeatable read. The non-repeatable read is that inside a transaction, readings same single data present different value.
  • SERIALIZABLE
    guarantee to have no dirty read, no non-repeatable read, nor phantom read. Phantom read is that inside a transaction, selectings of multiple data on basis of filter (so called scanning) present different sets.</br/>

Our rkv system has not provide op-group transaction yet. Nonetheless, rkv deliberately presents guarantee for single op (get/put), as single op involves multi components like indexer and back-end storage replicas, and affect their status. Based on the consensus of ISO standard, rkv with synchronous replication only pragmatically provides SERIALIZABLE isolation for its get/put operation (todo: rkv with asynchronous replication isolation level).

Snapshot Isolation

not in ISO Standard, but commonly received definition. Snapshot isolation performs all reads/writes of data as of a particular snapshot of the database state which contains only committed data. This snapshot remains constant throughout the lifetime of the transaction. As rkv with synchronous replication only guarantees repeatable-read against only committed data, it is considered satisfying snapshot isolation.

Finer-grained Serializable Isolation

  • 1SR (one-copy serializability)
    the isolation guarantee is equivalent to serializability in an unreplicated system with “one copy” of every data item. Our rkv with synchronous replication is 1SR (todo: evaluate rkv having asynchronous replication).
  • Strict Serializable
    besides 1SR, it guarantees that if a transaction X completed before transaction Y started (in real time) then X will be placed before Y in the serial order that the system guarantees equivalence to. Our rkv, if only synchronous replication allowed, is considered strict serializable - it has causal ordering by revision, before the revision number is exhausted.
⚠️ **GitHub.com Fallback** ⚠️