Browse OOP reference
Modelling and persistence

What are object-oriented databases?

On this page

An object database persists objects and their relationships using a model close to the application’s object model. Traversing a stored graph can feel natural. Ask how the database handles identity across sessions, schema evolution and queries spanning many objects before committing to that representation.

Worked example

Python
# Install the ZODB package before running this example.
from ZODB import DB
from persistent.mapping import PersistentMapping

db = DB(None)
with db.transaction() as conn:
    track = PersistentMapping(title="Overture")
    conn.root.featured = track
    conn.root.encore = track
with db.transaction() as conn:
    assert conn.root.featured is conn.root.encore
db.close()

ZODB guide to stores and transactions

Explore class relationships in the OOP Playground

What is the object-relational impedance mismatch?What is an object?How does functional programming compare with OOP?

All OOP questions

Search ObjectFAQ