Browse Prior Art Database

Efficient Logging of Transactions on Persistent Information in General and Databases in Particular

IP.com Disclosure Number: IPCOM000119076D
Original Publication Date: 1997-Nov-01
Included in the Prior Art Database: 2005-Apr-01
Document File: 4 page(s) / 187K

Publishing Venue

IBM

Related People

Arendt, J: AUTHOR [+3]

Abstract

Disclosed is a methodology to log changes to persistent information. The described methodology applies when the persistent information is small enough to fit in main memory. The main benefits of this methodology are simplicity and efficiency.

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 27% of the total text.

Efficient Logging of Transactions on Persistent Information in General
and Databases in Particular

      Disclosed is a methodology to log changes to persistent
information.  The described methodology applies when the persistent
information is small enough to fit in main memory.  The main benefits
of this methodology are simplicity and efficiency.

      Assuming that the database is initially in a consistent state,
a sequence of changes to the database that end in another consistent
state is usually called a transaction.  It is generally agreed that
transactions have four properties called Atomicity, Consistency,
Isolation, and Durability (ACID).  This methodology deals with the
first and last of those properties.  The property that a transaction
either succeeds completely (is committed) or is completely rolled
back is called Atomicity.  The property that once a transaction is
successfully committed it survives system failures is called
Durability.  Durability is generally achieved by means of recording
changes to disk.

The current methodology is based on the following two assumptions:
  1.  The database is small.  The entire contents of the database
       can reside in virtual memory (not necessarily main memory).
  2.  The underlying (Operating) System provides facilities for
       opening an existing or new file, sequentially reading from
       the file, sequentially writing to the file, forcing the file
       to persistent store, either removing a file or renaming a
       file.

      A general description is provided first, followed by a specific
preferred embodiment of this invention.

File format:

The file that contains the persistent data is made up of two parts:
  1.  The snapshot which is a streamed representation of the
       persistent data which appears at the beginning of the
       file and is either terminated by a special symbol or
       is length-encoded.
  2.  The log which is made up of a sequence of zero or more
       descriptions of operations on the persistent data.  Each
       operation is either terminated by a special symbol or is
       length encoded.  An operation is preferably a description
       of a transaction on the data.  A transaction is, among
       other things, an operation that should either occur
       completely or not occur at all (atomic).

Overall process:

      When the program starts its operations, it recovers the file
that contains the persistent data (see recovery below).  As the
program executes, all changes to the persistent data (operations) are
appended to the file in some encoding that can be used to replay the
operation.

Cleanup:

      To avoid having the file grow without bound, a cleanup routine
executes periodically based on some criteria such as log size, ratio
of log size to data size, number of operations in the log, system
activity, etc.

    ...