Most people who regularly deal with databases – for example, those working in software pro­gram­ming, web de­vel­op­ment or the library sector – work with re­la­tion­al databases and with cor­res­pond­ing database man­age­ment systems (DBMS) like MySQL or MariaDB. But there are al­tern­at­ives and one of these are object-oriented databases (also known as object databases or OODBs). Although OODBs are not be widely used, they can be a great help to some projects.

What are object databases?

The object-oriented database model ties related packages together. In other words, a data set and all its at­trib­utes are combined with an object. In this way, all of the in­form­a­tion is directly available. Instead of dis­trib­ut­ing everything across different tables, then, the data can be retrieved in one package. Alongside the at­trib­utes, methods are also stored in the objects. This is where the databases’ proximity to object-oriented pro­gram­ming languages becomes clear. As in pro­gram­ming, each object has certain activ­it­ies that it can carry out.

In turn, objects are brought together in classes. Or, to put it more ac­cur­ately: an object is a concrete unit in an abstract class. This generates a hierarchy of classes and sub­classes. Within such a construct, sub­classes assume the prop­er­ties of higher-level classes and expand on these with their own at­trib­utes. At the same time, objects in one class can also be connected with other classes. This breaks up the strict hierarchy and makes sure that the objects are in­ter­linked. Simple objects can be combined with complex objects.

To address the various objects, the cor­res­pond­ing database man­age­ment system auto­mat­ic­ally assigns a one-off iden­ti­fic­a­tion to each unit. In this way, objects can be easily retrieved again after they have been saved.

Let’s look at an example. Assume we are saving the concrete object of a bicycle as an object-oriented unit with all of its prop­er­ties and methods. It is red, you can ride it, it has a saddle, and so on. This object is then sim­ul­tan­eously part of the class ‘Bicycles’. Inside the same class, for example, we might also find a blue and a green bicycle. The class ‘Bicycles’ is in turn a sub­cat­egory of ‘Vehicles’, which also contains ‘Cars’. At the same time, however, the object also has a con­nec­tion to the class ‘Leisure activ­it­ies’. If we retrieve our object via its unique ID, all of its related at­trib­utes and methods are directly available.

Re­la­tion­al vs. object-oriented databases

For a long time, re­la­tion­al databases have been the standard in web and software de­vel­op­ment. In this model, in­form­a­tion is stored in in­ter­con­nec­ted tables. Here, too, the links between complex pieces of in­form­a­tion with different com­pon­ents can be stored and retrieved. With an object database, though, all of the unit’s com­pon­ents are available im­me­di­ately. That also means that the data sets can be much more complex. With a re­la­tion­al database we tend to try to ac­com­mod­ate simple in­form­a­tion. The more complex the data set becomes, the more extensive the con­nec­tions, ob­struct­ing the database.

Ad­vant­ages and dis­ad­vant­ages of the object-oriented database model

The choice of database type heavily depends on the in­di­vidu­al ap­plic­a­tion. When working with object-oriented pro­gram­ming languages, like Java for example, an object database is ad­vant­age­ous. The objects of the source code can simply be in­cor­por­ated into the database. If we turn to a re­la­tion­al database, which is fairly common, complex objects are more difficult to integrate into the table construct.

One dis­ad­vant­age of OODBs is poor adoption among the community. Although the model has been es­tab­lished since the 1980s, up to now, very few database man­age­ment systems have taken to object databases. The community that works with the model is cor­res­pond­ingly small. Most de­velopers, therefore, prefer to turn to the more widely spread, well-doc­u­mented and highly developed re­la­tion­al databases.

Although com­plex­ity of OODBs is one of its ad­vant­ages, it can present a few dis­ad­vant­ages in certain situ­ations. The com­plex­ity of the objects means that complex queries and op­er­a­tions can be un­der­taken much more quickly than in re­la­tion­al models. However, if the op­er­a­tions are simple, the complex structure still has to be used resulting in a loss of speed.

Ad­vant­ages Dis­ad­vant­ages
Complex data sets can be saved and retrieved quickly and easily. Object databases are not widely adopted.
Object IDs are assigned auto­mat­ic­ally. In some situ­ations, the high com­plex­ity can cause per­form­ance problems.
Works well with object-oriented pro­gram­ming languages.  
Tip

There are other al­tern­at­ives to MySQL & co., including document-oriented databases, which have proven to be very flexible. Column-oriented databases, on the other hand, are used above all when dealing with very large amounts of data.

Go to Main Menu