Db4o
Encyclopedia
db4o is an embeddable open source
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

 object database for Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

 and .NET
.NET Framework
The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

 developers. It is developed, commercially licensed and supported by Versant
Versant corporation
Versant Corporation is a publicly-traded company and a vendor of database management software. Versant products are deployed in a wide variety of industries including: Telecommunications, Defense, Life Sciences, Transportation, Finance, Online Gaming and more. Versant was founded in Fremont,...

.

db4o is written in Java
Java (programming language)
Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

 and .NET
.NET Framework
The .NET Framework is a software framework that runs primarily on Microsoft Windows. It includes a large library and supports several programming languages which allows language interoperability...

 and provides the respective APIs. db4o can run on any operating system that supports Java or .NET. db4o is offered under multiple licenses, including the GNU General Public License
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....

 (GPL), the db4o Opensource Compatibility License (dOCL), and a commercial license for use in proprietary software.

History

Object-oriented Database System
Object database
An object database is a database management system in which information is represented in the form of objects as used in object-oriented programming...

 term goes back to around 1985, though the first research developments in this area started a bit earlier in mid-1970s. The first commercial object database management systems appeared in early 1990s. They added a concept of persistence into the object-oriented languages.

The second growth wave was observed in early 2000s, when the Object Databases written completely in an Object-Oriented language
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...

 appeared on the market. db4o is one of the examples of such systems written completely in Java and C#.

db4o project was started in 2000 by Chief Architect Carl Rosenberger, and first shipped in 2001. Some 100 commercial pilot customers and community users have supported db4o from its earliest days and successfully implemented it in some mission-critical applications prior to its commercial launch in 2004 by newly-created private company Db4objects Inc.

In 2008 db4o object database business was bought by Versant corporation
Versant corporation
Versant Corporation is a publicly-traded company and a vendor of database management software. Versant products are deployed in a wide variety of industries including: Telecommunications, Defense, Life Sciences, Transportation, Finance, Online Gaming and more. Versant was founded in Fremont,...

