An object database, also called an object-oriented database, is a database management system that stores data as persistent objects with their own identity, attributes, references and class definitions, in the same shape that an object-oriented program uses in memory. Database models differ mainly in how they represent structure and relationships, and the object model represents them as direct references between objects instead of rows linked by foreign keys.
In the field of databases, the object database emerged in the late 1980s to remove the impedance mismatch between object-oriented languages such as C++, Smalltalk and Java and the tabular relational model. It remains a specialized choice today, valued in engineering design, telecommunications, simulation and embedded systems where object graphs are deep, navigation is frequent and the schema follows the code.
How an object database stores and retrieves objects
An object database persists objects together with an object identifier (OID) that stays constant for the lifetime of the object, independent of its attribute values. When one object refers to another, the database stores the OID rather than a copied key, so a program can follow references by navigation instead of executing joins.
Most implementations use a client cache and a technique called pointer swizzling: when an object is loaded, stored OIDs are converted into in-memory pointers, and they are converted back when the object is written. The result is that traversing a reference to an already cached object costs about as much as dereferencing an ordinary pointer, which explains the strong performance on navigational workloads.
Persistence is usually achieved through one of several mechanisms. The following table summarizes the common approaches and their practical consequences.
| Mechanism | How objects become persistent | Practical consequence |
|---|---|---|
| Persistence by reachability | Any object reachable from a named root is stored | Little code, but accidental retention is possible |
| Persistence by inheritance | Classes derive from a persistent base class | Explicit, but couples domain classes to the product |
| Explicit store calls | The program calls store or delete on each object | Clear control, more boilerplate |
| Bytecode enhancement | A build step instruments classes to track changes | Transparent dirty tracking, extra build tooling |
Core features of the object data model
The object data model carries the full vocabulary of object-oriented programming into storage. Its defining features were codified in the Object-Oriented Database System Manifesto of 1989 and later in the ODMG standard, which specified the Object Definition Language (ODL) and the Object Query Language (OQL).
| Feature | Meaning in storage | Benefit |
|---|---|---|
| Object identity | Each object has an OID independent of its values | Stable references without surrogate keys |
| Complex objects | Nested collections, lists, sets and arrays are stored natively | No decomposition into many tables |
| Inheritance | Subclasses are stored and queried with their superclass | Polymorphic queries over a class hierarchy |
| Encapsulation | Behavior is defined by class methods | Business rules travel with the data type |
| Versioning | Some systems keep versions of objects or schemas | Useful for design and configuration history |
Querying works in two styles. Navigational access starts from a root or an index and walks references, while declarative queries in OQL or a vendor language filter collections by attribute values. Mature products also provide ACID transactions, page or object locking, indexes on class extents and online backup, so the model is not limited to in-process persistence.
How the object model compares with other database models
The object database is best understood against its neighbors. It shares the schema-follows-code idea with the document database and the relationship-first idea with the graph database, but differs from both in how tightly it binds storage to a programming language.
| Model | Unit of storage | Relationships | Typical query style |
|---|---|---|---|
| Object database | Typed object with OID | Direct object references | Navigation and OQL-style queries |
| Relational database | Row in a table | Foreign keys resolved by joins | SQL |
| Document database | Self-contained JSON or BSON document | Embedding or manual references | Document query API |
| Graph database | Node and edge with properties | First-class edges | Pattern matching languages |
| Object-relational mapping | Rows mapped to classes by a library | Joins hidden behind objects | SQL generated from objects |
The comparison with object-relational mapping (ORM) matters most in practice. ORM frameworks gave relational systems an object interface, which absorbed much of the demand that object databases once targeted. Separately, object-relational databases such as PostgreSQL added user-defined types, inheritance and composite values to SQL, offering some object features while keeping a relational core.
When an object database is a sound choice
An object database fits when the domain model is a deep, interconnected object graph that one application owns and traverses frequently. It fits poorly when many applications, reporting tools and analysts must query the same data in ad hoc ways.
| Situation | Recommended choice | Reason |
|---|---|---|
| CAD or product structure with thousands of nested parts | Object database | Fast traversal of part-of hierarchies |
| Embedded device with a single language runtime | Embedded object database | Small footprint, no mapping layer |
| Enterprise reporting across many teams | Relational database | Broad SQL tooling and analytics support |
| Highly connected data queried by pattern | Graph database | Edges and path queries are first-class |
| Web service storing flexible JSON payloads | Document database | Language-neutral format and wide ecosystem |
Teams evaluating the model should benchmark realistic traversal depths, check whether the product supports the languages they use, and confirm how the vendor handles schema evolution, because class changes are the most frequent operational event in an object database.
Limitations and common mistakes
The main weakness of the object database is tight coupling to one language and often to one vendor. Data stored as Java objects is not easily read by a Python service or a business intelligence tool, and the ODMG standard never achieved real portability between products.
- Ignoring schema evolution: renaming or splitting classes without a migration plan can leave stored objects unreadable.
- Loading whole graphs: careless reachability or eager activation can pull millions of objects into memory.
- Treating it as a reporting store: ad hoc aggregation is weaker than in SQL engines and needs exported data.
- Underestimating skills risk: fewer administrators and developers know the products, which raises long-term maintenance cost.
- Assuming universal speed: set-oriented scans and bulk updates are often slower than in a tuned relational system.
A balanced view is that the object database delivers excellent navigational performance and a natural programming model in exchange for reduced interoperability. That trade-off explains why it survives in specialized niches rather than as a general-purpose default.
A plain-language summary
Most programs think in terms of objects: a customer, an order, an engine part. A traditional database stores tables instead, so the program must constantly take objects apart and put them back together. An object database saves the objects as they are, including the links between them.
Think of a cabinet where every folder can hold direct pointers to other folders. To find what an engine part connects to, the program simply follows those pointers. The key takeaway is that this approach is fast and natural for one program with complex data, but harder to share with other tools and languages.
An example from practice
An engineering team builds software that manages the design of industrial pumps. Each pump model contains assemblies, each assembly contains around 200 parts, and parts reference materials, suppliers and tolerances. A single model can reach about 50,000 interconnected objects, and engineers open, edit and compare models all day.
With a relational schema, opening one model required dozens of joins and a mapping layer that took several seconds. The team moved the design store to an embedded object database, storing assemblies and parts as persistent objects with direct references and an index on the part number.
Opening a model became a matter of loading the root object and navigating references from a local cache, and response times fell to well under a second for typical edits. For monthly cost reports, the team exports a flattened copy to a relational warehouse, which keeps analytics in SQL while the design tool keeps its object model.