db4o open source object database
db4o :: Product News Blog

Syndicate This

Sunday, May 14, 2006

We have moved!

db4o Product related news now on:
http://developer.db4o.com/blogs/product_news/

Saturday, April 29, 2006

db4o 5.3 development release

db4o version 5.3 has been made available on the db4o downloadcenter page.

The new alias feature to translate classes, namespaces and package names between application and database opens a wide range of usecases. Here are some examples:

// Creating an alias for a single class
Db4o.configure().addAlias(
new TypeAlias("com.f1.Pilot", "com.f1.Driver"));

// Accessing a .NET assembly from a Java package
Db4o.configure().addAlias(
new WildcardAlias(
"com.f1.*, F1RaceAssembly",
"com.f1.*"));

// Using a different local .NET assembly
Db4o.Configure().AddAlias(
new WildcardAlias(
"com.f1.*, F1RaceAssembly",
"com.f1.*, RaceClient"));

// Mapping a Java package onto another
Db4o.configure().addAlias(
new WildcardAlias(
"com.f1.*",
"com.f1.client*"));


Aliases underline db4o's capability to access the same database concurrently from any platform, Java or .NET.

Aliases also are very helpful for the use of db4o with ASP.NET projects in Microsoft Visual Studio 2005 express edition, since this IDE dynamically generates different package names for different compilations of the same application. By asking the system for the current package name on the start of the application and creating an alias accordingly, db4o can now be perfectly used with VS express edition.


Class aliases have been used to enhance ObjectManager 1.8 (available here), the db4o database browser. ObjectManager is in fact a Java application to browse .NET databases, a nice demonstration of crossplatform capabilities. ObjectManager 1.8 comes with new functionality to delete objects.


Quite a lot of work for version db4o 5.3 has gone into improving Compactframework 2.0 compatibility. By providing a compile-time enhancement tool (db4o-5.3/bin/CFNativeQueriesEnabler.exe) we have managed to overcome a limitation with reflection on CompactFramework. Native Query syntax can now be used on CompactFramework 2.0 exactly in the same way as for .NET 2.0. The enhancer tool is documented in chapter 22 of the tutorial, with a nice explanation on how enhancing can be seamlessly integrated with the build process of of Visual Studio 2005. Support for generics on CompactFramework 2.0 has also been considerably improved.


While working on dRS (db4o Replication System, also available here) we came up with an idea, how UUIDs and version numbers can also be used to provide information about the creation time and the modification time of an object. We have changed the generation of both number circles accordingly. Here is some pseudocode that explains how to get at the time values. In a future release we will make access a little more convenient.

// To turn generation of UUIDs and version numbers on.
Db4o.configure().generateUUIDs()
Db4o.configure().generateVersionNumbers()

// How to get at time values.
ObjectInfo objectInfo = objectContainer.ext().getObjectInfo(object);
long uuidLongPart = objectInfo.getUUID().getLongPart();
long versionNumber = objectInfo.getVersion();
long creationTimeInMillis =
TimeStampIdGenerator.idToMilliseconds(uuidLongPart);
long modificationTimeInMillis =
TimeStampIdGenerator.idToMilliseconds(versionNumber);

// Converting Java milliseconds to .NET ticks
long creationTimeInDotnetTicks =
new j4o.util.Date(creationTimeInMillis).GetTicks();



Enjoy the new version!

Development for version 5.4 is already well under way. There will be a strong focus on performance enhancements. Recent refactorings are already visible in our CVS.

Friday, February 24, 2006

db4o 5.2 production release

db4o 5.2 is now available as a production release.

- We have been working hard on optimizing insert, delete and commit performance. Our results for running multiple db4o versions against the PolePosition benchmark show excellent improvements. db4o 5.2 is considerably faster than db4o 4.6, even if FlushFileBuffers is turned on with our new release and turned off with the old one.

- Quite a lot of work has also been put into the Native Query Optimization Processor to allow it to optimize many more cases. Probably the most commonly used ones are String method calls. Queries like the following will now run optimized:


C#
--------
IList <Employee> employees = db.Query <Employee>(delegate(Employee e)
{
return e.FirstName.StartsWith("P");
});


Java
--------
List <Employee> employees = db.query(new Predicate <Employee>(){
public boolean match(Employee e){
return e.getFirstName().startsWith("P");
}
});

- We have also made a new sorting interface available both for Native Queries and for SODA queries. Again we have tried to follow the standards that the programming languages provide as closely as possible. Sorting simply requires passing a standard java.util.Comparator (Java) / System.Collections.IComparer (.NET).

- Our Mono version now comes with PascalCase calling conventions. A legacy version with camelCase method names is also provided with the Mono download.

- The tutorial is provided in two new languages: Visual Basic and Japanese.

Enjoy the new version!

Our near-term roadmap available here still is valid. There will continue to be a strong focus on further performance improvements, a lot more than you would expect from the "Fast Collections" bullet point on the list.

Thursday, February 02, 2006

db4o 5.1 dev with full Native Query support for Mono

Our 5.1 development build available in the download center area of our website finally also fully enables Native Queries on Mono.

It took us quite long to get this out because our code stumbled across a bug in the Mono compiler: It did not understand the acyclic Visitor pattern that we used in the Native Query optimizer. After changing the pattern everything works fine now and all regression tests pass.

Enjoy Native Queries!

Wednesday, February 01, 2006

db4o Replication System (dRS) powered by Hibernate

