The ZooDB Object Database

The ZooDB Object Database

by Tilmann Zäschke, January 2015.

ZooDB (http://www.zoodb.org/) is a pure Java open source ODBMS supporting the JDO 3.0 API. It started out as a private project of an experimental ODBMS, but has by now been used in numerous university projects. It is still under development and does not support the full JDO 3.0 API, however the parts that are already implemented work well and scale nicely into the GB range.

One of the core concepts of ZooDB is it’s copy-on-write (COW) approach on the IO level. The COW approach is meant to support concurrency (currently quite basic) and avoid the need for a separate log file for crash recovery. One could say that the pages written during a COW operation serve as a kinf of ‘internal’ log file, and once a transaction is accepted, this ‘internal’ log file becomes part of the main database file without a need to write the page a second time. This sets is apart from traditional log-based databases that require data to be written twice, once to the log file and then to the actual database. Recovery in case of machine failure is fully supported by the copy-on-write approach and occurs instantaneously (no additional I/O) during the next start-up. One downside of the COW approach is an increased tendency for fragmentation, but this is often negligible in practice, even more so if solid-state drives are used. Also, COW requires slightly more disk space but this is offset by avoiding space allocation for a separate log file.

Another feature of ZooDB is that it can be used as a pure in-memory database, i.e. all I/O can be redirected to memory pages. This obviously removes persistence guarantees but improves performance for applications that only need in-memory transactions and queries.

In terms of performance, we tested ZooDB it with the db4o poleposition benchmark which it completes more than four times faster than the last official db4o (8.0 from 2011). Unfortunately db4o has been discontinued, but we aim to make ZooDB a viable alternative.

Current features include full transitive persistence with second class object, classic commit/rollback and queries. Beyond the JDO API, ZooDB supports database index management and rich schema & data evolution (partially still under development), including automatic schema creation.

ZooDB is currently licensed under GPL 3.0, but we plan migrating it to a less restrictive license, probably Apache License.

You may also like...