, which is the current owner and developer of db4o.
db4o is offered to the market as an open-source bi-licensed software (commercial and GPL). Since the initial launch db4o database has gone through many changes and improvements (see #Versions) till the current production release of version 7.

Place in the database world

db4o represents an object-oriented database model
Object database
An object database is a database management system in which information is represented in the form of objects as used in object-oriented programming...

. One of its main goals is to provide an easy and native interface to persistence for object oriented programming languages. Development with db4o database does not require a separate data model
Data model
A data model in software engineering is an abstract model, that documents and organizes the business data for communication between team members and is used as a plan for developing applications, specifically how data is stored and accessed....

 creation, the application’s class model defines the structure of the data in db4o database. db4o attempts to avoid the object/relational impedance mismatch
Object-Relational impedance mismatch
The object-relational impedance mismatch is a set of conceptual and technical difficulties that are often encountered when a relational database management system is being used by a program written in an object-oriented programming language or style; particularly when objects or class definitions...

 by eliminating the relational layer from a software project. For more information see db4o features.

Developers using relational database
Relational database
A relational database is a database that conforms to relational model theory. The software used in a relational database is called a relational database management system . Colloquial use of the term "relational database" may refer to the RDBMS software, or the relational database itself...

s can also benefit from using db4o, which can be viewed as a complementary tool. The db4o-RDBMS data exchange can be implemented using db4o Replication System (dRS). dRS can also be used for migration between object (db4o) and relational (RDBMS) technologies.

As an embedded database
Embedded Database
An embedded database system is a database management system which is tightly integrated with an application software that requires access to stored data, such that the database system is “hidden” from the application’s end-user and requires little or no ongoing maintenance...

 db4o can be run in application process. It is distributed as a library (jar/dll).

One-line-of-code database

db4o contains a function to store any object with a single command:

objectContainer.store(new SomeClass);


Note that SomeClass here does not require any interface implementations, annotations or attributes added. It can be just any application class including third-party classes contained in referenced libraries.

All field objects (including collections) are saved automatically. Special cases can be handled through writing custom type handlers.

Embeddable

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 ~670kB in .NET version and around 1MB in java version.

Client-server mode

Client/server version allows db4o to communicate between client and server-side applications. db4o uses TCP/IP for client-server communication and allows to configure port number. Communication is implemented through messaging.

Due to a feature referred to as "Generic Reflection", db4o can work without implementing persistent classes on the server. However, this mode has certain limitations.

Client-server performance is dependent on the network bandwidth. The querying performance can be enhanced by using Lazy Queries.

Dynamic schema evolution

db4o supports automatic object schema evolution for the basic class model changes (field name deletion/addition). More complex class model modifications, like field name change, field type change, hierarchy move are not automated out-of-the box, but can be automated by writing small utility update program (see documentation).

This feature can be viewed as an advantage over relational model, where any change in the schema results in mostly manual code review and upgrade to match the schema changes. In most cases the code upgrade cannot be automated as the actual query language is string based (SQL) and is not recognised by IDE autocompletion and code generation tools like Intellisense.

Native Queries

Rather than using string-based APIs (such as SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....

, OQL, JDOQL, EJB QL
EJB QL
EJB QL or EJB-QL is a portable database query language for Enterprise Java Beans. It was used in Java EE applications. Compared to SQL, however, it is less complex but less powerful as well.-History:...

, and SODA), Native Queries (NQ) allow developers to simply use the programming language itself (e.g., Java, C#, or VB.NET) to access the database and thus avoid a constant, productivity-reducing context switch between programming language and data access API. Native Queries also provide type safety
Type safety
In computer science, type safety is the extent to which a programming language discourages or prevents type errors. A type error is erroneous or undesirable program behaviour caused by a discrepancy between differing data types...

, as well as remove the need to sanitize against code injection
Code injection
Code injection is the exploitation of a computer bug that is caused by processing invalid data. Code injection can be used by an attacker to introduce code into a computer program to change the course of execution. The results of a code injection attack can be disastrous...

 (see SQL Injection
SQL injection
A SQL injection is often used to attack the security of a website by inputting SQL statements in a web form to get a badly designed website in order to dump the database content to the attacker. SQL injection is a code injection technique that exploits a security vulnerability in a website's software...

).

LINQ

LINQ
LINQ
Linq is a word-based card game from Endless Games, introduced at the American International Toy Fair in 2005.Game play requires at least four players, two of whom are dealt cards with the same word, while the others receive blanks. The goal is to gain points by correctly naming the players with...

 support is fully integrated in db4o for .NET version 3.5. LINQ allows to create object-oriented queries of any complexity with the benefit of compile-time checking, IDE Intellisense integration and automated refactoring.

Due to integration with some open-source libraries db4o also allows optimized LINQ queries on Compact Framework.

LINQ can be used both against relational and object data storage, thus providing a bridge between them, which can be valuable for projects using both technologies, or for the projects migrating between the two. It can also be used as an abstraction layer, allowing to easily switch the underlying database technology.

Disadvantages

The drawbacks and difficulties faced by other Object Databases apply to Db4o as well:
Other things that work against ODBMS seem to be the lack of interoperability with a great number of tools/features that are taken for granted in the SQL world, including but not limited to industry standard connectivity, reporting tools, OLAP tools, and backup and recovery standards. Additionally, object databases lack a formal mathematical foundation, unlike the relational model, and this in turn leads to weaknesses in their query support. However, this objection is offset by the fact that some ODBMSs fully support SQL in addition to navigational access, e.g. Objectivity/SQL++, Matisse, and InterSystems CACHÉ. Effective use may require compromises to keep both paradigms in sync.


Issues specific to Db4o may include:
  • db4o data files can only be opened using the right assembly which generated it, without that binary or the original source files: the data is lost forever
  • Since the original source code/assembly is required to access the data file, any not catched null exception or other bug (even the simplest) in the assembly can potentially render the file unreadable
  • db4o linq provider doesn't support "OrderBy" clause
  • Lack of full-text indexing, poor performance on full-text search
  • The most common method of querying (native queries) is potentially very slow (O(n)).
  • Lack of text fields Indexing, text based searches can potentially be very slow
  • "There is no general query language like SQL
    SQL
    SQL is a programming language designed for managing data in relational database management systems ....

     which can be used for data analyzing or by other applications. This does not allow db4o to be very flexible in a heterogeneous environment."
  • Replication cannot be done administratively—i.e. one needs to program an application to achieve replication. "This is contrary to most RDBMS, where administrators manage servers and replication between them."
  • Deleted fields are never removed but just hidden until the next Defrag, a delicate and potentially dangerous operation which can often lead to massive data losses
  • There is no built-in support to import/export data to/from text files
  • Support to Unique constraints and cascaded operation is partially incomplete and highly immature
  • The system is generally careless about referential integrity and data unicity, the most typical bug with db4o is object duplication
  • Before version 7.10.x the system was prone to Enum Duplication bug where storing n objects having an Enum field with m values would cause m*n Enum objects stored in the data files, leading to data files of several hundreds of GB in very short time

Portability and cross-platform deployment

db4o supports Java's JDK 1.1.x through 6.0 and runs on Java EE and Java SE. db4o also runs with Java ME dialects that support reflection, such as CDC
Connected Device Configuration
The Connected Device Configuration is a specification of a framework for Java ME applications describing the basic set of libraries and virtual-machine features that must be present in an implementation. The CDC is combined with one or more profiles to give developers a platform for building...

, Personal Profile
Personal Profile
May refer to either:A section or a CV/Resume that details the interests, skills and ambitions of the writer.Or:A framework for Java ME applications called the Personal Profile . It is a sub-set of the Connected Device Configuration....

, Symbian OS, SavaJe
SavaJe
SavaJe was the developer of the SavaJe OS, a Java OS for advanced mobile phones.The SavaJe OS was a monolithic OS-and-Java platform, an implementation of Sun Microsystems' Java Standard Edition, as opposed to...

 and Zaurus. Depending on customer demand, db4o will also run on dialects without reflection, such as CLDC, MIDP, BlackBerry
BlackBerry
BlackBerry is a line of mobile email and smartphone devices developed and designed by Canadian company Research In Motion since 1999.BlackBerry devices are smartphones, designed to function as personal digital assistants, portable media players, internet browsers, gaming devices, and much more...

 and Palm OS
Palm OS
Palm OS is a mobile operating system initially developed by Palm, Inc., for personal digital assistants in 1996. Palm OS is designed for ease of use with a touchscreen-based graphical user interface. It is provided with a suite of basic applications for personal information management...

.

db4o was also successfully tested on JavaFX
JavaFX
JavaFX is a software platform for creating and delivering rich Internet applications that can run across a wide variety of connected devices....

 and Silverlight.

db4o runs out of the box on Android.

db4o uses a custom feature called "generic reflector" to represent class information, when class definitions are not available, which allows to use it in a mixed Java-.NET environment, for example Java client - .NET server and vice versa. Generic reflector also makes it easy to convert the project between environments, as the database does not have to be converted.

Documentation and support

db4o provides various sources of documentation: tutorial, reference documentation, API documentation, online paircasts and blogs. Lots of important information can also be retrieved from forums and community additions (articles, translated documentation sources, sample projects etc).

For commercial users db4o suggests dDN (db4o developer network) subscription with guaranteed 24-hour support and live pairing sessions with the client – Xtreme Connect .

Object Manager

Object Management Enterprise (OME) is a db4o database browsing tool, which is available as a plugin to Eclipse and MS Visual Studio 2005/2008. OME allows to browse classes and objects in the database, connect to a database server, build queries using drag&drop, view database statistics etc.

In addition to graphical interface to db4o database OME provide some administrative functions as:
  • Indexing
  • Defragmentation
  • Backup

OME was initially suggested to the customers as a commercial product only available to dDN subscribers. From the db4o version 7.8 OME was included into standard db4o distribution and the source was made available to the public in db4o svn repository.

Community

Over the years the community of db4o registered members has grown to over 60,000 members. Many important db4o-related projects, such as standalone Object Manager, encryption support, Mono support etc., are fully driven by community members. db4o's Code Commander program defines the terms and conditions of community project development.

db4o provides free access to its code, documentation, forums and releases to the community members. The community votes for most important features and most critical bugs is taken into consideration when defining the road map and weekly iteration plans.
From time to time db4o holds different contests allowing the community members to come up with the best suggestion for an improvement of a specific db4o aspect, which are later on integrated into the core code.

Development process

The db4o team uses Extreme Programming
Extreme Programming
Extreme programming is a software development methodology which is intended to improve software quality and responsiveness to changing customer requirements...

 (XP) practices. Some of the tools used in the development process include:
  • JIRA
    JIRA
    Jira may refer to:* JIRA, software-engineering package* Journal of Iranian Research and Analysis* Jira, also known as Zilla, fictional character* Jira * Jira...

     is used for close tracking of the development process, progress reporting, prioritization of tasks, and collecting user feedback.
  • SVN is used for version control.
  • A wiki
    Wiki
    A wiki is a website that allows the creation and editing of any number of interlinked web pages via a web browser using a simplified markup language or a WYSIWYG text editor. Wikis are typically powered by wiki software and are often used collaboratively by multiple users. Examples include...

     is used for collaboration on design and documentation, as well as process notes.

Versions

db4o releases development, production and stable builds. Development version provides the newest features and is released for testing, community feedback and evaluation.

Production version is meant to be used in production environment and includes features that have been already evaluated and proven by time.

Stable version is meant to be used in final product shipment.

db4o also runs a continuous build, which is triggered by any new change committed to the SVN code repository. This build is open to community and can be used to evaluate the latest changes and get the newest features hot.

db4o build name format is meant to provide all the necessary information about the version, time of build and supported platform:

For example: db4o-7.2.30.9165-java.zip

db4o – name of the product, i.e. db4o database engine

7.2 – the release number

30 – iteration number, i.e. a sequential number identifying a development week

9165 – svn revision number, corresponding to the last commit that triggered the build

java – Java version of db4o. .NET version is identified by “net” for .NET 2.0 releases or “net35” for .NET 3.5 version. .NET version includes the corresponding Compact Framework release.

db4o public SVN repository is also available for the developers to get the source code and build versions locally with or without custom modifications.

Below is a short summary of the main features of the current stable, production and development builds:
Version Features
Stable (db4o-7.4) Sharpen release (java to c# converter)
Production (db4o-7.4) Sharpen release (java to c# converter)
Development (db4o-7.10)
  • Automagically enable db4o Transparent Persistence for Java via Eclipse
  • Transparent Persistence for Java Collections

Further reading

  • Stefan Edlich, Jim Paterson, Henrik Hörning, Reidar Hörning, The definitive guide to db4o, Apress
    Apress
    Apress, Inc. is a publisher of information technology books, based in New York City. It is a division of Springer Science+Business Media.Apress was founded by authors Gary Cornell and Dan Appleman. Its original name was Author's Press, shortened to APress, then Apress. In 2003, Apress purchased...

    , 2006, ISBN 1-59059-656-0
  • Ted Neward, The busy Java developer's guide to db4o, (7-article series), IBM DeveloperWorks

External links

  • http://drdobbs.com - Article about RETSCAN, a retina
    Retina
    The vertebrate retina is a light-sensitive tissue lining the inner surface of the eye. The optics of the eye create an image of the visual world on the retina, which serves much the same function as the film in a camera. Light striking the retina initiates a cascade of chemical and electrical...

    scanning system using db4o
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK