Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computational Models Database Lab. 120100213 Minji Jo.

Similar presentations


Presentation on theme: "Computational Models Database Lab. 120100213 Minji Jo."— Presentation transcript:

1 Computational Models Database Lab. Minji Jo

2 contents Goal and Overview Ingredients The Page Model The Object Model
Page Model vs. Object Model Road Map of the Book References

3 Goal and Overview Two computational model for transactional server
Page model ( = read / write model ) 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

4 Goal and Overview Clients Server Requests Language & Interface Layer
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. Database Server Clients . . . Requests Language & Interface Layer Query Decomposition & Optimization Layer Query Execution Layer Access Layer Storage Layer Data Accesses Request Execution Threads Page Model Object Model Page Model : Storage Layer. Object Model : Access Layer + Query Execution Layer.

5 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.

6 Page Model Read/Write Model
Motivated from looking at the way data page are accessed at the storage layer of database system. All higher-level operations on data are mapped into read/write operation on pages. Each page read/write is assumed to be an indivisible operation. Regardless of whether it takes place in a page cache in memory or on disk. 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.

7 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)

8 Page Model Semantic : interpretation of transaction steps
 : current value of x is assigned to a local variable v j  : x is the return value of function f j ex)

9 Page Model DEF 2.1 Partial Order DEF 2.2 Page Model Transaction
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 ( reflexivity ) 2. (a, b) ∈ R ∧ (b, a) ∈ R => a = b (antisymmetry) 3. (a, b) ∈ R ∧ (b, c) ∈ R => (a, c) ∈ R (transitivity) Total order R of A : partial order that has additional requirement (a, b ∈ A, (a, b) ∈ R or (b,a) ∈ R) DEF 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 object are ordered We wrote t = (op, <) For transaction t with step set op and partial order <.

10 Page Model In the partial ordering of transaction’s step, we disallow that a read/write operation on the same data item, or two write operation on the same data item, are unordered. Ensure unambiguous interpretation Allows a transaction to read or write the same data item more than once 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. Assumption 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 Object Model Generalization of page model
Page model is implicitly included object 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 Object Model Database system internal layers
Retrieve all record from a database of person who live in Austin 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 Object Model Business object Withdraws money from one bank account x
Deposits money in another account y 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 x, y  Bank accounts object h  History object (queue) for cash flow information x, y  Records on pages ^ ^

14 Object Model DEF 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 node, along with a partial order “<“ on the leaf node such that for all leaf node operations p and q of the for 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 Tree with the invoked operations as nodes

16 Road Map of the Book 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


Download ppt "Computational Models Database Lab. 120100213 Minji Jo."

Similar presentations


Ads by Google