Skip to content

Object-Oriented Databases (OODBs)

Object-oriented databases (OODBs) are database systems designed to store, manage, and manipulate data in the form of objects, as defined in object-oriented programming (OOP). An OODM defines a database in terms of objects, their properties, and their operations.

These databases extend the capabilities of traditional database systems by integrating object-oriented features such as encapsulation, inheritance, polymorphism, and support for complex data structures.

Object-Oriented Databases (OODBs) were developed to overcome the shortcomings of traditional data models (like the relational model) in handling complex and highly interrelated data requirements in applications such as engineering design (CAD/CAM), biological sciences, telecommunications, and geographic information systems.

Many object data model features have also influenced modern NoSQL systems.


In object-oriented systems, an object is an entity that consists of:

  • State: Represented by its attributes (values).
  • Behavior: Represented by the operations (methods) defined for the object.

Objects may have complex internal structures and custom operations defined by the programmer.

Main Features of Object-Oriented Databases

1. Object Identity (OID)

A unique system-generated immutable identifier is assigned to each independent object stored in the database, irrespective of its attribute values.

Objects must have an immutable OID, this is typically not visible to the user but is used internally by the system to uniquely identify each object and manage inter-object references.

Basic values like integers or strings which are considered literals have no OID,

OIDs are typically implemented as long integers and mapped to physical storage using hash tables or similar structures for efficient retrieval.

2. Encapsulation

A core concept where an object's structure (internal state) and the operations (behavior/methods) that can be applied to it are defined together within the class/type definition.

External users interact with objects only through their defined interfaces (signatures), without needing to know the underlying implementation details. Internal attributes and implementation details are hidden from external access.

3. Persistent Objects

Objects are transient and exist only during the execution of a program. Object-oriented database systems extend this notion by allowing objects to persist beyond program termination by allowing them to be stored permanently in the database. These are called persistent objects.

Persistence is typically achieved through two mechanisms:

  • Naming: Giving an object a unique persistent name within the database, which serves as an entry point for users and applications.

  • Reachability: Making an object persistent by linking it from another persistent object. A named persistent collection (an "extent") can make all objects added to it persistent.

4. Inheritance and Type Hierarchies

ODBs support the definition of new types (subtypes or subclasses) that inherit attributes and operations from existing types (supertypes or superclasses). This allows for incremental development and reuse of type definitions.

Constraints can be enforced where objects in a subtype's extent must also be members of its supertype's extent.

There are different forms:

  • Multiple Inheritance: A subtype can inherit from two or more supertypes.
  • Selective Inheritance: A subtype inherits only a subset of the functions from a supertype.

5. Polymorphism of Operations (Operator Overloading)

Polymorphism or operator overloading allows the same operation name to have different implementations depending on the object's class.

  • Operation name is overloaded with different implementations.
  • The method to be executed is determined at runtime (late binding).
  • Facilitates general and reusable interfaces.

Example: A method area() may be implemented differently for Circle, Rectangle, and Triangle.

Complex Type Structures (Type Constructors)

Object-oriented databases allow objects and literals to have complex, nested type structures, through type constructors, enabling them to contain all necessary information directly within an object.

The three most basic type constructors are:

1. Atom Constructor

Includes basic built-in data types like integers, strings, floats, Booleans, and enumerated types, considered atomic or single-valued. These are considered atomic because their values are indivisible and represent single data items.

Represents atomic (single-valued) types, such as: int, float, string, bool, enum

2. Struct (Tuple) Constructor

Creates standard structured types, similar to records or tuples in the relational model, made up of several components. Used to define composite types made up of multiple components. Each component has a name and an associated type.

struct Name { 
	FirstName: string, 
	MiddleInitial: char, 
	LastName: string }
struct Degree { 
	Major: string, 
	Degree: string, 
	Year: date }

3. Collection (or Multivalued) Constructors

These include set(T), list(T), bag(T), array(T), and dictionary(K,T), allowing an object or literal value to contain a collection of other objects or values. All elements within a specific collection must be of the same type.

ConstructorDescription
set(T)Unordered, unique elements
bag(T)Unordered, allows duplicates
list(T)Ordered, variable-length
array(T)Ordered, fixed-size
dictionary(K, T)Key-value pairs
  • set(string): A set of strings

  • set(Employee): A set of employee objects

Key Concepts

Several core concepts distinguish object-oriented databases from other models:

  • Each object is assigned a unique, immutable object identifier (OID) that is independent of attribute values and used internally for object management.

  • Complex object structures are constructed using nested applications of type constructors such as tuples, sets, lists, arrays, and bags.

  • Objects encapsulate both structure and behavior, with class definitions including both attribute declarations and operation signatures.

  • Object-oriented databases are designed to be compatible with object-oriented programming languages, supporting both transient and persistent objects seamlessly. Persistence is achieved through reachability or naming.

  • Inheritance allows the definition of new object types based on existing ones, supporting the reuse of structure and behavior. Multiple inheritance is supported in some models.

  • Extents represent the set of all persistent instances of a particular class or type. They may be defined explicitly as persistent sets and are useful for organizing and querying objects of a given type.

  • Polymorphism allows a single operation name to be used with different implementations, depending on the type of the object to which it is applied. This supports flexibility and reuse of operation names across different types.

Made with ❤️ for students, by a fellow learner.