Presentation is loading. Please wait.

Presentation is loading. Please wait.

Contents. Goal and Overview. Ingredients. The Page Model.

Similar presentations


Presentation on theme: "Contents. Goal and Overview. Ingredients. The Page Model."— Presentation transcript:

0 Chap 2. Computational Models.
Transactional Information Systems. Chap 2. Computational Models. (Thu) Database Lab. Kim Jinyoung

1 Contents. Goal and Overview. Ingredients. The Page Model.
1 Ingredients. 2 The Page Model. 3 The Object Model. 4 Road Map of the Book. 5 Lessons Learned. 6 References. 7

2 Goal and Overview. For Concurrency control & Recovery
Two Computational Models for transactional servers. Page Model ( = read / write model ) nicely motivated from looking at the way data pages are accessed at the storage layer of database system Define the data objects as pages with read and write operations. Object Model ( richer than page model ) Define the data objects as object with an encapsulated set of ADT operations.

3 Goal and Overview. Two Computational Models for transactional servers.
Language & Interface Layer : client-server communication, Initial processing steps for request, checking authentication and authorization. Query Decomposition & Optimization Layer : the request into smaller units that can be directly executed. Query Execution Layer : provides codes for operators and control, data flow among operators. Access Layer : Both data records and index structures are ultimately mapped onto pages. Storage Layer : responsible for managing the pages of a database. Goal and Overview. Two Computational Models for transactional servers. Layered architecture of a database sustem Clients Requests Language & Interface Layer Query Decomposition & Optimization Layer Request Execution Threads Query Execution Layer Object Model Access Layer Database Server Storage Layer Page Model Data accesses Page Model : Storage Layer. Object Model : Access Layer + Query Execution Layer. Database

4 Ingredients. Five-step program for characterization of computational models. Elementary operations on data objects are defined individual operation and it appears atomic and isolated from other operations Distinction between the page model & object model. Transactions as executions of transaction programs Sequences or partial orders of such operations. Schedules or Histories as abstract notion of concurrent executions Several transactions are shuffled into a large collection of operations. Correct Identify correct schedules in the sense of the ACID guarantees. Algorithms or Protocols to create correct Schedules Rules to create correct Schedules in an online manner.

5 The Page Model. has the essence of concurrency control and recovery problem. a comprehensive theory of concurrency control and of recovery can be built on Page Model. All higher-level operations on data are eventually mapped into read / write operations on pages. each page read or write is an indivisible operation. Limitation : no semantics of the data access operations (given the simple low-level nature of page reads and writes.)  This is exactly why we later need the richer object model.

6 The Page Model. ( finite ) set D = { x, y, z, … } : data server’s data items as pages. Syntax : totally ordered transaction. (finite) sequence of steps of the form r(x) or w(x). : j-th step of the transaction. : j-th step of the transaction i. : step j reads data item x. : step j writes data item x. ex)

7 The Page Model. Semantics : interpretation of a transaction.
 : current value of x is assigned to a local variable v j  : x is the return value of function f j All values , , that were read prior to the j-th step of t are used as parameters in function ex)

8 The Page Model. DEFINITION 2.1 Partial Order
Let A be an arbitrary set. A relation R⊆A X A is a partial order on A if the following conditions hold for all elements a, b, c ∈ A : 1. (a, a) ∈ R 2. (a, b) ∈ R ∧ (b, a) ∈ R  a = b 3. (a, b) ∈ R ∧ (b, c) ∈ R  (a, c) ∈ R ( reflexivity ) ( antisymmetry ) ( transitivity ) A Total order R of A : Partial Order Definition + Any two distinct a, b ∈ A, either (a, b) ∈ R or (b, a) ∈ R. (a, b) ∈ R : a b

9 The Page Model. DEFINITION 2.2 Page Model Transaction
A transaction t is a partial order of steps(actions) of the form r(x) or w(x), where x∈D, and reads and writes as well as multiple writes applied to the same data item are ordered. More formally, a transaction is a pair t = ( op, < ) where op is a finite set of steps of the form r(x) or w(x), x∈D, and < ⊆ op X op is a partial order on set op for which the following holds : if {p,q} ⊆ op such that p and q both access the same data item and at least one of them is a write step, then p < q ∨ q < p.

