Download presentation
Presentation is loading. Please wait.
1
Process in the World as a Transaction
Nick Rossiter, Michael Heather Northumbria University
2
Classical (Database) Transactions
Properties of ACID: Atomicity collection of operations viewed as single process Consistency rules of organisation obeyed Isolation no results released until end Durability results are guaranteed to persist
3
Closure is Difficult For instance in ATM withdrawal:
mixture of physical and logical tasks once cash given to customer, cannot undo bank at risk unless results are immediately durable Notion of Transaction Log: save results to a number of different targets (disks) only complete when successfully write to last target disk
4
Recovery If bank information system crashes;
transaction log can be run through from last known position (savepoint) to most recent successful transaction partial transactions are discarded So if disk crashes after customer paid £1,000,000 in a suitcase of notes system will re-run the transaction and customer will have account debited
5
But some risk remains Strategy A to favour bank:
If ATM crashes before money paid out and after last transaction log entry made: customer’s account is debited but customer has no cash Strategy B to favour customer: If transaction log entry fails after cash paid to customer: customer has the cash and no debit to account
6
In practice A bank would probably not adopt strategy B as it could lose money Strategy A is workable if: ATM downtimes are accurately recorded Enables customer accounts to be corrected Corrections could be made semi-automatically with supervisory control Recourse to higher level
7
Problem of Physical/Logical Mix
Example of the principle of Landauer Information cannot exist except in the physical form All transactions ultimately involve physical objects need to handle together physical entities logic of the information system
8
Parallel processing Transactions involve a sequence of operations
But often the operations should be in parallel Sequence is used because of: von Neumann architecture locality of view sequence of operations between fixed cells
9
Theory of Transactions
Need constructions to: represent changes between states as dynamic relationships indicate desired change in state indicate rules controlling change in state measure changes in state that occur
10
Satisfying Theory - Category Theory
Need constructions to: represent changes between states as dynamic relationships adjunctions indicate desired change in state free functor (F) indicate rules controlling change in state underlying functor (G) measure changes in state that occur unit and counit of adjunction (, ) from left-adjoint perspective from right-adjoint perspective
11
Adjunction Example: Mapping Universe to Information System
12
Initial State Blue = category/object; red = functor; green = natural transformation
13
One cycle -- to right (F) and left (G) -- no change
14
One cycle -- to right (GF) and left (FG) -- change by
in S and in A Adjoint if triangles commute If is or is , then equivalence relation
15
Two cycles -- to right (GFGF) and left (FGFG) --
change by in S and in A Gives symmetry in treatment of S and A Dynamical relationship Perhaps one cycle enforces rules, second cycle commits
16
Abstract View of Effect of GF
17
Textbook representation of adjunction --
triangle only
18
Transactions are Non-local
This banking transaction is typical of any transaction as a non-local process. The log provides a parallel information system: looking forward to the sequence looking back to check that what was expected was achieved.
19
Possible Approaches to Banking ATM Transaction
Security Bank Customer Funds-check Grant Cash Simple commutative requirement Grant = Funds-check o Security Does not show state changes or rules
20
-| f* -| Adjointness between Customer and Bank Bank Customer
Pin number String match f* Customer Bank Access -| f* -| Better, shows relationships as adjunctions Does not show state changes
21
One cycle -- to right (FG) and left (GF) --
change by in S (Customer) and in A (Bank) F Funds request (free functor), G Status check (underlying functor applying rules) If is or is ,then no change to categories so back to initial state - transaction is aborted
22
Two cycles -- to right (GFGF) and left (FGFG) --
change by in S and in A Second cycle acts from banking perspective Introduces g in bank category Commits and releases cash Should be brief in execution for safety
23
Achievement of ACID A, I are natural, achieved through closure in adjointness C is natural, achieved through underlying functor in adjointness D is natural, represented by back and forward components log file is not represented directly but such a file is an artefact needed in a sequential system
24
Universe Transactions
The universe carries out transactions all the time non-locally mediating between objects in time and space. nevertheless still has the forward and back components except that they are non-local.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.