Product Reviews

db4Objects Provides Object-Oriented Local Storage

If you're willing to make the mental shift to storing objects instead of data, db4Objects may be the right solution for a distributable local database.

In the July issue of Visual Studio Magazine we reviewed VistaDB, a database engine written entirely in .NET managed code that is tuned for distributed applications needing to store data locally. Now Visual Studio Magazine Tools Editor Peter Vogel looks at db4Objects, a free database engine that offers a unique spin on local data storage.

You want something different in client-side storage for distributed applications? How about object oriented storage with Versant Corp.'s db4Objects (db4o)? In a client, you often just retrieve objects from your server, manipulate them (or create new ones), and return objects to the server. Rather than go through some ORM layer to save data at the client, db4o allows you to just save the object. You don't even have to predefine the tables in your database before saving.

With db4o, the cost involved in saving an object is practically nothing. I retrieved 1,000 rows from a relational database, created objects to hold the rows' values, and stored the results in a db4o database. The time required to retrieve and store the objects was almost identical with the time required to just retrieve the rows. Retrieving the objects through db4o was the same as retrieving the original rows from the relational database. For a client-side database this is more than "good enough" performance.

Deploying db4o is easy since the engine is just another DLL referenced by your application. Integration with Visual Studio is also good -- db4o includes the Object Manager utility (available from the Tools menu) that provides the functionality that you would normally get from Server Explorer. And the price is definitely right: db4o is free.

[Click on image for larger view.]
Figure 1.This Object Manager utility included with db4o allows you to query and update your db4o database.

However, db4o requires a very different syntax for working with data than your relational database, so you can't swap client-side code for server-side code. But, as long as your client code remains on the client, that isn't a problem. Also, lot of the functionality that you take for granted in a relational database environment isn't present in db4o (stored procedures, for instance). Nor is querying as flexible as in SQL (or as fast when multiple classes are involved). However, for local storage those features may not be essential.

If you're willing to make the paradigm shift to thinking of your client as working with objects, even as your server works with data, then db4o is worth investigating as a powerful (and cheap) way to provide local storage in a distributed environment.


Versant Corporation
Phone: 650-232-2400
Price: Free
Quick Facts: A database engine for storing and retrieving .NET objects
Pros: Simple deployment, unique object-oriented approach
Cons: No support for stored procedures, inflexible querying

About the Author

Peter Vogel is a system architect and principal in PH&V Information Services. PH&V provides full-stack consulting from UX design through object modeling to database design. Peter tweets about his VSM columns with the hashtag #vogelarticles. His blog posts on user experience design can be found at

comments powered by Disqus


  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube