Skip to content

Latest commit

 

History

History
215 lines (147 loc) · 5.63 KB

storages.rst

File metadata and controls

215 lines (147 loc) · 5.63 KB

Storage APIs

Storage interfaces

There are various storage implementations that implement standard storage interfaces. They differ primarily in their constructors.

Application code rarely calls storage methods, and those it calls are generally called indirectly through databases. There are interface-defined methods that are called internally by ZODB. These aren't shown below.

IStorage

ZODB.interfaces.IStorage

IStorageIteration

ZODB.interfaces.IStorageIteration

IStorageUndoable

ZODB.interfaces.IStorageUndoable

IStorageCurrentRecordIteration

ZODB.interfaces.IStorageCurrentRecordIteration

IBlobStorage

ZODB.interfaces.IBlobStorage

IStorageRecordInformation

ZODB.interfaces.IStorageRecordInformation

IStorageTransactionInformation

ZODB.interfaces.IStorageTransactionInformation

Included storages

FileStorage

ZODB.FileStorage.FileStorage.FileStorage

ZODB.FileStorage.interfaces.IFileStoragePacker

FileStorage text configuration

File storages are configured using the filestorage section:

<filestorage>
  path Data.fs
</filestorage>

which accepts the following options:

ZODB component.xml filestorage

MappingStorage

ZODB.MappingStorage.MappingStorage

MappingStorage text configuration

File storages are configured using the mappingstorage section:

<mappingstorage>
</mappingstorage>

Options:

ZODB component.xml mappingstorage

DemoStorage

ZODB.DemoStorage.DemoStorage

DemoStorage text configuration

Demo storages are configured using the demostorage section:

<demostorage>
  <filestorage base>
    path base.fs
  </filestorage>
  <mappingstorage changes>
    name Changes
  </mappingstorage>
</demostorage>

demostorage sections can contain up to 2 storage subsections, named base and changes, specifying the demo storage's base and changes storages. See ZODB.DemoStorage.DemoStorage.__init__ for more on the base and changes storages.

Options:

ZODB component.xml demostorage

Noteworthy non-included storages

A number of important ZODB storages are distributed separately.

Base storages

Unlike the included storages, all the implementations listed in this section allow multiple processes to share the same database.

NEO

NEO can spread data among several computers for load-balancing and multi-master replication. It also supports asynchronous replication to off-site NEO databases for further disaster resistance without affecting local operation latency.

For more information, see https://lab.nexedi.com/nexedi/neoppod.

RelStorage

RelStorage stores data in relational databases. This is especially useful when you have requirements or existing infrastructure for storing data in relational databases.

For more information, see http://relstorage.readthedocs.io/en/latest/.

ZEO

ZEO is a client-server database implementation for ZODB. To use ZEO, you run a ZEO server, and use ZEO clients in your application.

For more information, see https://github.com/zopefoundation/ZEO.

Optional layers

ZRS

ZRS provides replication from one database to another. It's most commonly used with ZEO. With ZRS, you create a ZRS primary database around a ~ZODB.FileStorage.FileStorage.FileStorage and in a separate process, you create a ZRS secondary storage around any storage <ZODB.interfaces.IStorage>. As transactions are committed on the primary, they're copied asynchronously to secondaries.

For more information, see https://github.com/zc/zrs.

zlibstorage

zlibstorage compresses database records using the compression algorithm used by gzip.

For more information, see https://pypi.org/project/zc.zlibstorage/.

beforestorage

beforestorage provides a point-in-time view of a database that might be changing. This can be useful to provide a non-changing view of a production database for use with a ~ZODB.DemoStorage.DemoStorage.

For more information, see https://pypi.org/project/zc.beforestorage/.

cipher.encryptingstorage

cipher.encryptingstorage provided compression and encryption of database records.

For more information, see https://pypi.org/project/cipher.encryptingstorage/.