ZODB: The Z Object Database
Grant
gadey at its.uct.ac.za
Wed Aug 7 06:09:48 EDT 2002
The Z Object Database
[http://www.amk.ca/zodb/zodb-zeo.html]
ZODB lets you add persistence to Python objects in an almost completely
transparent way, giving Python programmers an object database that
allows making Python objects persistent with very little effort. (The
"very little effort" part should not be understated. Commercial object
databases for C++ or Java often require that you jump through some hoops
and avoid certain data types or code styles. In comparison the
naturalness of the ZODB is astonishing, and testimony to both Python's
flexibility and Jim Fulton's skills.)
There are 3 main interfaces in the ZODB: Storage, DB, and Connection
classes.
* Storage classes are the lowest layer, and handle storing and
retrieving objects from some form of long-term storage. A few different
types of Storage have been written, such as FileStorage, which uses
regular files, and BerkeleyStorage, which uses Sleepycat Software's
BerkeleyDB 2.7. You could write a new Storage that stored objects in a
relational database or Metakit file, for example, if you needed to
ensure some property useful to your application. Two example storages,
DemoStorage and MappingStorage, are available to use as models if you
want to write a new Storage.
* The DB class sits on top of a storage, and mediates the interaction
between several connections. One DB instance is created per process.
* Finally, the Connection class caches objects, and moves them into and
out of object storage. A multi-threaded program can open a separate
Connection instance for each thread.
More information about the Python-list
mailing list