Isn't it fun that you don't have to write any "INNER JOIN" SQL syntax in db4o whenever you want to describe that a set of objects is linked from another object? Instead db4o allows you to work with collections and to simply traverse the graph of objects contained in the collection.

The multiple different collection types that come with Java/.NET have different performance characteristics. Some may allow faster inserts. Some may allow faster access to elements.

Two recommendations to be able to tune your application with the right collection as it evolves:

(1) Use interface declararations only when you add references to collection objects to your application classes.

Good:
class Company{
  Collection employees;
}

Bad:
class Company{
  ArrayList employees;
}


(2) Use a single collection factory in one place in your code so you can easily exchange the concrete collection implementation to try out alternatives:

company.employees = CollectionFactory.newCollection();

CollectionFactory would be a class that you would write and where you could simply exchange one line of code to create a db4o ArrayList4 with Transparent Persistence support instead of a normal ArrayList.

db4o comes with some built-in collections that will work better for specific usescases. In the latest build we have added a new species to this list: BigSet.

This is a highly specialized class to hold large and huge sets of references to other first class objects. Internally the implementation is based on the same fast BTrees that are also in use for db4o class and field indexes.

Our benchmark results from comparing BigSet to a normal JDK ArrayList are very promising: Especially when you make small changes to huge sets, the advantage can be multiple orders of magnitude.

For now we have only completed a BigSet for embedded use in single user mode. A Client/Server implementation with a BigSet proxy is being thought about.

BigSet is very easy to use:
CollectionFactory.forObjectContainer(objectContainer).newBigSet();

Please let us know how fast it works for you! Enjoy!