zodb-pgjsonb

zodb-pgjsonb logo

ZODB storage adapter for PostgreSQL using JSONB, powered by zodb-json-codec.

Stores ZODB object state as queryable PostgreSQL JSONB instead of opaque pickle bytea blobs. ZODB sees pickle bytes at its boundaries; PostgreSQL sees queryable JSON internally.

Key capabilities:

  • SQL queryability – query ZODB objects directly with PostgreSQL JSONB operators and GIN indexes

  • Transparent transcoding via Rust-based codec (2x faster than CPython pickle)

  • Tiered blob storage – small blobs in PG bytea, large blobs in S3 (configurable threshold)

  • Full ZODB compatibility – IStorage, IMVCCStorage, IBlobStorage, IStorageUndoable, IStorageIteration

  • Configurable history modes (history-free or history-preserving with undo)

  • State processor plugins for writing extra columns atomically alongside object state

  • Pure SQL pack/GC via pre-extracted refs column (15-28x faster than RelStorage)

  • Instant cache invalidation via PostgreSQL LISTEN/NOTIFY

Requirements: Python 3.12+, PostgreSQL 15+ (tested with 17), zodb-json-codec

Documentation

Tutorials

Learning-oriented – Step-by-step lessons to build skills.

Start here if you are new to zodb-pgjsonb.

Tutorials
How-To Guides

Goal-oriented – Solutions to specific problems.

Use these when you need to accomplish something.

How-to guides
Reference

Information-oriented – Configuration tables and API details.

Consult when you need detailed information.

Reference
Explanation

Understanding-oriented – Architecture and design decisions.

Read to deepen your understanding of how it works.

Explanation

Quick start

  1. Install zodb-pgjsonb

  2. Run the Docker quickstart (Plone + PostgreSQL + MinIO in 5 minutes)

  3. Migrate an existing site