A first development release of db4objects' new db4o Replication System (dRS) is available for download.

dRS provides bi-directional object synchronization functionality for db4o object persistence systems and Hibernate relational persistence systems.

dRS brings the best of both worlds together:
Your enterprise data can stay where it is, in your existing relational database. On your client systems you can benefit from the ease of development, the performance and the low ressource consumption of the db4o object database. Data and objects can stay perfectly in sync, whether you use db4o as a peformance cache, for partially- or for fully disconnected systems.

Here is what the dRS system does exactly:

  • dRS generates Unique Universal Identifiers (UUIDs) and version numbers for all stored objects.

  • Since each stored object has a unique identity, objects can be replicated in multiple steps over multiple disconnected or partially connected persistence systems.

  • Version numbers allow querying for and replicating changed objects only.

  • The system automatically traverses changed members of replicated objects and replicates these changed members as well.

  • Conflicts (objects changed in both peers of a replication session) can be resolved using object-oriented conflict handlers and business rules of persistent classes.



Further information can be found on the dRS product sheet.

dRS is free under the GPL and available under a commercial license as well.

Please download, try it out and tell us what you think.

Tuesday, November 15, 2005

db4o 5.0 production release

The db4objects team is proud to announce the release of db4o 5.0 to production with a great innovation: Native Queries.

The benefits of using Native Queries:

- 100% compile time checked
Since all query code is written in your programming language (not in strings) all syntax errors will be detected by the compiler.

- 100% object-oriented
Native Queries allow you to use the full power of your programming language in queries. All constructs are legal: method calls, local variables, overriding, overloading. You can operate against the public facade of your classes (getters, properties) or against the private implementation (fields), as you like.

- 100% refactorable
Since queries are now an integral part of your application, you can refactor all queries automatically with your development environment.

- More Productive
Your IDE will help you to write Native Query expressions by providing autocompletion.

- Fast
Under the hood db4o analyzes native query bytecode / IL code and converts it to run against database indexes.


You are invited to evaluate Native Queries against your requirements and experience the benefits.

Here is another Native Query example as an appetizer. It demonstrates two features:
(1) Queries allow multiple exit points. I use a guard pattern here.
(2) You can use local mutable variables in a query.


C#
-------

IList <Product> products = db.Query <Product>(delegate(Product product){
if (product.License == Licenses.GPL){
return true;
}
float price = product.Price;
Vendor vendor = product.Vendor;
return price > 10
&& price < 100
&& vendor.Name.StartsWith("d")
&& vendor.Country == Countries.USA;
});


Java
-------
List <Product> products = db.query(new Predicate <Product>(){
public boolean match(Product product){
if(product.getLicense() == Licenses.GPL){
return true;
}
Float price = product.getPrice();
Vendor vendor = product.getVendor();
return price > 10
&& price < 100
&& vendor.getName().startsWith("d")
&& vendor.getCountry() == Countries.USA;
}
});



When you write Native Queries, don't forget that your IDE is very likely to provide features to fully automate all the typing work of generating the enclosing frame of a Native Query for you. In Eclipse you could set up a code template. In VS.NET a Macro can do the job just as good.


Additional noteworthy features in the 5.0 release:

- The index processor has taken a big peformance step forward for ranges.
- db4o uses a new freespace management system by default, based on the internal indexing algorithm. Index-based freespace management may be somewhat slower than the old RAM-based-system, but it guarantees ACID behaviour on systems that are frequently turned off (handhelds). If you want to use the old system, you can of course configure db4o to use it by calling Db4o.configure().freespace().useRamSystem().


Further notes:

- We know that there are still issues with persisting .NET 2.0 generic collections, we are currently solving them.
- We did not manage to include optimized Native Queries with 2.0 delegate syntax for CompactFramework 2.0. We will soon provide a patch with a solution.
- Mono is slightly lagging behind our other releases. We are in contact with the Mono team to solve the remaining problems.
- The .NET 2.0 version is compiled against the .NET framework that comes with VS.NET 2005 final. You can easily compile the sources yourself, if you want to work with earlier .NET framework versions.

Monday, October 31, 2005

db4o 5.0 dev build featuring optimized native queries

A first development build of db4o 5.0 is available for download. It includes a first optimized implementation of native queries.

Native queries provide the simplest syntax possible to express code that is to be run against all instances of a class (an extent) from within a query. db4o analyzes .NET IL code or Java byte code of native query expressions and runs queries with maximum performance against indexes and without instantiating the actual objects of the extent.

The following syntax example of a native query demonstrates type safety and calling properties / getter methods:

C#
------------
IList <Cat> cats = db.Query <Cat> (delegate (Cat cat) {
return cat.Father.Father.FirstName == "Occam"
|| cat.Father.FirstName == "Occam"
&& cat.Age > 3;
});



Java
------------
List <Cat> cats = db.query(new Predicate <Cat>() {
public boolean match(Cat cat) {
return cat.getFather().getFather().getFirstName().equals("Occam")
|| cat.getFather().getFirstName().equals("Occam")
&& cat.getAge() > 3;
}
});



At this point in time the db4o native query optimization processor already "understands" most queries that could have also been expressed with the SODA API, but it is not perfect yet.

It will be an ongoing task to teach the native query optimizer more and more C# and Java syntax so it will eventually provide the maximum performance possible for any querying code.

Our first optimizer implementations employ the third-party libraries Cecil (.NET) and BLOAT (Java). Many thanks to the maintainers!

Powered by Blogger