Skip to main content

A backend for ZODB that stores pickles in a relational database.

Project description

RelStorage is a storage implementation for ZODB that stores pickles in a relational database (RDBMS). PostgreSQL 9.6 and above, MySQL 5.7.19 / 8.0, Oracle 10g and above, and SQLite 3.8.3 and above are currently supported. RelStorage replaced the PGStorage project.

Features

  • It is a drop-in replacement for FileStorage and ZEO, with several enhancements:

    • Supports undo, packing, and object history preservation just like FileStorage.

    • RelStorage can be configured not to keep object histories for reduced disk space usage and improved performance.

    • Multiple processes on a single machine can read and write a local ZODB database using SQLite without needing to start and manage another process (i.e., ZEO).

    • Blobs can be stored on a shared filesystem, or (recommended) in the relational database and only cached locally.

    • Multiple threads in the same process share a high-performance in-memory pickle cache to reduce the number of queries to the RDBMS. This is similar to ZEO, and the ZEO cache trace tools are supported.

    • The in-memory pickle cache can be saved to disk and read when a process starts up. This can dramatically speed up site warmup time by eliminating a flood of RDBMS queries. Unlike ZEO, this cache is automatically shared by all processes on the machine (no need to configure separate client identifiers.)

  • Ideal for large, high volume sites.

    • Multiple Python processes on multiple machines can read and write the same ZODB database concurrently. This is similar to ZEO, but RelStorage does not require ZEO.

    • Supports ZODB 5’s parallel commit feature: Database writers only block each other when they would conflict (except for a small window at the end of the twophase commit protocol when the transaction ID is allocated; that still requires a global database lock).

    • According to some tests, RelStorage handles concurrency better than the standard combination of ZEO and FileStorage.

    • Whereas FileStorage takes longer to start as the database grows due to an in-memory index of all objects, RelStorage starts quickly regardless of database size.

    • Capable of failover to replicated SQL databases.

  • Tested integration with gevent for PostgreSQL and MySQL.

  • There is a simple way (zodbconvert) to (incrementally) convert FileStorage to RelStorage and back again. You can also convert a RelStorage instance to a different relational database. This is a general tool that can be used to convert between any two ZODB storage implementations.

  • There is a simple way (zodbpack) to pack databases.

  • Supports zodburi .

  • Free, open source (ZPL 2.1)

Features Supported by Databases

Some of RelStorage’s features are only supported on certain versions of certain databases. If the database doesn’t support the feature, RelStorage will still work, but possibly with a performance penalty.

Supported Features

Parallel Commit

Shared readCurrent locks

Non-blocking readCurrent locks

Streaming blobs

Central transaction ID allocation

Atomic lock and commit without Python involvement

PostgreSQL

Yes

Yes

Yes

With psycopg2 driver

Yes

Yes, except with PG8000 driver

MySQL

Yes

Yes

Native on MySQL 8.0, emulated on MySQL 5.7

No, emulated via chunking

Yes

Yes

Oracle

Yes

No

Yes

Yes

No (could probably be implemented)

No (could probably be implemented)

SQLite

No

No

N/A (there is no distinction in lock types)

No, consider using a shared-blob-dir

N/A (essentially yes because it happens on one machine)

No

Documentation

Documentation including installation instructions is hosted on readthedocs.

The complete changelog is also there.

https://readthedocs.org/projects/relstorage/badge/?version=latest

Development

RelStorage is hosted at GitHub:

https://github.com/zodb/relstorage

Continuous integration

A test suite is run for every push and pull request submitted. Travis CI is used to test on Linux, and AppVeyor runs the builds on Windows.

https://travis-ci.org/zodb/relstorage.svg?branch=master https://ci.appveyor.com/api/projects/status/pccddlgujdoqvl83?svg=true

Builds on Travis CI automatically submit updates to coveralls.io to monitor test coverage.

https://coveralls.io/repos/zodb/relstorage/badge.svg?branch=master&service=github

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

