Download Now

db4o :: Java & .NET Object Database :: Object Source Persistence, Object Database :: Features and Benefits

db4o is the open source object database that enables Java and .NET developers to slash development time and costs and achieve unprecedented levels of performance. The unique design of db4o's native object database engine makes it the ideal choice to be embedded in equipment and devices, in packaged software running on mobile or desktop platforms, or in real-time control systems - in short: in all Java and .NET environments, where no DBA is present.

Key Features Key Benefits
  • The One-Line-of-Code-Database
    • One line of code stores any object
    • Class model = database schema
    • Smooth production process
  • Embeddable
    • Zero administration
    • Automatic schema versioning
    • 1 MB footprint
  • Multiple platform support
    • Native to Java and .NET
    • Embedded CPU, mobile device, desktop and server platforms
    • Runs cross-platform
  • Brings more OO to the database
    • Object-oriented replication (dRS)
    • Native Queries
    • ObjectManager tool
    • LINQ support
  • 40% faster to market with your application
  • Full ACID transactional capabilities
  • Slashes 90% of cost to develop persistence
  • Runs up to 55x faster than conventional systems
  • Deployable in large volumes without local administration
  • Build lean and truly object-oriented software
  • Build distributed, fully synchronized data architectures
  • Fewer errors, better refactorability and software longevity

The One-Line-of-Code Database Saves You Time

It's as easy as this: Drop db4o's single programming library (.jar /.dll) into your development environment, open a database file and store any object - no matter how complex - with just one line of code, e.g., in Java:

  public void store(Car car){
    ObjectContainer db =
       Db4o.openFile("car.yap");
    db.store(car);
    db.commit();
    db.close();
  }

This unmatched ease-of-use results in drastically reduced development time.

Eliminate the entire work of designing, implementing and maintaining the database schema, because the class model is the database schema. Eliminate the need to manage any database-related overhead such as strings, XML, or other non-native files that need post- or pre-compiling or enhancers and consequently slow down your production process.

You are up and running in less than 5 minutes, supported by the acclaimed interactive Formula-1 Tutorial.

You save a lot of time when writing your software.

You save even more time whenever you need to change your software, e.g. refactoring code, adding new features, or reusing software components. Changing your object model, for instance, is not only extremely transparent, but also fool-proof because the native and non-intrusive nature of db4o lets the development environment do all the work for you! You need no debuggers, no build process, and you don't need to worry about existing deployments, because db4o takes care of any object modifications for your entire installed base. Changing software becomes less of a nightmare and more of a pleasure, making you ever more productive.

In essence, db4o makes it as easy to persist objects as it is using plain serialization, but also gives you the full breadth of database functionalities such as querying, and - notably - allows for changing object models without breaking the serialization.

The Embeddable Database

db4o is designed to be embedded in clients or other software components completely invisible to the end user. Thus, db4o needs no separate installation mechanism, but comes as just one easily deployable library with a very low footprint of some 600KB. Because db4o runs in the same process as your application, you have full control over memory management and can perform speed profiling and debugging over the entire system. If your application is running, your database is running - there is no exception.

Most importantly, db4o is extremely flexible when it comes to updating an existing installed base with a changed object model. db4o always assumes the absence of a database administrator and hence lets the application seamlessly switch from the old to the new object model. Unlike any other database solution, be it relational or a non-native object database, db4o does not need any form of data model update management - a whole work package and source of errors that is completely eliminated.

Portability and Cross-Platform Deployment

Few embeddable database products run natively on so many object-oriented platforms - and none across those platforms in heterogeneous environments. db4o's capability enables you to develop applications for deployment not only on various platforms (e.g. in the PDA market) but also in heterogeneous environments: With class aliases reconciling the different naming conventions, any Java and .NET db4o instances (clients or servers) can share persisted objects without the need to deploy classes to the server.

db4o supports Java's JDK 1.1.x through 6.0 and runs on J2EE and J2SE. db4o also runs with J2ME dialects that support reflection, such as CDC, PersonalProfile, Symbian, Savaje and Zaurus. Moreover db4o is also available as an OSGi bundle.

db4o runs on all .NET platforms including .NET, the CompactFramework and Mono, supporting all managed .NET languages such as: C#, VB.NET, ASP.NET, Boo, and Managed C++. db4o also features a LINQ provider making your queries more native and effortless than ever on the .NET platform.

Partially Connected Clients and Distributed Data Architectures

While db4o's prime applications are in standalone clients, such as a smartphone or a car, most of those clients today are at least partially connected to middleware, servers or other devices. db4o therefore not only provides an embedded mode, but also a client/server-mode ready to move into the enterprise or server-side software stack.

