Persistence

Why persistence is important

Use cases

Kinds of objects to persist

A trusted server can provide a limited set of object types:

It is easy for this one server process to save its object graph to a store.

If the trusted server provides enough of these abstractions, we can create a description of an untrusted process (its initial environment: root directory, executable to launch, etc.) and record it in the store. We can launch a process given a reference into the store to its description.

But how do we save and restore objects implemented in other, untrusted processes?

Option 1:

Each process is responsible for saving its internal object graph to a file (using kernel system calls). Trusted server remembers list of processes and saves the inter-process object graph.

Problem: consistency. When do the subgraphs get saved? What if they are not synchronised and can't be connected up?

Option 2:

Processes go via trusted server for saving capabilities and related data. Trusted server writes out whole, consistent object graph.

Issues

Storage reclamation, garbage collection

References into the store:

References from the store to outside world:

Implementation

Strategies for saving store

Two ways to save an object graph:

Not all persistable objects need to be persisted. When an object is initially created, it will be reachable from non-persistent roots but not from persistent roots. With a write-through strategy, linking the object in and making it reachable from persistent roots should cause it to be written into the store and allocated an object ID.

When the object is dropped completely it should be removed from the store. But it may become unreachable from persistent roots while still being live (reachable from non-persistent roots). Should it be removed from the store then? Probably not, because this situation may be temporary. Note that this is similar to inodes on a filesystem that have been unlinked from the directory tree (except that there is no way to relink such inodes). If the system crashes these inodes will get freed by fsck on startup.

Identifying persistable objects

Several ways to do this:

Persistence (last edited 2007-06-19 18:29:25 by MarkSeaborn)