db4o open source object database
db4o :: .NET Product News Blog

Syndicate This

Sunday, May 14, 2006

We have moved!


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:

IList <Employee> employees = db.Query <Employee>(delegate(Employee e)
{
return e.FirstName.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 System.Collections.IComparer.

- 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.

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 (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 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.

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;
});


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. How about creating a macro in VS.NET to allow inserting the frame of a Native Query with just one keystroke?


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().Creespace().UseRamSystem().
- db4o for .NET is now primarily supplied with PascalCase calling conventions (with uppercase method names). DLLs with camelCase (lowercase) calling conventions are supplied for existing users. They can be found in the /legacy/ subfolder of the installation.


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!

Monday, October 03, 2005

db4o 4.6 production release and 5.0 M2 available

Version 4.6 is now production-ready. Download it now to take advantage of some of these new features:

  • ObjectSet (the object returned by db4o queries) now implements System.Collections.IListThis makes result processing much nicer by using a For-Each loop.
  • The query processor was considerably tuned. Most users should see an improvement in query execution speed when using indexing and deep object graphs.

On the bleeding edge, our engineers have been hard at work on the 5.0 Milestone 2 release. If you are using the M1 release, or are using .NET 2.0, please upgrade as soon as possible. Many bugs were fixed and performance is much-improved.


Wednesday, August 03, 2005

db4o 4.6 dev and 5.0 M1 - as native as possible

Our 4.6 development release and our 5.0 M1 sneak preview are now available on the download center page of the db4o website.

Both releases show one major goal of db4o very well:
We want db4o to be as native as possible, perfectly object-oriented, an ideal match for the concepts of the programming language that you are using.

With db4o you do not need to work against proprietary features that we produce. All concepts that db4o supplies for working against a database are concepts of your Java/C# programming language and you are very likely to be using them already:
(1) Class schemas are good persistence schemas.
(2) Collections work great as Query resultsets.
(3) Java and C# are ideal languages to express queries.

db4o has been very good at (1) for a long time, here is how the latest builds and upcoming releases improve on (2) and (3):

(2) The ObjectSet returned by a query now extends java.util.List, java.util.Iterator and System.Collections.IList.

Extending these interfaces, ObjectSet works a lot better as a source for UI controls. You can now use "for each" and you do not even need to refer to the ObjectSet interface from your code, the collections of your programming language will work just as well:

IList cars = query.Execute();
foreach (Car car in cars){
car.Drive();
}


(3) db4o supplies native queries in version 5.0.

From a user perspective the concept is straightforward:
db4o behaves as if it would call one single callback method for all stored instances of a class. You implement the callback method in your code and return true, if you want a specific object to be included in the query resultset or false, if the object does not match the criteria that you expect. Here is a simple example:

IList<cat> cats = objectContainer.Query<cat>(delegate (Cat cat) {
return cat.Name.Equals("Occam")
cat.Name.Equals("Zora");
});


Native queries have the potential to boost your productivity, because they:
- are 100% typesafe
- are 100% compile-time checked
- are 100% refactorable
- allow any complex method call
- obey OO principles
- do not break encapsulation

Native queries are perfect Java/C#, you do not have to learn another query language or a special query API. They even work against plain collections, without the presence of a database.

The db4o 5.0 sneak preview already provides usable native queries but they do not execute very fast yet, since db4o will indeed instantiate every stored object.

For the 5.0 final release we are working on an optimizer that will "understand" the code that you place in the callback method, to operate against database indexes where this is possible, to provide fast query execution, exactly like it is currently available with S.O.D.A. and query-by-example queries.

We will soon publish more information about native queries since we believe that they deserve to become an IT standard.

Powered by Blogger