dagblog.
← Archive

db4o — A database and a persistence framework in one


I was recently talking to Arny about introducing a persistence framework in
one of our projects. We were using Hibernate on another project, and I was enthusiastic about what it could do. Unfortunately, two things stood in the way of using it here. Our existing relational model was tied to the domain model, and Hibernate was relatively complex. That put an end to the idea of ORM and a persistence framework, and we left it there.

All sorts of tools now carry the word “embedded.” I’d already worked with Jetty as an embedded servlet container and with embedded databases such as Hypersonic and SQLite. When I came across Jim Paterson’s Simple Object Persistence with the db4o Object Database, I had no idea a persistence framework and database could be embedded together. db4Objects looks really interesting.

Interesting features from the article

  • No impedance mismatch–objects are stored as they are
  • Automatic management of the database schema
  • No changes to classes to make them storable
  • Seamless Java (or .NET) language binding
  • Automated data bindings
  • Installation by adding a single 250Kb library file (Java jar or .NET DLL)
  • A single database file
  • Automatic schema versioning
  • Query-By-Example
  • S.O.D.A. (Simple Object Database Access),an open source query API

If you need a simple database with a persistence framework, db4Objects is an interesting option. You’ll want to weigh the pros and cons of an embedded solution, but db4Objects is worth a look at least.

Medium version

Related articles

Related CZ Podcast episodes