RelStorage-3.1.3.dev0-pp27-pypy_73-macosx_10_7_x86_64.whl (783.3 kB view details)

Uploaded PyPymacOS 10.7+ x86-64

RelStorage-3.1.3.dev0-cp38-cp38-macosx_10_9_x86_64.whl (797.5 kB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

RelStorage-3.1.3.dev0-cp37-cp37m-macosx_10_9_x86_64.whl (797.4 kB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

RelStorage-3.1.3.dev0-cp36-cp36m-macosx_10_9_x86_64.whl (796.0 kB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

RelStorage-3.1.3.dev0-cp27-cp27m-macosx_10_9_x86_64.whl (796.0 kB view details)

Uploaded CPython 2.7mmacOS 10.9+ x86-64

File details

Details for the file RelStorage-3.1.3.dev0-pp27-pypy_73-macosx_10_7_x86_64.whl.

File metadata

  • Download URL: RelStorage-3.1.3.dev0-pp27-pypy_73-macosx_10_7_x86_64.whl
  • Upload date:
  • Size: 783.3 kB
  • Tags: PyPy, macOS 10.7+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for RelStorage-3.1.3.dev0-pp27-pypy_73-macosx_10_7_x86_64.whl
Algorithm Hash digest
SHA256 c1820299ad802d7bafbb19ad6c11dc3451cdaa4a2072dffa46e0e461d8ff4020
MD5 4be0a9d64b6105dbe06e4d77c5d1bab3
BLAKE2b-256 add63ba85b1af7c91f0a87e871d19f25d60135e79f388ca8df473b70fb640249

See more details on using hashes here.

File details

Details for the file RelStorage-3.1.3.dev0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: RelStorage-3.1.3.dev0-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 797.5 kB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for RelStorage-3.1.3.dev0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cf1a0494859b464913ec1d5b82e310e3f5f21fca4d9be83d8c801bdd8ff70a71
MD5 9014c21bf95a5fbee346bcb49145159f
BLAKE2b-256 59045a4524acae43ae2ea502dfe931f98c5fd4f192caed56219bf03bcdf8c983

See more details on using hashes here.

File details

Details for the file RelStorage-3.1.3.dev0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: RelStorage-3.1.3.dev0-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 797.4 kB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for RelStorage-3.1.3.dev0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b67f4f5190b9dfc665dbb9a86b1acc3c1d112526b6cb16e5ae34859ef38bf1f7
MD5 6982c393b7c0bf95ee839a18f8cfa23b
BLAKE2b-256 6bdfb26400ad3634a8368cbc55b74128c083deba0cdc00db950429dc9d2a80ad

See more details on using hashes here.

File details

Details for the file RelStorage-3.1.3.dev0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: RelStorage-3.1.3.dev0-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 796.0 kB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for RelStorage-3.1.3.dev0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3d1e603eac42f962e0ef3ff5219bc45560fe3a011abb89db6c6fd5d711c44eba
MD5 ba0709c244e7ba44496d4a31ba99585f
BLAKE2b-256 3a72695199e7411cfeb6c4037800d729dc3625f1578fb7620def5b7b9aa114fb

See more details on using hashes here.

File details

Details for the file RelStorage-3.1.3.dev0-cp27-cp27m-macosx_10_9_x86_64.whl.

File metadata

  • Download URL: RelStorage-3.1.3.dev0-cp27-cp27m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 796.0 kB
  • Tags: CPython 2.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.3.1 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

File hashes

Hashes for RelStorage-3.1.3.dev0-cp27-cp27m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d4a8831d12435a1a66ca6ed4b7af272db6e7f1a8dc9ed9ef07bee4501a581e7a
MD5 c4e35d829d3da6ed75715e8eb72afe22
BLAKE2b-256 e115f8521ec0f7c1ffcb1d105ee7d2d1f856f6fd137766f3cb8f31238ab0f9df

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page