clobber

2022-02-20

Library for transaction-oriented data bases.

Upstream URL

github.com/robert-strandh/Clobber

Author

Robert Strandh <robert.strandh@gmail.com>

License

FreeBSD, see file LICENSE.text
README

Clobber

Clobber is an alternative to so called "object prevalence", and in particular to cl-prevalence.

Clobber is both simpler, more flexible, and more robust than systems based on object prevalence.

It is simpler because we do not take any snapshots at all. Other systems typically use a combination of transaction logs and snapshots. Clobber uses only a transaction log which is always read into an empty system.

It is more flexible because the system itself does not define the format of a transaction. Client code can save transactions as Lisp lists, as instances of standard-object, or anything else that can be serialized. It is also more flexible because transactions can contain any object that can be serialized, including model objects. With this method, client code does not need to manipulate "manually created pointers" such as social security numbers, account numbers, membership numbers, etc. whenever it needs to execute a transaction. Instead it can use the model objects themselves such as people, accounts, automobiles and whatnot.

It is more robust because serialization of instances of (subclasses of) standard-object is not accomplished based on slots. Slots are considered implementation details. In traditional systems, whenever the model evolves, the serialization might no longer be valid. In contrast, Clobber serializes instances of standard-object as a list of pairs, each one consisting of an initarg and a value. These pairs can be handled by client code in any way it sees fit. They can be handled by an :initarg, by initialize-instance, or they can be ignored. The downside of the Clobber method is that client code must specify these pairs in the form of an initarg and the name of an accessor function to be called to obtain the value used for the initarg. This inconvenience is however relatively minor, especially considering the additional robustness it buys in terms of less sensitivity to changes in the model classes.

At the heart of Clobber is a mechanism for serializing objects that preserves object identity, much like the reader macros #= and ##, except that Clobber detects sharing within the entire transaction log, not only within a single transaction. This mechanism is what makes it possible for client code to put any old object in a transaction, while making sure that sharing is preserved.

Clobber is in the public domain in countries where it is possible to place works in the public domain explicitly. In other countries, we will distribute Clobber according to a license that lets the user do whatever he or she pleases with the code.

Send comments to robert.strandh@gmail.com

A manual might be written one day.

Running the demo

(ql:quickload :clobber)
(in-package :clobber-demo)
(start "/path/to/new/file")
(do-things-1)

Dependencies (0)

    Dependents (0)

      • GitHub
      • Quicklisp