Presentation is loading. Please wait.

Presentation is loading. Please wait.

ObjectStore Martin Wasiak. ObjectStore Overview Object-oriented database system Can use normal C++ code to access tuples Easily add persistence to existing.

Similar presentations


Presentation on theme: "ObjectStore Martin Wasiak. ObjectStore Overview Object-oriented database system Can use normal C++ code to access tuples Easily add persistence to existing."— Presentation transcript:

1 ObjectStore Martin Wasiak

2 ObjectStore Overview Object-oriented database system Can use normal C++ code to access tuples Easily add persistence to existing applications Critical operation: retrieving data from a tuple must be as fast as possible

3 Why Object-oriented? Needs for CAD, ECAD and some other engineering applications are different from traditional database systems. These applications need to store large amounts of data that are inefficient to retrieve using traditional relational database systems.

4 CAD & CAM Applications Store data objects that are connected to one another forming complicated networks. Each object represents a part that contains some attributes and is also connected to another part (object).

5 What to Optimize? Most CAD apps have to traverse a list of those objects such as a list of vertices in a 3-D CAD program. Another example: traversing a network of objects representing a circuit and carrying out computation along the way.

6 Bottlenecks! Example: SELECT p1.weight, p2.weight, p3.weight FROM Pipes p1, Pipes p2, Pipes p3 WHERE p1.left_pipe_id=p2.right_pipe_id AND p2.left_pipe_id=p3.right_pipe_id AND p1.pipe_id=5 AND p1.contents=“Water” Inefficient if we want to find the total weight of our pipeline composed of thousands of parts.

7 More Bottlenecks… Our pipeline can be thought of a long linked list, and so doing joins on it is simply inefficient. In C++ we can write a simple loop to traverse a list or a tree type structure with many pointers. So instead of a join we simply dereference a pointer!

8 Note About Pointers Pointers when stored on disk point to actual memory addresses, not some other logical pointers within the file. This means when an object is paged into memory, ObjectStore tries to fit it into the memory address that it was loaded in last.

9 Dereferencing Pointers ObjectStore sets page permission to “no access” if a record is not a memory. Client tries to access the page it has no access to. Hardware detects an access violation and reports memory fault to ObjectStore. ObjectStore loads the record into memory and sets the page permission to read-only. Client tries to dereference the record and succeeds.

10 More Dereferencing What if DB is bigger than VM pool? Dynamically assign address space to db. What if address of a record in db is already in use? Tag table keeps track of all objects in the database. Used to relocated pointers.

11 Client Caching Client side caching is used to eliminate the need to page over network and speed up performance. Server keeps track of all objects present in client caches. What if a client tries to modify an object that exists in another client’s cache? Callback message is sent to the client to check whether the object is locked.

12 Defining Relations Relations are defined using pointers. Pointers are kept in both directions to facilitate updates.

13 Associative Queries Query against all_employees: os_Set & overpaid_employees = all_employees [: salary >= 100,000 :]; Query against employees of dept. d: d->employees [: salary >=100000 :]; Nested queries: all_employees [: dept->employees [: name == ‘Fred’ :] :];

14 Versions ObjectStore supports version control. Allows teams to check out read-only and read-write objects for extended period of time. Also called “long transaction.” Example: A new CPU can have people working on the ALU while others work on LSU (load/store unit) at the same time.

15 Performance Relational database schemas are normalized and queries usually involve joins of different tables. ObjectStore queries generally involve embedded collections or paths through objects. In addition, indexes can be created over those paths. The problem ends up being of how to traverse a linked list as fast as possible!

16 Warm and Cold Cache Results Cold cache is an “empty” cache. Warm cache is… non-empty…

17 QuickStore (Part 2) Similar to ObjectStore. Both try to load objects into same memory space since as before since the pointers on disk reflect the actual memory pages. Few differences. QS implements a buffer manager system based on simplified version of clock.

18 More QuickStore Also built using C++. Storage provided by EXODUS storage manager (EMS). In the paper QS is compared to E and QS-B. E uses software to emulate hardware paging. QS-B uses bitmaps to keep track of pointers which takes space.

19 Depth-first Traversal Test Cold times on small database of an object built with components with each component containing atomic parts. t1: depth first traversal including atomic parts. t6: same as t1, but excluding atomic parts.

20 Conclusion OS and QS use virtual memory hardware to facilitate loading of objects from disk to memory. VERY efficient for CAD/CAM applications which rely heavily on traversals of complicated networks of objects. ObjectStore and QuickStore add persistence to C++ programs.


Download ppt "ObjectStore Martin Wasiak. ObjectStore Overview Object-oriented database system Can use normal C++ code to access tuples Easily add persistence to existing."

Similar presentations


Ads by Google