Xflat

A simple but powerful embedded XML object DB.

Getting Started
Examples
Javadoc

This project is maintained by Gordon Burgett

XFlat

A lightweight embedded no-sql object DB persisting objects to flat XML files. XFlat is a completely free alternative to db4o for an embedded object DB.


So you've got a Java application, and need to persist some data. Cool. Just write it to a file.

Well, my data's in a bunch of POJOs.

Ok that's easy, just serialize it to XML and drop it into a DOM, then write it to a file.

Alright, that sounds easy enough. But wait a second, I need random access to my saved POJOs.

Well thats a bit harder, but you could write a class to inspect the DOM and pull out the data you need.

But I also need to query my POJOs by arbitrary criteria.

Looks like you need a database. Take a look at db4o or Sql Lite

Well I'd prefer not to have to deal with Sql, and I may need to inspect or transform my data as XML.

Oh, well in that case XFlat is for you!


XFlat is a single lightweight JAR that persists XML DOM Elements to flat files. It presents as a CRUD interface to XML Elements that can be queried by ID or arbitrary XPath expressions. Because it is stored in flat files, XFlat is not relational and is schemaless. XFlat is currently effective for table sizes up to the dozens of KB. Future versions will contain engines that are effective up to the hundreds of MB, using memory-mapped files.

Features:

Future features:

Add via maven:
<dependency>
  <groupId>org.xflatdb</groupId>
  <artifactId>xflat</artifactId>
  <version>0.9</version>
  <classifier>sources</classifier>
</dependency>
View on Maven Central

Required dependencies:

Optional dependencies:

Click Here for examples