Chapter 1. Introduction

Trivial Persist™ was developed to provide the quickest and easiest means possible to object persistence in Java. That means no cumbersome XML files to glue things together, no SQL database at all, and use of normal Java classes for access - normal as in Set, Comparator, Iterator - rather than JDBC or a new API. As a result, a new object repository (called a Store) can be created or modified in just a few seconds.

Trivial Persist keeps all objects in memory at all times, and writes any changes through to disk upon calling a Record's save() method. It is not designed for huge databases.

Basic type checking on data fields is handled automatically. More sophisticated Record validation is easily added by the developer. Custom RecordInitializers can be created to perform tasks when new Records are created (for example, populating them with default values).

Each record is stored to disk in java.util.Properties format, allowing it to be read or edited using simple text manipulation tools. In other words, you can easily search your Store from the command line using grep, or edit records using your favorite text editor.

Record files are named in the same manner as those in qmail Maildirs. Although Trivial Persist cannot yet detect or handle changes to Record files by external processes, it is planned for the next release. The Maildir format was chosen specifically because it handles file modifications by multiple processes quite well.

This document is just a quick overview of Trivial Persist. For more detailed information, see the javadocs.