Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Efficient persistent data structures for relational database

I'm looking for material on persistent data structures that can be used to implement a relational model.

Persistence in the meaning of immutable data structures.

Anyone know of some good resources, books, papers and such?

(I already have the book Purely Functional Data Structures, which is a good example of what I'm looking for.)

like image 303
John Nilsson Avatar asked Nov 19 '08 21:11

John Nilsson


People also ask

Which data structure is used for relational database?

Relational databases are based on the relational model, an intuitive, straightforward way of representing data in tables. In a relational database, each row in the table is a record with a unique ID called the key.

Which data structure is best suited for DBMS?

An important data structure for cost estimation is the histogram, which is used by the DBMS to approximate the distribution of values for a given attribute.

What is persistent data in database?

Persistent data in the field of data processing denotes information that is infrequently accessed and not likely to be modified. Static data is information, for example a record, that does not change and may be intended to be permanent. It may have previously been categorized as persistent or dynamic.

What is persistent data structure with example?

A data structure is said to be persistent if it is capable to maintaining its previous updates as separate versions and each version can be accessed and updated accordingly. It makes the data structure immutable and thread safe. For example, String class object in Java is immutable.


2 Answers

I have implemented such a data structure for BergDB (http://bergdb.com/) - a database with a data model that is a persistent data structure.

I would suggest reading

http://www.cs.cmu.edu/~sleator/papers/Persistence.htm

It is the original work on how to create a persistant data structure based on an ordinary (ephemeral) one.

like image 91
Frans Lundberg Avatar answered Oct 26 '22 13:10

Frans Lundberg


It is straightforward to modify the ubiquitous B-tree to be persistent. Simply always alloctate a new node whenever a node is modified, and return the new node to the recursive caller, who will insert it at that level by allocating a new node, etc. Ultimate the new root node is returned. No more than O(log N) nodes are allocated per operation.

This is the technique used in functional languages to implement, e.g, 2-3 trees.

like image 21
Doug Currie Avatar answered Oct 26 '22 14:10

Doug Currie