10 The Page Model. In the partial ordering, we disallow that a read and write operation on the same data item, or two write operations on the same data items, are unordered.  ensure an unambiguous interpretation. ex) , t = r(x) w(x) r(y) r(x) w(x) last write step determines the final value of x produced by this transaction. Assumptions : in each transaction each data item is read or written at most once, no data item is read (again) after it has been written.

11 The Object Model. explicitly separate this model from the page model.  alternative to or generalization of the page model. provides framework for representing method invocations on objects. Represents transaction as tree with the invoked operations as nodes. Leaf nodes of transaction tree be elementary operations. (read / write) Layered Transaction ( = Multilevel Transaction ) : All leaf-nodes have same distance form root. (special case) Inner-node Ordering : a < b if all leaf-node descendants of ‘a’ precede all leaf-node descendants of ‘b’.

12 The Object Model. Example 1. : Database system layers.
Select Name, City, Zipcode, Street From Person Where Age < 30 And City = “Austin” The Object Model. Example 1. : Database system layers. (1) Retrieve all records from Database of persons who live in Austin. (2) Insert a record for a new person who happens to live in Austin. 1. Read the root of B+ tree at page r. 2. Read of leaf of B+ tree at page l. 3. Then Return RIDs of record x and y. transactions 5. Read the metadata page(f) for find new page(p) with sufficient empty space 6. Read the page(p) and 7. write new record z 8. Add the RID for z to the B+ tree 4. Record x, y fetch at each pages & respectively

13 The Object Model. Example 2. : Business Objects.
1. Fetch record a on page s for head and tail of queue 2. Fetch most recent record d on page t 3. Add new record e on page t 4. Update the most recent record d on page t 5. Update (record a in page s) the head and tail of queue Example 2. : Business Objects. (1) Withdraw money from one bank-account x (2) Deposit money in another bank-account y x, y  Bank accounts object h  History object (queue) for cash flow information x, y  Records on pages ^ ^

14 The Object Model. DEFINITION 2.3 Object Model Transaction
A transaction t is a (finite) tree of labeled nodes with the transaction identifier as the label of the root node, the names and parameters of invoked operations as labels of inner (i.e., nonleaf, nonroot) nodes, page model read / write operations as labels of leaf nodes, Along with a partial order “<“ on the leaf nodes such that for all leaf node operations p and q with p of the form w(x) and q of the form r(x) or w(x) or vice versa, we have p < q ∨ q < p.

15 Page Model vs Object Model.
Definition of Data Object Page with read / write operation Object with set of ADT operation Operation Layer Storage Layer Access Layer & Query Execution Layer Representation of transaction Sequence of read / write operation Tree with the invoked operations as nodes

16 Road Map of the Book. Part III: Recovery Part II: Concurrency Control
Ch 3. Notion of Correctness for the Page Model Ch 4. Concurrency Control Algorithms Ch 5. Multi-version Concurrency Control Ch 6. Concurrency Control on Object Ch 7. Concurrency Control Algorithms on Objects Ch 8. Concurrency Control on Relational Database Ch 9. Concurrency Control on Search Structure Ch 10. Implementation and Pragmatic Issues Part III: Recovery Ch 11. Transaction Recovery Ch 12. Crash Recovery: Notion of Correctness Ch 13. Page Model Crash Recovery Algorithms Ch 14. Object Model Crash Recovery Ch 15. Special Issues of Recovery Ch 16. Media Recovery Ch 17. Application Recovery Part IV: Coordination of Distributed Transactions Ch 18. Distributed Concurrency Control Ch 19. Distributed Transaction Recovery

17 References. G.Weikum and G.Vossen, “Transactional Information Systems: Theory, Algorithms, and the Practice of Concurrency Control and Recovery,” Morgan Kaufmann, 2002

18 Thank You !


Download ppt "Contents. Goal and Overview. Ingredients. The Page Model."

Similar presentations


Ads by Google