db4o's unique object-oriented replication (dRS) functionality allows for easy synchronization of data between db4o databases, relational databases such as Oracle or MySQL, or any combination thereof. Relational databases are wrapped by the Hibernate object-relational mapper. Implementation is, again, as easy as it gets: Connect two database instances to search for updated objects and synchronize objects with just one line of code. Parent-child relationships in classes provide a natural description of what makes up an object and what needs to be replicated along with a parent object. Also, you can store business logic necessary to resolve synchronization conflicts within the object (in the data, not the application layer) to create "smart objects" that can move around freely in distributed architectures, such as between modules written by different teams. These are also more tolerant when it comes to refactoring (more on dRS here).

All in all, db4o's diverse execution modes and its unique object-oriented replication functionality allow the highly powerful and efficient distributed data architectures typically required for service-oriented computing.

Native Queries

Since db4o Version 5, db4objects has been the first to implement Native Queries (NQ). Native Queries lead the industry trend to provide database querying with programming language semantics, validated by Microsoft's LINQ (.NET Language Integrated Queries) project.

Rather than using string-based APIs (such as SQL, OQL, JDOQL, EJBQL, and SODA), NQs allow developers to simply use the programming language itself (e.g., Java, C#, or VB.NET) to access the database and thus benefitting from compile-time type checking, the full expressive power of OO-languages, and the great convenience of advanced development environments.

For example, compare this Native Query in C# for .NET 2.0:

  IList<Student> students = db.Query<Student>(delegate(Student student){
    return student.Age < 20
      && student.Grade == gradeA;
  });

... or in Java:

  List<Student> students = database.query<Student>(new Predicate(){
    public boolean match(Student student){
      return student.getAge() < 20
        && student.getGrade().equals(gradeA);}})

... with the same in JDOQL:

  String param = "String gradeParam"
  String filter = "age < 20 & grade == gradeParam";
  Query q = persistenceManager.createQuery(Student.class, filter);
  q.declareParameters(param);
  Collection students = (Collection)q.execute(gradeA);

As you can see, Native Queries eliminate all strings from queries - they are 100% type-safe, 100% refactorable, and 100% object-oriented. For instance, in the above, JDOQL would accept your code, even if the "age" field was a date type and the type mismatch error would not be thrown until you execute the code. With the help of your IDE, NQs are entirely type-safe and would not accept type-mismatched queries in the first place.

As a result, data access with NQs makes software developers much more productive. It also facilitates frequent refactorings and/or changes and customization of object models. With just one change, for instance, you could successfully rename the "age" field in the above NQ into "_age". Try this with JDOQL (or any other string-based API) and the application would break.

The same concept applies to our LINQ provider which allows you to smoothly move between Relational db and db4o, for a truly complimentary combination. db4o allows using all the constructs of Microsoft’s Language Integrated Queries (LINQ). db4o LINQ syntax is provided for .NET developers and aimed to make writing db4o code even more native and effortless. Queries like this:

  IEnumerable<Pilot> result =
        from Pilot p in container
        where p.Name.StartsWith("Test") && p.Points > 2
        select p;


are perfectly valid within db4o.

Integration, Other APIs, ObjectManager, and Reporting

Two additional object-oriented query APIs, Query by Example and S.O.D.A., offer additional query options for specific use cases and/or legacy applications:

With Query by Example (QbE), you have an extremely easy-to-use API that employs existing setters to create query templates, e.g.:

  Car car = new Car();
  car.setName("Ferrari");
  List cars = db.get(car);

S.O.D.A. is a powerful node-based query API for dynamic query creation at runtime. It allows triggering any custom code on servers, thereby reducing bandwidth and speeding query execution.

Export to XML is easily achieved now with any library that writes Java objects to XML, such as Xstream. It allows integrating db4o into message-oriented architectures.

db4o does not provide an SQL interface because developers have no need to directly access their objects with a non-native API. However, for compatibility purposes, developers can replicate their objects by means of the db4o Replication System (dRS) into any relational database for further data processing.

ObjectManager Enterprise (OME) is a new tool exclusively for dDN Enterprise subscribers. OME comes as a plug in for Visual Studio or Eclipse or as a standalone.

OME is designed for db4o database browsing and maintenance and includes:

  • Classes view: flat and hierarchical filtered structure of persistent classes
  • Single class detailed view: fields, base- and subclasses and interfaces, statistics (number of objects in the database)
  • Single object detailed tree view (field objects as nodes)
  • Query Builder: allows to create complex queries using object fields on different levels of the hierarchy joined together with logical operators
  • Multiple objects list view as a query result
  • History view: recent queries or objects
  • Favorites view: user-defined frequently used queries or objects (coming)
  • Access to the XtremeConnect session scheduler and the dDN support case tracker

Several third-parties provide tools for object-oriented reporting (see datasheet).

ObjectManager Enterprise

ObjectManager Enterprise Login

The db4o ObjectManager Enterprise can be used to query and browse db4o database files from Eclipse, VisualStudio or standalone.

Further Information