PostgreSQL instead of ZODB (Data.fs)?

Hi everyone,

We are currently running a SENAITE LIMS installation (v2.7) and are working on migrating the default ZODB FileStorage (Data.fs) to PostgreSQL for better backup, scalability, and maintainability.

:test_tube: What we’ve done so far:

  • Added RelStorage and psycopg2-binary to our buildout.cfg
  • Modified zope-conf-additional in the [instance] section as follows:
zope-conf-additional =
    <zodb_db main>
        <relstorage>
            type postgresql
            dsn dbname='${SENAITE_DB_NAME}' user='${SENAITE_DB_USER}' password='${SENAITE_DB_PASS}' host='${SENAITE_DB_HOST}'
            keep-history false
        </relstorage>
        mount-point /
    </zodb_db>
  • Created a Docker image and replaced the default ZEO setup with a PostgreSQL container
  • Used envsubst to replace environment variables from .env into the buildout.cfg.template
  • Docker builds successfully now, but we are encountering issues during buildout, such as:
Error: The substitution, ${SENAITE_DB_NAME}, doesn't contain a colon.

:brick: I’ve also tried:

  • Inline substitution
  • Setting variables directly in buildout.cfg (rather than using ${...})
  • Referencing RelStorage documentation for ZODB

:thinking: Our questions:

  1. Is it officially supported to run SENAITE with RelStorage and PostgreSQL as the primary backend (without ZEO or Data.fs)?
  2. Are there any community-supported distros or successful deployments using this architecture?
  3. Has anyone here managed to configure buildout + RelStorage + Docker environment reliably?
  4. Are there pitfalls or side effects (e.g., performance, compatibility, caching) we should be aware of?

Any advice, examples, or pointers to working configurations would be highly appreciated :pray:

Hopefully this helps not just us, but others in the community trying to modernize their LIMS infrastructure.

Thank you!

Ersan

2 Likes