Isolation Levels for Clients of a Service Provider System (Not necessarily a DBMS)

Isolation levels have been discussed mostly in the context of DBMS.  Abstracting this further to a generic system is this attempt…

 
Scenario:
  1. There are 3 systems: System1, System2 and System3.
  2. System1 encapsulates certain data and provides “primary” operation Op1, Op2, Op3 on that data (Variations of the operations are also provided by System1)
  3. System2 and System3 are consumers of that data.
  4. System2 and System3 access System1’s operations independent of each other.
  5. System1 doesnot perform any operations on the  data by itself.
  6. Data is always modified by through one of the operations Op1/Op2/Op3, executed by System1 when a request is raised for an operation. by System2 or System3.
Problem:
Given the above scenario:
  1. How does System2’s interaction with System1 impact System3’s interaction with System1 i.e. what isolation levels can be made available by System1 to offer to System2 and System
Approach:
  1. Assuming that every operation is important from the perspective of either seeker (ex: System2 ) or the provider (ex: System1)  each operation can be controlled by a counting semaphore (ex: binary semaphore which represents locked/unlocked state)
  2. Lets name these counting semaphores a Sem1, Sem2, Sem3.
  3. Lets also name the cardinality of the set of values each of the semaphores as  N1, N2 and N3 respectively.  As with a counting semaphore for resources, a value taken out of the set has to be returned to it before another client can be given that same value.
  4. Given above the access privileges of System2 (or System3), at a given point of time, on operations provided by System1 (ex: Op1) can be depicted by the value of the Semaphores that they hold. i.e.  System2 may hold a value x of Sem1 (among the N1 possible values) y of Sem2 and z of Sem3.
  5. Given above it is possible to write a function which determines whether a certain combination of  semaphores of a set of clients is valid ex: a function which takes as input – clients and their  semaphores  – returns a boolean flag indicating if the combination is valid for the semantics of the problem. For a more concrete example
    • if System1 is database and operation is “write”,  System2 and System3 cannot hold “locked” value for “write” semaphore. So this function would return false.
  6. By executing the above function for all combinations of semaphores for two concurrent clients, it should be possible to arrive at a list of valid combinations ex: if System1 is a database and primitive operations are read and write (insert, update and delete are different modes of this primitive operations) then several combinations are valid (as per the function which bases its judgement on the semantics of database management problem). For more concrete example below are valid combinations for System1(database)
    • System2 – Write – Locked and System3 – Read – Unlocked.
    • System2 – Read – Unlocked and System3 – Read – Unlocked
  7. Group the valid combinations into various isolation levels again based on the semantics of the problem ex: in case of database (or a caching implementation) the isolation level could be defined as below based on what the function considers as valid.
    • Read committed
    • Read Uncommitted
    • Serializable
    • Repeatable read

(Work-in-progress: how to write the function in a generic manner, such that with enough parameters it could return valid isolation levels for any Service Provider System)

Proudly powered by WordPress | Theme: Outfit Blog by Crimson Themes.