Skip to content

This is the multi-page printable view of this section.

Return to the regular view of this page

S3

S3 object storage through pgsilo, Silo’s PostgreSQL backend, with an SQL API.

S3 clients and SDKs talk to Silo, PGSTY’s fork of the MinIO server, which keeps its S3, SigV4, IAM and Console front end. With the pgsilo backend, Silo stores everything in PostgreSQL: object bodies, metadata, versions, multipart state, bucket configuration and IAM. The gateways are stateless, and an SQL API can read and write the same objects inside a PostgreSQL transaction.

Status
MVP in progress. The goal is an experimental backend shipped inside a Silo release; there will be no standalone pgsilo binary. Schema version 14. Nothing is published yet.
Ports
S3 and STS on 9000; Console on 9001
Gateway
Silo server (Go) with a PostgreSQL ObjectLayer; start it with SILO_PG_DSN instead of disk paths
Database
schemas silo (private), silo_api (11 public functions), silo_bucket (one ACL relation per bucket); PostgreSQL 16 or later
Kernel patch
none; runs on stock PostgreSQL
Licence
Silo server: AGPL-3.0-or-later

How S3 maps onto PostgreSQL

  • Object bodies are bytea segments of 8 MiB by default. Objects are limited to 256 MiB by default, or up to 1 GiB when set at initialization.
  • Metadata, versions, delete markers and multipart uploads are rows, so a write either commits completely or not at all.
  • IAM users, groups, policies and service accounts live in the database, with a 5-second lease for cached IAM state.
  • SQL API: silo_api.put_object, get_object, list_objects and eight more functions work inside a caller’s transaction (Read Committed). Callers are identified by session_user.

Try it

BEGIN;
SELECT * FROM silo_api.put_object('attachments', 'invoice/2026-001.txt',
                                  convert_to('paid', 'UTF8'), 'text/plain');
COMMIT;

The object is then readable over S3 as attachments/invoice/2026-001.txt.

Limits

  • A gateway uses 32 PostgreSQL connections by default. Above 32 concurrent requests, the current candidate (1d387725c) queues requests for up to 5 s and then answers HTTP 503 SlowDown.
  • PgBouncer in transaction-pooling mode is not supported.
  • SQL transactions, native authorization, STS, lifecycle, Object Lock, quota, annotations and ZIP extraction, and standby gateways are all Preview features.
  • Not supported: SSE-KMS or an external KMS, replication, tiering, erasure coding, automatic high availability.

Alternatives

pgs3 serves path-style S3 from PostgreSQL background workers, in process. It is an early alpha (v0.1.1) without TLS, IAM or lifecycle. Mimus will pick one of the two as its default S3 implementation.

Source and credit

pgsilo is developed by PGSTY and Silo contributors; general Silo documentation is at silo.pgsty.com. Silo derives from the MinIO project, © 2015–2025 MinIO, Inc. Silo and Mimus are not affiliated with or endorsed by MinIO, Inc. The MINIO_* variables and /minio/ paths remain for compatibility only.

Pages in this section adapt the pgsilo companion documentation, © PGSTY & SILO Contributors, CC BY 4.0; see Licence and attribution.

1 - Quick start

Prepare a database, start Silo with the PostgreSQL backend, and create a bucket and an object.
Note

The PostgreSQL backend for Silo (pgsilo) is in MVP development and has not been publicly released. The package names and commands below come from the local schema 14 build; no public download URL exists yet.

This guide prepares a PostgreSQL database, starts a writable Silo gateway in PostgreSQL mode, creates a bucket and a restricted application user, and writes objects over both S3 and SQL. For full host, certificate and macOS setup, see Install.

Prepare PostgreSQL

Use PostgreSQL 16 or later. Connect gateways directly to the writable primary, not through PgBouncer in transaction-pooling mode.

Create an ordinary database owner and the silo database:

CREATE ROLE silo_owner LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION;
\password silo_owner
CREATE DATABASE silo OWNER silo_owner;

The first writable gateway connects as silo_owner and runs migrations 0001–0014 in a transaction to create the silo, silo_api and silo_bucket schemas.

Start the gateway

Silo enters PostgreSQL mode when you set SILO_PG_DSN or pass a single postgres:// URI without disk arguments.

On Debian or Ubuntu with the local package, verify the checksum and install the package:

sha256sum -c SHA256SUMS
sudo dpkg -i ./silo_20261007153132.0.0-1PGSTY_arm64.deb

Write /etc/default/silo with your database DSN, root credentials and pool limits (replace the placeholders before starting the service):

# systemd EnvironmentFile; replace placeholders before starting the service.
SILO_PG_DSN="postgresql://silo_owner:URL_ENCODED_PASSWORD@pg.example.net:5432/silo?sslmode=verify-full&sslrootcert=/etc/silo/postgres-ca.crt"
MINIO_ROOT_USER="REPLACE_WITH_ROOT_ACCESS_KEY"
MINIO_ROOT_PASSWORD="REPLACE_WITH_ROOT_SECRET"
MINIO_REGION="us-east-1"
SILO_PG_READ_ONLY="off"
SILO_PG_MAX_CONNS="32"
SILO_PG_CONTROL_CONNS="4"
SILO_PG_COORD_CONNS="2"
SILO_PG_SEGMENT_SIZE="8MiB"
SILO_PG_MAX_OBJECT_SIZE="256MiB"
SILO_PG_ACQUIRE_TIMEOUT="5s"
SILO_PG_REQUEST_TIMEOUT="15m"

Install the systemd drop-in /etc/systemd/system/silo.service.d/postgresql.conf so the service starts without disk arguments:

[Service]
EnvironmentFile=
EnvironmentFile=/etc/default/silo
ExecStart=
ExecStart=/usr/bin/silo server --address :9000 --console-address :9001 --certs-dir /etc/silo/certs

Enable and start the service, then check read and write readiness:

sudo systemctl daemon-reload && sudo systemctl enable --now silo
curl --fail --cacert /path/to/s3-ca.crt https://s3.example.net:9000/minio/health/cluster/read
curl --fail --cacert /path/to/s3-ca.crt https://s3.example.net:9000/minio/health/cluster

A healthy writable gateway returns HTTP 200 for both endpoints. See Configuration for all SILO_PG_* variables.

Create a bucket and user

Install mcli, trust the gateway CA, and configure an administrative alias with the root credentials:

export SILO_ENDPOINT='https://s3.example.net:9000'
export SILO_CLIENT_CONFIG="$HOME/.config/silo-tutorial/mcli"
umask 077
mkdir -p "$SILO_CLIENT_CONFIG/certs/CAs"
cp /path/to/s3-ca.crt "$SILO_CLIENT_CONFIG/certs/CAs/silo-ca.crt"
mcli_pg() { command mcli --config-dir "$SILO_CLIENT_CONFIG" "$@"; }
mcli_pg alias set pg-admin "$SILO_ENDPOINT" --api S3v4 --path on

Create the attachments bucket and an application user (app-s3):

mcli_pg mb pg-admin/attachments
mcli_pg admin user add pg-admin

Save a bucket-scoped policy to ~/.local/share/silo-tutorial/attachments-rw.json:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": ["s3:GetBucketLocation", "s3:ListBucket"],
      "Resource": ["arn:aws:s3:::attachments"]
    },
    {
      "Effect": "Allow",
      "Action": ["s3:GetObject", "s3:PutObject", "s3:DeleteObject"],
      "Resource": ["arn:aws:s3:::attachments/*"]
    }
  ]
}

Create and attach the policy, then configure an alias (pg-app) with the app-s3 credentials:

mcli_pg admin policy create pg-admin attachments-rw "$HOME/.local/share/silo-tutorial/attachments-rw.json"
mcli_pg admin policy attach pg-admin attachments-rw --user app-s3
mcli_pg alias set pg-app "$SILO_ENDPOINT" --api S3v4 --path on

Upload, read and delete over S3

Upload a file, list and stat the object, download it to verify the bytes, and delete it:

export SILO_TUTORIAL_DIR="$HOME/.local/share/silo-tutorial/files"
mkdir -p "$SILO_TUTORIAL_DIR"
printf 'Hello Silo PostgreSQL\n' > "$SILO_TUTORIAL_DIR/hello.txt"
mcli_pg cp "$SILO_TUTORIAL_DIR/hello.txt" pg-app/attachments/hello.txt
mcli_pg ls pg-app/attachments
mcli_pg stat pg-app/attachments/hello.txt
mcli_pg cp pg-app/attachments/hello.txt "$SILO_TUTORIAL_DIR/hello.download.txt"
cmp "$SILO_TUTORIAL_DIR/hello.txt" "$SILO_TUTORIAL_DIR/hello.download.txt"
mcli_pg rm pg-app/attachments/hello.txt

Write an object from SQL

Note

The SQL transaction API (silo_api) is a Preview feature in the MVP scope.

In a psql session with permissions on silo_api and the bucket ACL relation silo_bucket.attachments, write an object inside a Read Committed transaction:

BEGIN;
SELECT * FROM silo_api.put_object(
  'attachments',
  'invoice/2026-001.txt',
  convert_to('paid', 'UTF8'),
  'text/plain'
);
COMMIT;

Once the transaction commits, the object is immediately visible over S3 as attachments/invoice/2026-001.txt. See Objects from SQL and the SQL API reference for grants and function signatures.

Open the Console

Open https://console.example.net:9001 in a browser that trusts the gateway CA and sign in with the root credentials. Browse Buckets → attachments → Objects to inspect or upload files, and use the IAM pages to manage users and policies.

Logical object usage in the Console differs from physical PostgreSQL table and WAL size. A physical capacity reading of Unknown is expected in PostgreSQL mode and does not indicate zero free space.

2 - Tutorials

SQL access, SDKs, versioning, encryption, annotations and multi-step S3 workflows.

Complete the Quick start first. Keep the silo database, the attachments bucket, the app-s3 user and the trusted gateway CA certificate for these tutorials.

TutorialScope
Objects from SQLCommit or roll back objects together with business rows; grant silo_api and silo_bucket permissions; paginate and stream segments (Preview)
Use an S3 SDKConnect AWS CLI, boto3 and browsers with presigned URLs and bucket CORS
VersioningEnable versioning, read historical versions, and configure lifecycle rules and hard bucket quotas
EncryptionConfigure static-key SSE-S3, use client-held SSE-C keys, and understand key recovery and SQL boundaries
Annotations and ZIPAttach UTF-8 annotations to object versions and read or list ZIP archive members with SigV4 requests (Preview)
Multipart, Object Lock and STSUpload parts with cleanup, apply retention and legal hold, deliver bucket notifications or SQL outbox events, and issue service accounts or STS credentials

Use the root account only for administration. Use restricted IAM policies for S3 applications, and manage PostgreSQL login roles separately from S3 access keys.

2.1 - Objects from SQL

Write and read objects inside a PostgreSQL transaction with silo_api.
Note

The SQL transaction API (silo_api) and PostgreSQL native authorization (silo_bucket) are Preview features in the MVP scope.

This tutorial writes an invoice row and its attachment in one PostgreSQL transaction, verifies both from SQL and S3, rolls back a second transaction, and reads paginated lists and object segments. Complete the Quick start first so the silo database and plaintext attachments bucket exist.

Create an application SQL role

Connect to silo as a database administrator and create an unprivileged login role (app_sql) and application schema (app_demo):

CREATE ROLE app_sql LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION NOBYPASSRLS;
\password app_sql
CREATE SCHEMA app_demo AUTHORIZATION app_sql;

The application role needs no superuser rights, no membership in silo_owner, and no direct access to the private silo schema.

Next, connect to silo as the installation owner (silo_owner) and grant EXECUTE on the required silo_api functions plus SELECT and INSERT on the ACL relation for attachments:

GRANT USAGE ON SCHEMA silo_api, silo_bucket TO app_sql;
GRANT EXECUTE ON FUNCTION
  silo_api.put_object(text,text,bytea,text,jsonb,boolean,text),
  silo_api.get_object(text,text,uuid),
  silo_api.stat_object(text,text,uuid),
  silo_api.read_object(text,text,bigint,bigint,uuid,bigint),
  silo_api.list_objects(text,text,text,integer)
TO app_sql;
SELECT format('GRANT SELECT, INSERT ON TABLE %I.%I TO %I',
              n.nspname, c.relname, 'app_sql')
FROM silo.bucket_acl AS a
JOIN silo.buckets AS b ON b.id = a.bucket_id
JOIN pg_catalog.pg_class AS c ON c.oid = a.relation_oid
JOIN pg_catalog.pg_namespace AS n ON n.oid = c.relnamespace
WHERE b.name = 'attachments' AND n.nspname = 'silo_bucket' \gexec

In psql, \gexec executes the generated GRANT statement. Because a bucket’s ACL relation name in silo_bucket is decoupled from the bucket name, silo_owner looks it up through silo.bucket_acl. See Authorization for the complete permission mapping.

Reconnect as app_sql and create the business table:

psql 'host=pg.example.net port=5432 dbname=silo user=app_sql sslmode=verify-full sslrootcert=/path/to/pg-ca.crt' -W
\set ON_ERROR_STOP on
SELECT session_user, current_user;
CREATE TABLE app_demo.invoices (
    invoice_id bigint PRIMARY KEY,
    object_key text NOT NULL,
    object_id bigint NOT NULL,
    object_version uuid,
    amount numeric(12,2) NOT NULL
);

silo_api checks the login-time session_user and rejects SET ROLE impersonation.

Commit a business row and object together

In the app_sql session, write an object and insert the referencing invoice row in one Read Committed transaction:

BEGIN ISOLATION LEVEL READ COMMITTED;
WITH written AS (
  SELECT * FROM silo_api.put_object(
    'attachments', 'invoices/1001.txt',
    convert_to('invoice 1001 amount 199.00', 'UTF8'),
    'text/plain', '{"invoice_id":"1001"}'::jsonb
  )
)
INSERT INTO app_demo.invoices
  (invoice_id, object_key, object_id, object_version, amount)
SELECT 1001, 'invoices/1001.txt', object_id, version_id, 199.00
FROM written;
COMMIT;

Read the committed object body and metadata from SQL:

SELECT convert_from(
  silo_api.get_object('attachments', 'invoices/1001.txt'), 'UTF8'
);
SELECT i.invoice_id, i.amount, o.object_id, o.version_id, o.size, o.etag
FROM app_demo.invoices AS i
CROSS JOIN LATERAL silo_api.stat_object('attachments', i.object_key) AS o
WHERE i.invoice_id = 1001;

Read the same object over S3:

mcli_pg cat pg-app/attachments/invoices/1001.txt

get_object returns bytea. Use convert_from only when the payload is known UTF-8 text.

Roll back a business row and object together

Start a second transaction, write both the object and the invoice row, and roll back:

BEGIN ISOLATION LEVEL READ COMMITTED;
WITH written AS (
  SELECT * FROM silo_api.put_object(
    'attachments', 'invoices/1002.txt',
    convert_to('this invoice will be rolled back', 'UTF8'), 'text/plain'
  )
)
INSERT INTO app_demo.invoices
  (invoice_id, object_key, object_id, object_version, amount)
SELECT 1002, 'invoices/1002.txt', object_id, version_id, 299.00
FROM written;
ROLLBACK;
SELECT count(*) FROM app_demo.invoices WHERE invoice_id = 1002;
SELECT count(*) FROM silo_api.list_objects('attachments', 'invoices/1002.txt');

Both counts return 0. Neither the relational row nor the S3 object is published.

If your application needs a permanent reference to an immutable object body, enable bucket versioning and pass the saved version_id when calling get_object, stat_object or read_object. Overwriting an unversioned object replaces its body.

Paginate listings and read segments

List the first page of objects under the invoices/ prefix:

SELECT key, size, etag FROM silo_api.list_objects(
  'attachments', 'invoices/', NULL, 100
);

To fetch the next page, pass the final key of the current page as the third argument (start_after). Each call returns at most 1,000 live objects in C byte order and omits delete markers.

To read a large object in bounded chunks without materializing the full body in one call, open a read-only Repeatable Read snapshot and call read_object:

BEGIN ISOLATION LEVEL REPEATABLE READ READ ONLY;
SELECT object_id, version_id, offset_bytes, octet_length(data)
FROM silo_api.read_object('attachments', 'invoices/1001.txt', 0, 8388608);
-- Advance offset_bytes on subsequent calls within the same transaction.
COMMIT;

read_object returns at most 8 MiB (8388608 bytes) per call. Use REPEATABLE READ only for read-only transactions; SQL writes through silo_api require READ COMMITTED.

Direct SQL writes do not emit S3 bucket notifications. To publish events atomically with SQL object writes, insert into a transactional outbox table in the same transaction; see Multipart, Object Lock and STS and the SQL API reference.

2.2 - Use an S3 SDK

Connect AWS SDKs and mc-compatible clients to the gateway.

This tutorial connects the AWS CLI and the Python SDK (boto3) to a Silo PostgreSQL gateway, generates a presigned download URL, and configures bucket CORS for browser requests. Complete the Quick start first so the attachments bucket, app-s3 user and local hello.txt file exist.

Set the endpoint and working directory in your terminal:

export SILO_ENDPOINT='https://s3.example.net:9000'
export SILO_TUTORIAL_DIR="$HOME/.local/share/silo-tutorial/files"
export AWS_CA_BUNDLE='/path/to/s3-ca.crt'

AWS CLI and Python SDK

Configure an AWS CLI profile (silo-app) with the app-s3 credentials, region us-east-1 and path-style addressing:

aws configure --profile silo-app
aws configure set s3.addressing_style path --profile silo-app
aws --profile silo-app --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api list-objects-v2 --bucket attachments
aws --profile silo-app --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3 cp "$SILO_TUTORIAL_DIR/hello.txt" s3://attachments/hello.txt

Create a Python 3.10+ virtual environment and install boto3:

python3 -m venv "$HOME/.local/share/silo-tutorial/venv"
"$HOME/.local/share/silo-tutorial/venv/bin/pip" install 'boto3==1.43.108' 'botocore==1.43.108'

Save the following script as ~/.local/share/silo-tutorial/sdk.py:

import os
import boto3
from botocore.config import Config

session = boto3.Session(profile_name="silo-app", region_name="us-east-1")
s3 = session.client(
    "s3",
    endpoint_url=os.environ["SILO_ENDPOINT"],
    verify=os.environ["AWS_CA_BUNDLE"],
    config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)
s3.put_object(Bucket="attachments", Key="sdk.txt", Body=b"hello from Python\n")
response = s3.get_object(Bucket="attachments", Key="sdk.txt")
try:
    print(response["Body"].read().decode("utf-8"))
finally:
    response["Body"].close()

Run "$HOME/.local/share/silo-tutorial/venv/bin/python" "$HOME/.local/share/silo-tutorial/sdk.py". It prints hello from Python.

Keep default SDK checksums and TLS verification enabled. When uploading larger files with SDK multipart helpers, the completed object must fit within the store’s maximum object size (256 MiB by default, up to 1 GiB if configured at initialization).

Presigned URLs and bucket CORS

Generate a presigned GET URL valid for 15 minutes (900 seconds) using the s3 client from above:

url = s3.generate_presigned_url(
    "get_object", Params={"Bucket": "attachments", "Key": "sdk.txt"}, ExpiresIn=900
)
print(url)

A presigned URL carries the signing principal’s permissions and cannot grant access that the signer lacks. If signed by temporary STS credentials, the URL stops working when the session expires even if ExpiresIn is longer.

To allow browser uploads or downloads from another origin, configure a bucket CORS rule with an administrative profile (silo-admin):

aws configure --profile silo-admin
aws configure set s3.addressing_style path --profile silo-admin
aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api put-bucket-cors \
  --bucket attachments \
  --cors-configuration '{"CORSRules":[{"AllowedOrigins":["https://app.example.net"],"AllowedMethods":["GET","PUT","HEAD"],"AllowedHeaders":["*"],"ExposeHeaders":["ETag"],"MaxAgeSeconds":600}]}'
curl --cacert "$AWS_CA_BUNDLE" -i -X OPTIONS "$SILO_ENDPOINT/attachments/cors-demo.txt" \
  -H 'Origin: https://app.example.net' \
  -H 'Access-Control-Request-Method: PUT' \
  -H 'Access-Control-Request-Headers: content-type'

A matching preflight request returns the allowed origin and methods in the response headers; a rejected preflight returns HTTP 403 (AccessForbidden). CORS headers do not bypass SigV4 signing or IAM authorization.

2.3 - Versioning

Enable versioning, read old versions and work with delete markers.
Note

Bucket versioning is a Supported MVP feature. Lifecycle rules, Object Lock and hard bucket quotas described in the second half of this page are Preview features.

This tutorial enables bucket versioning, writes multiple versions of an object, reads a historical version by VersionId, and configures lifecycle expiration and a hard bucket quota. Use the silo-admin profile and mcli_pg alias from the Quick start and Use an S3 SDK.

Retain and read historical versions

Create a dedicated version-demo bucket, enable versioning, write two versions of note.txt, and fetch the first version by its VersionId:

aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api create-bucket --bucket version-demo
aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api put-bucket-versioning \
  --bucket version-demo --versioning-configuration Status=Enabled
printf 'version one\n' > "$SILO_TUTORIAL_DIR/version-one.txt"
printf 'version two\n' > "$SILO_TUTORIAL_DIR/version-two.txt"
SILO_VERSION_1="$(aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api put-object \
  --bucket version-demo --key note.txt --body "$SILO_TUTORIAL_DIR/version-one.txt" --query VersionId --output text)"
aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api put-object \
  --bucket version-demo --key note.txt --body "$SILO_TUTORIAL_DIR/version-two.txt"
aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api list-object-versions --bucket version-demo
aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api get-object \
  --bucket version-demo --key note.txt --version-id "$SILO_VERSION_1" "$SILO_TUTORIAL_DIR/version-one.download.txt"
cmp "$SILO_TUTORIAL_DIR/version-one.txt" "$SILO_TUTORIAL_DIR/version-one.download.txt"

In a versioned bucket, calling delete-object without --version-id inserts a delete marker while preserving prior versions. Permanently deleting a specific version requires passing --version-id and holding s3:DeleteObjectVersion. Reading a historical version requires s3:GetObjectVersion.

Suspending versioning (Status=Suspended) switches new writes to null-version semantics without deleting existing historical versions.

Lifecycle rules and bucket quotas

Create a lifecycle-demo bucket and apply a lifecycle rule that expires current objects under tmp/ after 7 days and aborts incomplete multipart uploads after 1 day:

aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api create-bucket --bucket lifecycle-demo
aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api put-bucket-lifecycle-configuration \
  --bucket lifecycle-demo \
  --lifecycle-configuration '{"Rules":[{"ID":"temporary-files","Status":"Enabled","Filter":{"Prefix":"tmp/"},"Expiration":{"Days":7},"AbortIncompleteMultipartUpload":{"DaysAfterInitiation":1}}]}'

A background worker on a writable gateway scans for eligible objects under a database lease. Expiring historical versions requires a NoncurrentVersionExpiration rule. Remote storage-class transition rules (Transition / NoncurrentVersionTransition) are not supported and are rejected.

Hard bucket quotas count the committed object bodies and annotations of all live and historical versions (excluding delete markers). Unfinished multipart parts consume physical table space immediately, but count toward the logical bucket quota only when CompleteMultipartUpload publishes the object:

mcli_pg quota set pg-admin/attachments --size 1GiB
mcli_pg quota info pg-admin/attachments

Deleting versions releases logical quota immediately, whereas physical disk space is reclaimed and reused asynchronously by PostgreSQL VACUUM. See Storage layout for details.

2.4 - Encryption

SSE-C and static-key SSE-S3, and what they protect.

This tutorial configures static-key SSE-S3 (AES256) on a gateway and bucket, then runs a round-trip write and read with a client-supplied SSE-C customer key. Complete Install and Use an S3 SDK first.

Configure static-key SSE-S3

Generate a 32-byte key file once on the gateway host (refusing to overwrite an existing key file):

sudo sh -c 'set -eu; umask 027; test ! -e /etc/silo/kms.key; set -C; { printf "silo-key-1:"; openssl rand -base64 32; } > /etc/silo/kms.key; chown root:silo /etc/silo/kms.key; chmod 0640 /etc/silo/kms.key'

Back up the exact key ID (silo-key-1) and raw key bytes outside the database, and copy the identical /etc/silo/kms.key file to every gateway that connects to this PostgreSQL database.

Add MINIO_KMS_SECRET_KEY_FILE to /etc/default/silo (do not set MINIO_KMS_SECRET_KEY at the same time):

MINIO_KMS_SECRET_KEY_FILE="/etc/silo/kms.key"

Restart the gateway, enable default AES256 encryption on a new encrypted-demo bucket, and verify an encrypted upload and download:

sudo systemctl restart silo
aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api create-bucket --bucket encrypted-demo
aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api put-bucket-encryption \
  --bucket encrypted-demo \
  --server-side-encryption-configuration '{"Rules":[{"ApplyServerSideEncryptionByDefault":{"SSEAlgorithm":"AES256"}}]}'
aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api put-object \
  --bucket encrypted-demo --key hello.txt --body "$SILO_TUTORIAL_DIR/hello.txt"
aws --profile silo-admin --endpoint-url "$SILO_ENDPOINT" --region us-east-1 s3api get-object \
  --bucket encrypted-demo --key hello.txt "$SILO_TUTORIAL_DIR/encrypted.download.txt"
cmp "$SILO_TUTORIAL_DIR/hello.txt" "$SILO_TUTORIAL_DIR/encrypted.download.txt"

If the static key is missing or wrong, encryption and decryption requests fail closed; the gateway never falls back to plaintext. Losing the external key makes encrypted objects in PostgreSQL unrecoverable. See Backup and restore.

External KMS integration and SSE-KMS (aws:kms) are not supported. The silo_api SQL interface cannot decrypt SSE-S3 or SSE-C bodies, and buckets with default encryption reject SQL put_object writes.

Use a client-held SSE-C key

With SSE-C, the client supplies the 32-byte key on every write and read over HTTPS. Save the following script as ~/.local/share/silo-tutorial/sse-c.py:

import base64
import hashlib
import os
from pathlib import Path

import boto3
from botocore.config import Config

key_path = Path.home() / ".local/share/silo-tutorial/sse-c.key"
key_path.parent.mkdir(parents=True, exist_ok=True)
if key_path.exists():
    key = key_path.read_bytes()
else:
    key = os.urandom(32)
    descriptor = os.open(key_path, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o600)
    with os.fdopen(descriptor, "wb") as output:
        output.write(key)
if len(key) != 32:
    raise ValueError("SSE-C key must contain exactly 32 bytes")

session = boto3.Session(profile_name="silo-admin", region_name="us-east-1")
s3 = session.client(
    "s3",
    endpoint_url=os.environ["SILO_ENDPOINT"],
    verify=os.environ["AWS_CA_BUNDLE"],
    config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)
customer_headers = {
    "SSECustomerAlgorithm": "AES256",
    "SSECustomerKey": base64.b64encode(key).decode("ascii"),
    "SSECustomerKeyMD5": base64.b64encode(
        hashlib.md5(key, usedforsecurity=False).digest()
    ).decode("ascii"),
}
s3.create_bucket(Bucket="customer-key-demo")
s3.put_object(
    Bucket="customer-key-demo",
    Key="private.txt",
    Body=b"protected by a client-held key\n",
    **customer_headers,
)
response = s3.get_object(
    Bucket="customer-key-demo", Key="private.txt", **customer_headers
)
try:
    assert response["Body"].read() == b"protected by a client-held key\n"
    print("SSE-C round trip succeeded")
finally:
    response["Body"].close()

Run "$HOME/.local/share/silo-tutorial/venv/bin/python" "$HOME/.local/share/silo-tutorial/sse-c.py". It prints SSE-C round trip succeeded.

SSE-C requests require verified HTTPS; HTTP SSE-C requests are rejected. Back up the 32 bytes in sse-c.key independently — the gateway’s static SSE-S3 key cannot decrypt SSE-C objects.

2.5 - Annotations and ZIP

Attach annotations to objects and extract ZIP archives on upload.
Note

Object annotations (?annotation) and ZIP member extraction (x-minio-extract) are Preview features in the MVP scope. Annotations also depend on four silo-pkg policy actions (s3:*ObjectAnnotation*) that have not been published to the public silo-pkg repository yet, and the general Silo Console (2.6.0) does not include an annotation UI.

This tutorial uses SigV4-signed Python requests to write, read, list and delete object annotations, and to list and read members inside an uploaded ZIP archive without unpacking it into separate S3 objects. Complete Use an S3 SDK first.

Interfaces and permissions

An annotation is attached to a specific parent object version. Each annotation body must be valid UTF-8 text between 1 byte and 1 MiB, and each parent version accepts at most 1,000 annotation names. Updating or deleting an annotation leaves the parent object’s body, ETag and Last-Modified timestamp unchanged.

OperationSigV4-signed HTTP requestRequired IAM action
Create or replacePUT /attachments/<key>?annotation=&annotationName=labels.jsons3:PutObjectAnnotation
Read bodyGET /attachments/<key>?annotation=&annotationName=labels.jsons3:GetObjectAnnotation
List namesGET /attachments/<key>?annotation=s3:ListObjectAnnotations
DeleteDELETE /attachments/<key>?annotation=&annotationName=labels.jsons3:DeleteObjectAnnotation

Standard object actions (s3:GetObject, s3:PutObject) do not grant annotation access. Pass versionId in the query string to target a historical version, or x-amz-object-if-match on PUT/DELETE to require a matching parent ETag. Annotation bodies inherit the parent object’s server-side encryption mode.

To read or list members inside a ZIP archive stored as an S3 object, include header x-minio-extract: true:

  • Read or stat a member: GET or HEAD /attachments/demo.zip/readme.txt with x-minio-extract: true.
  • List archive members: GET /attachments?list-type=2&prefix=demo.zip/ with x-minio-extract: true.

ZIP extraction reads directly from the parent object snapshot without persisting member objects or an index table. It supports Store and Deflate compression (plus bounded ZIP64), up to 10,000 central-directory entries, and up to 256 MiB per uncompressed member. Range and partNumber requests on ZIP members are not supported.

Complete Python example

Because standard S3 SDKs do not have built-in methods for ?annotation or x-minio-extract, sign the requests with botocore.auth.SigV4Auth. Save the script below as ~/.local/share/silo-tutorial/extensions.py:

import hashlib
import io
import json
import os
import ssl
import urllib.request
import zipfile
from urllib.parse import quote, urlencode

import boto3
from botocore.auth import SigV4Auth
from botocore.awsrequest import AWSRequest
from botocore.config import Config

endpoint = os.environ["SILO_ENDPOINT"].rstrip("/")
ca = os.environ["AWS_CA_BUNDLE"]
region = "us-east-1"
session = boto3.Session(profile_name="silo-admin", region_name=region)
credentials = session.get_credentials().get_frozen_credentials()
context = ssl.create_default_context(cafile=ca)

def signed_request(method, key, query=None, body=None, headers=None):
    url = endpoint + "/attachments/" + quote(key, safe="/")
    if query is not None:
        url += "?" + urlencode(query)
    request_headers = dict(headers or {})
    request_headers["x-amz-content-sha256"] = hashlib.sha256(body or b"").hexdigest()
    signed = AWSRequest(method=method, url=url, data=body, headers=request_headers)
    SigV4Auth(credentials, "s3", region).add_auth(signed)
    prepared = signed.prepare()
    request = urllib.request.Request(
        prepared.url, data=body, headers=dict(prepared.headers), method=method
    )
    with urllib.request.urlopen(request, context=context, timeout=60) as response:
        return response.status, response.read()

s3 = session.client(
    "s3",
    endpoint_url=endpoint,
    verify=ca,
    config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)
parent = "extensions/invoice.txt"
s3.put_object(Bucket="attachments", Key=parent, Body=b"invoice 1001\n")
query = {"annotation": "", "annotationName": "labels.json"}
body = json.dumps({"invoice_id": 1001, "status": "paid"}).encode("utf-8")
print(signed_request("PUT", parent, query, body, {"Content-Type": "application/json"})[0])
print(signed_request("GET", parent, query)[1].decode("utf-8"))
print(signed_request("GET", parent, {"annotation": ""})[1].decode("utf-8"))
print(signed_request("DELETE", parent, query)[0])

archive = io.BytesIO()
with zipfile.ZipFile(archive, "w", compression=zipfile.ZIP_DEFLATED) as output:
    output.writestr("readme.txt", "hello from ZIP\n")
s3.put_object(Bucket="attachments", Key="demo.zip", Body=archive.getvalue())
print(signed_request("GET", "demo.zip/readme.txt", headers={"x-minio-extract": "true"})[1].decode("utf-8"))
print(signed_request("HEAD", "demo.zip/readme.txt", headers={"x-minio-extract": "true"})[0])
print(signed_request("GET", "", {"list-type": "2", "prefix": "demo.zip/"},
                     headers={"x-minio-extract": "true"})[1].decode("utf-8"))

Run the script:

"$HOME/.local/share/silo-tutorial/venv/bin/python" "$HOME/.local/share/silo-tutorial/extensions.py"

The script prints the PUT status (200), the annotation JSON, the annotation list XML, the DELETE status (204), the extracted hello from ZIP member content, the HEAD status (200), and the ListObjectsV2 XML for demo.zip/. See Annotations and ZIP extraction for full protocol rules and error codes.

2.6 - Multipart, Object Lock and STS

Multipart uploads, retention and legal hold, and temporary credentials.
Note

Multipart uploads, S3 bucket notifications and IAM service accounts are Supported MVP features. Object Lock (retention and legal hold), the silo_api SQL transactional outbox and Basic AssumeRole STS are Preview features.

This tutorial covers five multi-step workflows: multipart uploads with failure cleanup, Object Lock retention and legal hold, S3 bucket webhook notifications, a transactional SQL outbox committed with an object, and service accounts / Basic AssumeRole STS credentials. Complete Use an S3 SDK first.

Multipart uploads and failure cleanup

Every multipart part except the final part must be at least 5 MiB, and the assembled object must fit within the store’s maximum object size (256 MiB by default, up to 1 GiB if configured at initialization).

The script below uploads a 5 MiB part and a short final part, lists the uploaded parts, completes the upload in part-number order, and aborts the upload in finally if completion did not succeed:

import os
import boto3
from botocore.config import Config

session = boto3.Session(profile_name="silo-admin", region_name="us-east-1")
s3 = session.client(
    "s3",
    endpoint_url=os.environ["SILO_ENDPOINT"],
    verify=os.environ["AWS_CA_BUNDLE"],
    config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)

bucket, key = "attachments", "workflows/multipart.bin"
chunks = [b"A" * (5 * 1024 * 1024), b"last part\n"]
upload_id = s3.create_multipart_upload(Bucket=bucket, Key=key)["UploadId"]
completed = False
try:
    parts = []
    for number, chunk in enumerate(chunks, start=1):
        part = s3.upload_part(
            Bucket=bucket, Key=key, UploadId=upload_id, PartNumber=number, Body=chunk
        )
        parts.append({"PartNumber": number, "ETag": part["ETag"]})
    listed = s3.list_parts(Bucket=bucket, Key=key, UploadId=upload_id)
    assert [p["PartNumber"] for p in listed["Parts"]] == [1, 2]
    s3.complete_multipart_upload(
        Bucket=bucket, Key=key, UploadId=upload_id, MultipartUpload={"Parts": parts}
    )
    completed = True
finally:
    if not completed:
        s3.abort_multipart_upload(Bucket=bucket, Key=key, UploadId=upload_id)

response = s3.get_object(Bucket=bucket, Key=key)
try:
    assert response["Body"].read() == b"".join(chunks)
    print("Multipart upload verified")
finally:
    response["Body"].close()

In addition to s3:PutObject and s3:GetObject, application policies need s3:AbortMultipartUpload for cleanup and s3:ListMultipartUploadParts to list parts (plus s3:ListBucketMultipartUploads to list active uploads in a bucket). Because a process crash can skip finally, also configure an AbortIncompleteMultipartUpload lifecycle rule (see Versioning).

Object Lock, retention and legal hold

Enabling Object Lock when creating a bucket also enables versioning. The script below creates lock-demo with 1 day of default GOVERNANCE retention, writes a version, extends its retention to 2 days, enables legal hold, verifies that deleting the version returns AccessDenied, and then clears the legal hold:

import base64
import hashlib
import os
from datetime import datetime, timedelta, timezone
import boto3
from botocore.config import Config
from botocore.exceptions import ClientError

session = boto3.Session(profile_name="silo-admin", region_name="us-east-1")
s3 = session.client(
    "s3",
    endpoint_url=os.environ["SILO_ENDPOINT"],
    verify=os.environ["AWS_CA_BUNDLE"],
    config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)

bucket, key = "lock-demo", "retained.txt"
s3.create_bucket(Bucket=bucket, ObjectLockEnabledForBucket=True)
s3.put_object_lock_configuration(
    Bucket=bucket,
    ObjectLockConfiguration={
        "ObjectLockEnabled": "Enabled",
        "Rule": {"DefaultRetention": {"Mode": "GOVERNANCE", "Days": 1}},
    },
)
body = b"retain this version\n"
created = s3.put_object(
    Bucket=bucket,
    Key=key,
    Body=body,
    ContentMD5=base64.b64encode(hashlib.md5(body, usedforsecurity=False).digest()).decode("ascii"),
)
version = created["VersionId"]
s3.put_object_retention(
    Bucket=bucket,
    Key=key,
    VersionId=version,
    Retention={
        "Mode": "GOVERNANCE",
        "RetainUntilDate": datetime.now(timezone.utc) + timedelta(days=2),
    },
)
s3.put_object_legal_hold(
    Bucket=bucket, Key=key, VersionId=version, LegalHold={"Status": "ON"}
)
print(s3.get_object_retention(Bucket=bucket, Key=key, VersionId=version)["Retention"])
print(s3.get_object_legal_hold(Bucket=bucket, Key=key, VersionId=version)["LegalHold"])
try:
    s3.delete_object(Bucket=bucket, Key=key, VersionId=version)
except ClientError as error:
    if error.response["Error"]["Code"] != "AccessDenied":
        raise
    print("Protected version deletion denied")
else:
    raise AssertionError("Protected version was unexpectedly deleted")
s3.put_object_legal_hold(
    Bucket=bucket, Key=key, VersionId=version, LegalHold={"Status": "OFF"}
)

Calling delete_object without VersionId creates a delete marker without removing the protected version. Bypassing GOVERNANCE retention requires the explicit bypass header and s3:BypassGovernanceRetention; active COMPLIANCE retention cannot be bypassed. The silo_api SQL interface enforces retention and legal hold on mutations and provides no governance bypass.

S3 bucket event notifications

To send S3 request-path events to an HTTPS webhook receiver, configure the same webhook target ID (APP) in /etc/default/silo on every writable gateway and restart the gateways:

MINIO_NOTIFY_WEBHOOK_ENABLE_APP="on"
MINIO_NOTIFY_WEBHOOK_ENDPOINT_APP="https://events.example.net/silo"
MINIO_NOTIFY_WEBHOOK_AUTH_TOKEN_APP="REPLACE_WITH_RECEIVER_TOKEN"

Then attach a notification rule using the QueueArn arn:minio:sqs:<region>:<target-id>:webhook:

import os
import boto3
from botocore.config import Config

session = boto3.Session(profile_name="silo-admin", region_name="us-east-1")
s3 = session.client(
    "s3",
    endpoint_url=os.environ["SILO_ENDPOINT"],
    verify=os.environ["AWS_CA_BUNDLE"],
    config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)

bucket = "notification-demo"
s3.create_bucket(Bucket=bucket)
s3.put_bucket_notification_configuration(
    Bucket=bucket,
    NotificationConfiguration={
        "QueueConfigurations": [
            {
                "Id": "application-events",
                "QueueArn": "arn:minio:sqs:us-east-1:APP:webhook",
                "Events": ["s3:ObjectCreated:*", "s3:ObjectRemoved:*"],
                "Filter": {"Key": {"FilterRules": [{"Name": "suffix", "Value": ".txt"}]}},
            }
        ],
    },
)
s3.put_object(Bucket=bucket, Key="event.txt", Body=b"notification example\n")
s3.delete_object(Bucket=bucket, Key="event.txt")

S3 webhook delivery runs asynchronously after S3 HTTP requests commit; receivers must tolerate retries and duplicates. Direct SQL writes through silo_api do not trigger S3 bucket notifications.

Commit an SQL outbox with the object

When an event must commit or roll back atomically with a business row and an object, write to an application-owned outbox table in the same Read Committed SQL transaction (continuing the app_sql setup from Objects from SQL):

CREATE TABLE app_demo.outbox (
  event_id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
  event_type text NOT NULL,
  payload jsonb NOT NULL,
  created_at timestamptz NOT NULL DEFAULT clock_timestamp(),
  delivered_at timestamptz
);

BEGIN ISOLATION LEVEL READ COMMITTED;
WITH written AS (
  SELECT * FROM silo_api.put_object(
    'attachments', 'invoices/1003.txt',
    convert_to('invoice 1003 amount 399.00', 'UTF8'), 'text/plain'
  )
), invoice AS (
  INSERT INTO app_demo.invoices
    (invoice_id, object_key, object_id, object_version, amount)
  SELECT 1003, 'invoices/1003.txt', object_id, version_id, 399.00 FROM written
  RETURNING invoice_id, object_key, object_version
)
INSERT INTO app_demo.outbox (event_type, payload)
SELECT 'invoice.ready', jsonb_build_object(
  'invoice_id', invoice_id, 'bucket', 'attachments',
  'key', object_key, 'version_id', object_version
) FROM invoice;
COMMIT;

An application worker polls app_demo.outbox, delivers the event idempotently by event_id, and sets delivered_at.

Service accounts and temporary STS identities

To issue a scoped service account under app-s3 without sharing the parent user’s secret key:

(
  umask 077
  set -o noclobber
  mcli_pg --json admin user svcacct add pg-admin app-s3 --name attachments-service > "$SILO_CLIENT_CONFIG/attachments-service.json"
)
mcli_pg admin user svcacct list pg-admin app-s3

To request 15-minute (900-second) temporary credentials over Basic AssumeRole STS, sign AssumeRole with an ordinary IAM user (silo-app). Service accounts and existing STS credentials cannot call Basic AssumeRole, and lifetimes below 900 seconds are rejected:

import json
import os
import boto3
from botocore.config import Config

parent = boto3.Session(profile_name="silo-app", region_name="us-east-1")
endpoint, ca = os.environ["SILO_ENDPOINT"], os.environ["AWS_CA_BUNDLE"]
sts = parent.client(
    "sts", endpoint_url=endpoint, verify=ca, config=Config(signature_version="v4")
)
limited_policy = {
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": ["s3:GetObject"],
            "Resource": ["arn:aws:s3:::attachments/sdk.txt"],
        }
    ],
}
credentials = sts.assume_role(
    RoleArn="arn:aws:iam::123456789012:role/silo-session",
    RoleSessionName="read-sdk-object",
    DurationSeconds=900,
    Policy=json.dumps(limited_policy),
)["Credentials"]
temporary = boto3.client(
    "s3",
    endpoint_url=endpoint,
    region_name="us-east-1",
    verify=ca,
    aws_access_key_id=credentials["AccessKeyId"],
    aws_secret_access_key=credentials["SecretAccessKey"],
    aws_session_token=credentials["SessionToken"],
    config=Config(signature_version="s3v4", s3={"addressing_style": "path"}),
)
response = temporary.get_object(Bucket="attachments", Key="sdk.txt")
try:
    print(response["Body"].read().decode("utf-8"))
finally:
    response["Body"].close()
print("Expires:", credentials["Expiration"].isoformat())

The inline session Policy further narrows the parent user’s effective permissions; it never expands them. RoleArn is accepted for S3/STS wire compatibility and does not reference an external AWS IAM role.

3 - Compatibility

Supported S3 APIs, feature tiers, unsupported features and known differences.

This page summarizes the MVP support tiers, protocol boundaries, and behavioral differences between S3 HTTP and the silo_api SQL interface in schema 14. For build identifiers and test results, see Status.

MVP support tiers

The PostgreSQL backend is planned as an experimental storage backend inside Silo. Features are divided into Supported, Preview and Not supported tiers:

TierScope
SupportedSingle PostgreSQL primary (versions 16–18) with one or more writable gateways (linux/amd64 and linux/arm64)
SupportedBucket and object CRUD, ListObjects V1 and V2, object versions and delete markers
SupportedConditional requests, Range, CopyObject, UploadPartCopy, tagging, multipart upload and checksums
SupportedPresigned URLs, POST policy uploads and CORS
SupportedIAM users, groups, policies and service accounts
SupportedSSE-C, and AES256 SSE-S3 with the built-in static KMS
SupportedUnified object and relational backup through PostgreSQL physical backup and PITR
PreviewSQL transaction API (silo_api), PostgreSQL native authorization (silo_bucket) and Basic AssumeRole STS
PreviewLifecycle expiration and incomplete-multipart cleanup, Object Lock (retention and legal hold) and hard bucket quotas
PreviewObject annotations (?annotation), ZIP member extraction (x-minio-extract) and read-only hot standby gateways
Not supportedSSE-KMS and external KMS; bucket and site replication; remote-tier transitions and restores
Not supportedErasure-coded disk management, drive healing, S2 object compression and external etcd IAM storage
Not supportedObjects larger than 1 GiB (default limit 256 MiB), high-throughput workloads and automatic HA failover RPO guarantees

Preview features ship with the backend, but later releases may change them without compatibility guarantees. The MVP uses the general Silo Console (2.6.0), which does not include an annotation interface.

Data and protocol boundaries

AreaPostgreSQL backend behavior
PostgreSQLVersion 16 or later; direct connections; ordinary non-superuser database owner for gateways; no PgBouncer transaction pooling
S3 object sizeDefault 256 MiB; configurable at store initialization up to 1 GiB; applies to completed multipart objects as well
StreamingSegmented bytea I/O; default segment 8 MiB, configurable from 1 MiB to 64 MiB
SQL bodiesInline read, write and copy up to min(store limit, 256 MiB); bounded read_object up to 8 MiB per call
Force bucket deletionAtomically removes all versions, delete markers and unfinished uploads; requires both s3:DeleteBucket and s3:ForceDeleteBucket; Object Lock buckets return HTTP 405
S3 SelectParser and execution path present with explicit error responses; not part of the MVP checklist — verify required SQL and serialization formats before relying on it
EncryptionSSE-C and AES256 SSE-S3 with the built-in static KMS; SSE-KMS and external KMS requests are rejected
IAM and authorizationPersistent users, groups, policies, service accounts and Basic AssumeRole STS; optional IAM AND PostgreSQL native authorization
Object LockGovernance retention, compliance retention and legal hold enforced across S3 and SQL mutation paths; SQL has no governance bypass
LifecycleCurrent/noncurrent version expiration, expired delete-marker cleanup and incomplete-multipart abort under database leases; transition rules are rejected
Bucket quotaAtomic hard quota over committed object bodies plus annotation bytes across versions; unfinished multipart parts are charged upon completion
AnnotationsAdded in schema 13; up to 1,000 UTF-8 payloads of 1 B–1 MiB per parent version; requires unpublished silo-pkg policy actions
ZIP extractionAdded in schema 13; read-only member GET/HEAD and ListObjectsV2 from a single parent snapshot; no persistent member index
NotificationsS3 request-path notifications with bounded background delivery; direct SQL writes emit no S3 bucket notifications

See the S3 API reference for checksum algorithms and headers, and Storage layout for schema and segment details.

Region and CORS behavior

All gateways, client signatures and CreateBucket location constraints must use the same effective region (see Configuration). Notification ARNs include the effective region: arn:minio:sqs:us-east-1:<target-id>:webhook when set to us-east-1, or arn:minio:sqs::<target-id>:webhook when the region is empty.

When a request includes Origin, an explicit Access-Control-Request-Method header selects only the bucket CORS response headers; it does not alter the HTTP method, signature verification, IAM or native authorization. Bucket CORS responses include Origin and Access-Control-Request-Method in Vary (and Access-Control-Request-Headers on preflight responses). Rejected preflight requests return HTTP 403 with AccessForbidden.

Differences from erasure-coded mode

PostgreSQL mode has no local object volumes, erasure sets, drive quorum, parity tuning, drive healing, pool expansion or decommissioning. PostgreSQL manages durability and replication. Do not reuse an erasure-coded configuration unchanged.

A gateway does not own exclusive physical disk capacity. Logical object usage, physical database size and cluster-wide WAL are separate metrics. The Console and monitoring endpoints report physical capacity as Unknown when unavailable or unauthorized rather than reporting zero or claiming the entire database disk as Silo capacity.

A writable gateway connected to the primary runs the background maintenance worker that reclaims unlinked annotation bodies. Unlinking releases logical quota immediately while physical deletion completes asynchronously. Read-only standby gateways do not run this worker.

Consistency and availability boundaries

Object publication, multipart completion, quota accounting and retention checks execute inside PostgreSQL transactions. Separate S3 HTTP requests are separate transactions. Direct SQL via silo_api can modify business tables and S3 objects atomically inside a single Read Committed transaction.

Each gateway opens at most 32 PostgreSQL connections by default (4 control, 2 coordination, 26 data). Above 32 concurrent S3 API requests on a gateway, additional requests queue for up to SILO_PG_QUEUE_TIMEOUT (5 s by default) and then receive HTTP 503 SlowDown, starting with 1d387725c (2026-11-08). Earlier builds, including 299378b and 3c7fdc03, reject them at once with HTTP 429 TooManyRequests. See Configuration for sizing.

Standby gateway reads can observe replication lag or be canceled by PostgreSQL recovery conflicts. If a client loses its connection during commit, the application must verify whether the write succeeded. Restoring a logical pg_dump into a new cluster does not preserve role-OID authorization mappings; see Backup and restore.

Choosing between S3 and SQL

RequirementS3 HTTPPublic SQL API (silo_api)
Atomic transaction with business rowsSeparate HTTP requests cannot join a SQL transactionCommits or rolls back together in one Read Committed transaction (Preview)
IdentityS3 IAM, optionally combined with PostgreSQL bucket privileges (AND)PostgreSQL session_user, function grants and silo_bucket ACL (SET ROLE rejected)
Object sizeSegmented streaming up to the store limit (256 MiB default, 1 GiB max)Inline bodies capped at min(store limit, 256 MiB); read_object returns at most 8 MiB per call
EncryptionSSE-C and static-key AES256 SSE-S3Ciphertext reads and copies are rejected; default-encrypted buckets reject SQL writes
Retention and legal holdFull S3 management APIs and explicit governance bypassEnforces the same retention and legal hold rules; no management or bypass parameters
AnnotationsDedicated ?annotation CRUD and list APIsNo annotation CRUD; plaintext copy_object can retain source annotations if authorized
Bucket notificationsEmits configured S3 bucket eventsEmits no S3 bucket events; use a transactional outbox table in SQL
Force bucket deletionSupported with s3:ForceDeleteBucket (except on Object Lock buckets)drop_bucket only drops empty buckets
ListingFull ListObjects V1/V2 and ListObjectVersions parameterslist_objects uses prefix and key-cursor pagination, returning at most 1,000 rows

4 - Architecture

Stateless gateways, the PostgreSQL ObjectLayer, schemas, and the read and write paths.

pgsilo is the PostgreSQL storage backend for Silo (internal/pgstore and cmd/pg-*), serving S3 as a service API protocol. Stateless Silo gateways handle the S3 wire protocol, SigV4 authentication, IAM evaluation, encryption and the Console front end. PostgreSQL stores object bodies, versions, multipart state, bucket configuration, IAM state and background maintenance leases.

flowchart LR
    S3["S3 clients and Console"] --> GW["Silo gateway"]
    APP["Business application"] --> SQL["silo_api public SQL functions"]
    GW --> PG[("PostgreSQL primary")]
    SQL --> PG
    PG -->|"Physical replication"| REPLICA[("PostgreSQL standby")]
    RGW["Read-only Silo gateway"] --> REPLICA
    GW --> KEYS["Externally retained TLS and encryption keys"]

Persistent data and schemas

Gateways keep no persistent local object directory. PostgreSQL stores object bodies as bytea segments of 8 MiB by default (configurable from 1 MiB to 64 MiB). The default object size limit is 256 MiB, and can be set up to 1 GiB when initializing the store. Object metadata and segments become visible in the same database transaction; concurrent readers never see half-written objects.

The database uses three schemas with separate responsibilities:

SchemaPurposeApplication access
siloPrivate object bodies, metadata, versions, IAM, coordination and maintenance stateDo not grant access
silo_apiEleven public SQL functions for object and bucket operationsGrant explicit EXECUTE on required functions
silo_bucketOne ACL relation per bucket for PostgreSQL native authorizationGrant explicit SELECT, INSERT, DELETE and other required privileges

A bucket’s name is distinct from its internal identity and ACL relation. Deleting and recreating a bucket with the same name creates a new bucket identity and a new ACL relation in silo_bucket; previous grants, annotations and in-flight requests do not carry over.

Two access paths

Before an S3 HTTP request touches storage, the gateway verifies its SigV4 signature, S3 IAM permissions and bucket policy. When joint authorization (IAM AND PostgreSQL native authorization) is enabled, the gateway also checks the PostgreSQL privileges of the mapped role on silo_bucket.<bucket>. Each S3 HTTP request executes in its own database transactions and cannot join an application’s open SQL transaction.

A SQL application connects to PostgreSQL under its own login role and calls silo_api functions. It can modify business tables and S3 objects atomically inside a single Read Committed transaction. The SQL API identifies callers through session_user and rejects SET ROLE impersonation. The database owner (silo_owner) and its role members are blocked from calling silo_api.

The SQL API is intentionally narrower than S3 HTTP: it does not expose multipart upload APIs, annotation CRUD, SSE ciphertext decryption, Object Lock administration or governance-retention bypass, and direct SQL writes do not emit S3 bucket notifications. Applications that need reliable event delivery from SQL transactions should write to an application-owned transactional outbox table. See the SQL API reference.

Requests, connections and memory

Each gateway splits its PostgreSQL connections across three pools. With the default limit of 32 connections (SILO_PG_MAX_CONNS=32), 4 connections are reserved for the control pool, 2 for the coordination pool, and 26 for the data pool:

  • Data pool (26): serves object reads, writes, listings and CopyObject (which requires at least two data connections).
  • Control pool (4): serves bucket configuration and metadata lookups so long object transfers cannot starve control operations.
  • Coordination pool (2): reserves connections for IAM writes, LISTEN/NOTIFY revision channels and lease heartbeats.

Above 32 concurrent S3 API requests on a single gateway, additional requests wait for a free slot for up to SILO_PG_QUEUE_TIMEOUT (5 s by default) without holding a database connection, then receive HTTP 503 SlowDown, which SDKs retry. This queue was added in 1d387725c (2026-11-08); earlier builds, including 299378b and the frozen 3c7fdc03, answer HTTP 429 TooManyRequests at once. Segmented I/O bounds per-buffer memory, but each active stream still holds a connection, buffer memory and a database snapshot. See Configuration for pool settings.

Multiple gateways and authorization freshness

Multiple writable gateways connected to the same PostgreSQL primary share all buckets, objects and IAM state. Each gateway caches IAM state in memory and refreshes it via PostgreSQL LISTEN/NOTIFY plus periodic polling. Cached IAM state is valid for a bounded lease of at most 5 seconds; if a gateway cannot confirm a fresh revision token within the lease bound, it fails closed and rejects requests.

Read-only gateways (Preview) can connect to physical PostgreSQL standbys. Standby reads may lag behind the primary or be canceled by recovery conflicts. Standby authorization relies on continuous control heartbeats written by a writable gateway on the primary, and clocks between primary and standby hosts must differ by no more than 500 ms.

PostgreSQL high-availability tooling (such as Patroni) owns primary election and old-primary fencing. See High availability and IAM control plane for details.

Maintenance and recovery

Even if applications access objects exclusively through SQL, keep at least one writable Silo gateway connected to the PostgreSQL primary. The writable gateway maintains control-plane heartbeats and runs lease-guarded background workers for lifecycle expiration and unlinked annotation garbage collection. Read-only standby gateways cannot run these workers.

Durability and recovery rely on PostgreSQL WAL, physical backups and PITR, plus externally backed-up TLS certificates and KMS static keys. See Compatibility and Storage layout.

5 - Reference

Configuration, SQL API, S3 API, authorization, annotations, ZIP and storage.

This section documents the configuration variables, SQL functions, HTTP endpoints, authorization rules, and storage semantics of the pgsilo PostgreSQL backend (schema 14). For installation steps, see Installation. For component responsibilities, see Architecture.

Reference pages

PageCoverage
ConfigurationSILO_PG_* variables, connection pools, concurrent request queueing, TLS, region selection, and persistent store settings
SQL APISignatures, return columns, transaction rules, and SQLSTATE codes for all 11 public silo_api functions (Preview)
S3 APIBucket and object operations, multipart uploads, conditional requests, notifications, service accounts, and STS
AuthorizationDatabase owner vs. SQL application roles vs. S3 IAM, plus iam_and_pg joint authorization (Preview)
AnnotationsNamed UTF-8 text attachments on object versions, custom IAM actions, conditional parent checks, and copy directives (Preview)
ZIP extractionRead-only virtual member access via x-minio-extract: true, snapshot isolation, and archive resource bounds (Preview)
Storage layoutSegment layout, version lifecycles, Object Lock, SSE encryption, hard bucket quotas, and PostgreSQL space reclamation
CompatibilitySupported S3 operations, MVP vs. Preview classification, hard limits, and unsupported MinIO/EC features

5.1 - Configuration

Environment variables, connection pools, limits and startup options.

Set SILO_PG_DSN to enable the PostgreSQL backend. In PostgreSQL mode, silo server takes no filesystem directory arguments. Alternatively, pass a single postgres:// or postgresql:// URI on the command line. Do not combine both methods or add disk paths. For systemd services, store SILO_PG_DSN in a protected environment file so database passwords do not appear in process arguments.

PostgreSQL backend variables

VariableDefaultRange and semantics
SILO_PG_DSNNoneDirect connection to PostgreSQL 16+ as a trusted ordinary database owner
SILO_PG_READ_ONLYoffon enforces read-only gateway mode; skips initialization, schema migration, and background maintenance
SILO_PG_MAX_CONNS32Total database connection budget per gateway (5–1024)
SILO_PG_CONTROL_CONNS4Control-plane connection pool (1–64)
SILO_PG_COORD_CONNS2Coordination pool (2–64), including the dedicated revision LISTEN connection
SILO_PG_SEGMENT_SIZE8MiBSegment size (1MiB–64MiB), persisted in the database at initial setup
SILO_PG_MAX_OBJECT_SIZE256MiBMaximum object size (1MiB–1GiB), persisted at initial setup; applies to single PUT, copy, and completed multipart objects
SILO_PG_ACQUIRE_TIMEOUT5sConnection pool acquisition deadline (1ms–1m)
SILO_PG_REQUEST_TIMEOUT15mStorage request deadline (1ms–24h)
SILO_PG_QUEUE_TIMEOUT5sMaximum wait for a free concurrent request slot (0s–1m; 0s disables waiting). Added in 1d387725c (2026-11-08)

The data connection pool size equals SILO_PG_MAX_CONNS - SILO_PG_CONTROL_CONNS - SILO_PG_COORD_CONNS. The result must be at least 2 (26 with default settings). All three settings are validated together at startup: for example, SILO_PG_MAX_CONNS=5 is rejected if CONTROL_CONNS (4) and COORD_CONNS (2) remain at their defaults.

Use explicit byte units (MiB, GiB) and Go duration strings (500ms, 5s, 15m). Empty or unset variables use defaults; invalid values fail startup rather than silently falling back.

Concurrent request limit and queueing

Each gateway bounds the number of S3 requests executing concurrently to the smallest of three values:

  • SILO_PG_MAX_CONNS
  • Gateway memory limit divided by two segment buffers: memlimit / (2 * SILO_PG_SEGMENT_SIZE) (where memlimit comes from --memlimit or available system memory)
  • Configured api requests_max, if set

Starting with 1d387725c on feat/pg-backend (2026-11-08), requests above the limit wait in an admission queue for up to SILO_PG_QUEUE_TIMEOUT (5s by default). Queued requests do not hold database connections, and disconnected clients abort waiting immediately. When the queue timeout expires, the gateway returns HTTP 503 SlowDown, which AWS SDK for Go v2 and boto3 retry by default. Setting SILO_PG_QUEUE_TIMEOUT=0s disables queueing and returns HTTP 503 SlowDown immediately.

Note

Builds before 1d387725c, including 299378b and the frozen October 8, 2026 local schema 14 checkpoint (3c7fdc03), do not queue: requests above the limit receive HTTP 429 TooManyRequests immediately, which the AWS SDK for Go v2 and boto3 do not retry by default.

Admission queueing only absorbs short bursts. To sustain higher client concurrency:

  1. Raise SILO_PG_MAX_CONNS above the expected concurrent S3 request count (for example, 72 for 64 concurrent clients, leaving 66 data connections after the 4 control and 2 coordination connections).
  2. Ensure gateway memory accommodates 2 * SILO_PG_SEGMENT_SIZE per active slot (about 1.1 GiB for 72 slots at 8MiB segments).
  3. Raise PostgreSQL max_connections above the sum of SILO_PG_MAX_CONNS across all gateways plus application SQL roles, replication, maintenance, and superuser_reserved_connections.
  4. Restart the gateway.

Persistent vs. runtime parameters

Initial store creation writes SILO_PG_SEGMENT_SIZE and SILO_PG_MAX_OBJECT_SIZE into silo.meta. Every subsequent gateway startup (both read-write and read-only) must match the persisted values or the gateway refuses to start. Never edit silo.meta directly to alter segment or object size on an existing store.

Connection pool sizes and timeouts are per-gateway runtime parameters that take effect on gateway restart. Operation-specific bounds can terminate a request earlier than SILO_PG_REQUEST_TIMEOUT (for example, read-only ZIP extraction enforces a 1-minute ceiling).

An explicitly configured read-only gateway (SILO_PG_READ_ONLY=on) never promotes itself to writable. A writable gateway connected to a PostgreSQL standby in recovery also fails write transactions, but with database read-only errors rather than explicit gateway rejection.

Environment file example

The following template is suitable for a systemd EnvironmentFile (/etc/silo/silo-pg.env). Replace all placeholder values and restrict file permissions to 0600. Do not execute this file with source.

SILO_PG_DSN="postgresql://silo_owner:URL_ENCODED_PASSWORD@pg.example.net:5432/silo?sslmode=verify-full&sslrootcert=/etc/silo/postgres-ca.crt"
MINIO_ROOT_USER="REPLACE_WITH_ROOT_ACCESS_KEY"
MINIO_ROOT_PASSWORD="REPLACE_WITH_LONG_RANDOM_SECRET"
MINIO_REGION="us-east-1"
SILO_PG_READ_ONLY="off"
SILO_PG_MAX_CONNS="32"
SILO_PG_CONTROL_CONNS="4"
SILO_PG_COORD_CONNS="2"
SILO_PG_SEGMENT_SIZE="8MiB"
SILO_PG_MAX_OBJECT_SIZE="256MiB"
SILO_PG_ACQUIRE_TIMEOUT="5s"
SILO_PG_REQUEST_TIMEOUT="15m"
SILO_PG_QUEUE_TIMEOUT="5s"

URL-encode special characters in the DSN password. sslmode=verify-full validates both the PostgreSQL server certificate chain and hostname. Connections must connect directly to PostgreSQL or through a session-mode proxy that preserves LISTEN/NOTIFY, session state, and transactions; do not use a transaction-pooling proxy.

Start the gateway with:

silo server --address :9000 --console-address :9001 --certs-dir /etc/silo/certs

Place public.crt and private.key inside --certs-dir for S3 HTTPS termination. The PostgreSQL client CA (/etc/silo/postgres-ca.crt) and the S3 server TLS certificate (/etc/silo/certs/public.crt) secure different links. See Installation for systemd unit setup.

Region selection

The gateway determines its effective S3 region from the first non-empty source in this order:

  1. MINIO_REGION
  2. Legacy MINIO_REGION_NAME
  3. MINIO_SITE_REGION, falling back to the database-persisted site region setting when unset or empty
  4. Legacy database-persisted region name

Surrounding whitespace is trimmed from environment values, and a whitespace-only MINIO_SITE_REGION bypasses the persisted site region. Unset unused variables rather than setting them to spaces. If the selected non-empty value is invalid, startup fails immediately without falling back to lower-priority sources. All gateways sharing a database must resolve the same effective region.

Root credentials, encryption, and compatibility names

MINIO_* environment variable names are retained for compatibility with existing S3 tools and service templates. PGSTY and Silo are not affiliated with MinIO, Inc.

  • MINIO_ROOT_USER and MINIO_ROOT_PASSWORD define the S3 root credentials. All gateways attached to the same database must share identical root credentials, effective region, and SSE-S3 keys.
  • Built-in static SSE-S3 (AES256) uses MINIO_KMS_SECRET_KEY (key-name:base64-key) or MINIO_KMS_SECRET_KEY_FILE. Back up the static key before enabling default bucket encryption; losing the key makes encrypted objects permanently unreadable. See Encryption.
  • General Silo flags for erasure-coded disks, S2 object compression, external etcd IAM, SSE-KMS, and remote tiering do not apply to the PostgreSQL backend. See Compatibility.

5.2 - SQL API

The eleven silo_api functions, their arguments, permissions and limits.
Note

The public silo_api SQL interface is a Preview feature in the MVP release. Callers must connect with an ordinary application SQL role (never the installation owner) and execute write functions under Read Committed isolation.

The public SQL API consists of the 11 functions in the silo_api schema listed below. Functions and tables in the silo schema are private implementation internals and must not be called by applications.

Calling contract

  • Authorization checks session_user; SET ROLE is rejected. The installation owner (silo_owner) and its role members cannot call silo_api functions.
  • Callers need USAGE on silo_api, EXECUTE on each required function, and the corresponding table privileges on the bucket’s ACL relation in silo_bucket. Functions are not granted to PUBLIC. See Authorization.
  • Write functions require Read Committed (or PostgreSQL Read Uncommitted, which behaves identically). Calling write functions under Repeatable Read or Serializable raises SQLSTATE 0A000.
  • Object mutations and application table rows commit or roll back atomically in the same SQL transaction. Independent S3 HTTP requests do not join that transaction. Direct SQL writes do not emit S3 bucket event notifications.
  • Object keys are 1–1024 UTF-8 bytes; zero-length bytea bodies are valid. Passing SQL NULL for p_version_id targets the current version. To target an S3 null version explicitly, pass UUID '00000000-0000-0000-0000-000000000000' (not the string 'null').
  • Inline put_object, get_object, and copy_object bodies are capped at min(SILO_PG_MAX_OBJECT_SIZE, 256 MiB). read_object returns at most 8 MiB (8388608 bytes) per call.
  • SQL functions do not decrypt SSE-encrypted bodies or allow plaintext writes to bypass default bucket encryption. All SQL mutations obey synchronized bucket policies, hard bucket quotas, Object Lock retention, and legal holds, with no governance bypass parameter.

Object functions

put_object

silo_api.put_object(
  p_bucket text, p_key text, p_data bytea,
  p_content_type text DEFAULT 'application/octet-stream',
  p_user_meta jsonb DEFAULT '{}',
  p_if_none_match boolean DEFAULT false,
  p_if_match text DEFAULT NULL
)
RETURNS TABLE (
  object_id bigint, version_id uuid, etag text,
  size bigint, mod_time timestamptz
)

Requires INSERT on the destination bucket ACL relation. Setting p_if_none_match = true succeeds only when no current object body exists (a current delete marker does not block the write). p_if_match takes an unquoted ETag string, or '*' to require an existing current body. The two condition parameters are mutually exclusive and each additionally requires SELECT on the bucket. Conditions are evaluated atomically at publication.

p_user_meta must be a flat JSON object with string values (for example, '{"invoice-id":"1001"}'). Omit the x-amz-meta- prefix; the function normalizes keys and rejects reserved names, case-insensitive duplicates, CR/LF characters, and non-string values. Total normalized user metadata is capped at 2048 bytes, and p_content_type is capped at 1024 bytes without CR/LF.

stat_object

silo_api.stat_object(
  p_bucket text, p_key text, p_version_id uuid DEFAULT NULL
)
RETURNS TABLE (
  object_id bigint, version_id uuid,
  is_latest boolean, is_delete_marker boolean,
  size bigint, actual_size bigint, etag text, content_type text,
  user_meta jsonb, user_tags text, mod_time timestamptz,
  commit_seq bigint, encrypted boolean
)

Requires SELECT on the bucket. Returns metadata (including whether the selected version is a delete marker) without reading the object body or exposing private encryption keys. user_meta contains user metadata stripped of x-amz-meta- prefixes. size is the stored payload size and actual_size is the logical plaintext size.

get_object

silo_api.get_object(
  p_bucket text, p_key text, p_version_id uuid DEFAULT NULL
) RETURNS bytea

Requires SELECT on the bucket. Returns the complete plaintext body within the 256 MiB inline limit. Raises SO001 if the selected version is a delete marker or missing, and 0A000 if the object is encrypted.

read_object

silo_api.read_object(
  p_bucket text, p_key text,
  p_offset bigint DEFAULT 0, p_length bigint DEFAULT 8388608,
  p_version_id uuid DEFAULT NULL, p_object_id bigint DEFAULT NULL
)
RETURNS TABLE (
  object_id bigint, version_id uuid, offset_bytes bigint, data bytea
)

Requires SELECT on the bucket. p_offset must be >= 0 and not past the end of the object; p_length must be 0–8388608 (8 MiB). Reads crossing the end of the object are truncated. When p_object_id is non-NULL, the function verifies that the selected version still has that object_id and raises SO002 on mismatch. To keep multi-chunk reads consistent across statements, pin an immutable version_id or run inside a read-only Repeatable Read transaction.

list_objects

silo_api.list_objects(
  p_bucket text, p_prefix text DEFAULT '',
  p_after_key text DEFAULT NULL, p_limit integer DEFAULT 1000
)
RETURNS TABLE (
  object_id bigint, key text, version_id uuid, size bigint,
  etag text, content_type text, mod_time timestamptz, commit_seq bigint
)

Requires SELECT on the bucket. Lists current visible objects (excluding delete markers) ordered by key COLLATE "C". p_limit accepts 0–1000. Pass the last key of a page as p_after_key to fetch the next page. Historical versions and S3 delimiter rollups are not exposed here.

delete_object

silo_api.delete_object(
  p_bucket text, p_key text,
  p_version_id uuid DEFAULT NULL, p_if_match text DEFAULT NULL
)
RETURNS TABLE (
  deleted boolean, version_id uuid, is_delete_marker boolean
)

Requires DELETE on the bucket (plus SELECT when p_if_match is set). Omitting p_version_id either removes the current object or inserts a delete marker according to the bucket’s versioning state. Specifying p_version_id deletes that version unless blocked by Object Lock retention or legal hold (SL003).

copy_object

silo_api.copy_object(
  p_src_bucket text, p_src_key text,
  p_dst_bucket text, p_dst_key text,
  p_src_version_id uuid DEFAULT NULL,
  p_if_none_match boolean DEFAULT false,
  p_if_match text DEFAULT NULL
)
RETURNS TABLE (
  object_id bigint, version_id uuid, etag text,
  size bigint, mod_time timestamptz
)

Requires SELECT on the source bucket and INSERT on the destination bucket (plus destination SELECT when a destination condition is set). Reads the source body, tags, public metadata, and annotations from a single snapshot and publishes the destination object and annotations atomically. Rejects encrypted source objects or encrypted annotations.

Bucket functions

create_bucket

silo_api.create_bucket(
  p_name text, p_region text DEFAULT 'us-east-1'
)
RETURNS TABLE (
  name text, created_at timestamptz, region text, acl_relation regclass
)

Controlled by EXECUTE privilege on silo_api.create_bucket(text, text). Bucket names must be valid lowercase S3 names (3–63 bytes). Empty region defaults to 'us-east-1'; 'EU' maps to 'eu-west-1'. The creator receives SELECT, INSERT, and DELETE on the new acl_relation in silo_bucket.

bucket_info and list_buckets

silo_api.bucket_info(p_name text)
RETURNS TABLE (
  name text, created_at timestamptz, region text,
  versioning text, acl_relation regclass
)

silo_api.list_buckets()
RETURNS TABLE (
  name text, created_at timestamptz, region text,
  versioning text, acl_relation regclass
)

Filtered by the caller’s bucket privileges: holding at least one of SELECT, INSERT, or DELETE on a bucket’s ACL relation makes that bucket visible. bucket_info raises 42501 if the bucket does not exist or the caller lacks privileges.

drop_bucket

silo_api.drop_bucket(p_name text) RETURNS void

Requires DELETE on the bucket ACL relation and requires the bucket to be completely empty (no current objects, historical versions, or delete markers). There is no force parameter in SQL.

Errors and retries

Classify failures by SQLSTATE code rather than error message text:

SQLSTATEMeaningApplication handling
42501Role, function, or bucket permission deniedFix role bindings and GRANT statements; do not retry
22023Invalid argument, byte range, condition, or metadataFix caller input
0A000Unsupported write isolation level, encrypted payload, or unsynchronized bucket policyUse Read Committed for writes; use S3 API for encrypted objects
SO001Object body or version does not exist (or is a delete marker)Handle missing object
SO002ETag condition or p_object_id mismatchRe-read current state and decide whether to retry
SO003Object exceeds the 256 MiB inline SQL limitUse read_object chunked reads or the S3 API
SO004Incomplete object segment dataAbort and inspect storage consistency
SB001 / SB002 / SB003Bucket missing / bucket not empty / bucket already existsHandle at the application level
SL003Version protected by Object Lock retention or legal holdKeep protected version; SQL has no governance bypass
SL004Bucket or object lock state not yet synchronizedVerify compatible gateway processes are running
SQ001Hard bucket quota exceededFree logical space or increase bucket quota
SA004Annotation payload integrity failureReject corrupt payload and inspect storage

See the SQL Object Operations tutorial for end-to-end transactional examples.

5.3 - S3 API

Supported S3 operations, headers and extensions.
Note

Core bucket/object CRUD, versioning, multipart uploads, SSE-S3/SSE-C encryption, webhook notifications, IAM users/policies, and service accounts are part of the pgsilo MVP target. Basic AssumeRole STS, bucket lifecycle expiration/abort, Object Lock retention/legal hold, hard bucket quotas, object annotations, and read-only ZIP extraction are Preview features.

This page summarizes the HTTP S3 operations, headers, and extensions supported by the schema 14 PostgreSQL backend. Examples use path-style addressing (/{bucket}/{key}). For hands-on examples, see SDK & CLI Access and Multipart, Lock & Notifications.

Endpoints, signatures, and clients

  • S3 and STS share the gateway API port (9000 by default); the web Console uses 9001 by default. Never pass the Console port as an S3 SDK endpoint.
  • Sign requests with AWS Signature Version 4 (s3 service name for object/bucket calls, sts for AssumeRole) using the gateway’s effective region.
  • Path-style addressing works out of the box. Virtual-hosted-style addressing requires MINIO_DOMAIN, wildcard DNS for bucket subdomains, and TLS certificates covering those hostnames.
  • Presigned GET/PUT URLs and POST policy forms are supported within their signed expiration and conditions.
ClientPrimary useConfiguration notes
mcliBuckets, objects, IAM users/policies, service accounts, quotas, and admin statusSeparate administrative aliases from application credentials
AWS CLI (s3 / s3api / sts)Versioned object calls, multipart uploads, tagging, Object Lock, and AssumeRolePass --endpoint-url, --ca-bundle, and --region
boto3 / AWS SDK for Go v2Application S3 access and automated testsUse path-style addressing; SDKs automatically retry HTTP 503 SlowDown
Custom SigV4 HTTP clientObject annotations and x-minio-extract ZIP headers not modeled by standard SDKsSign full query parameters and extension headers

Bucket and object operations

OperationHTTP formBehavior and limits
ListBucketsGET /Lists buckets visible to the caller identity
CreateBucket / HeadBucket / DeleteBucketPUT / HEAD / DELETE /{bucket}Standard DeleteBucket requires an empty bucket; LocationConstraint must match the effective region
GetBucketLocationGET /{bucket}?locationReturns the effective region
ListObjects / ListObjectsV2GET /{bucket} / GET /{bucket}?list-type=2Supports prefix, delimiter, and continuation tokens
PutObject / GetObject / HeadObjectPUT / GET / HEAD /{bucket}/{key}Supports user metadata, content type, conditionals, byte ranges, checksums, and SSE
CopyObjectPUT /{bucket}/{key} with x-amz-copy-sourceCopies across keys or buckets atomically; supports source version selection
DeleteObject / DeleteObjectsDELETE /{bucket}/{key} / POST /{bucket}?deleteCreates a delete marker in versioned buckets when versionId is omitted; batch delete handles up to 1000 keys
GetObjectAttributesGET /{bucket}/{key}?attributesReturns ETag, checksums, object size, and multipart part metadata
SelectObjectContentPOST /{bucket}/{key}?select&select-type=2S3 Select over CSV, JSON, and Parquet payloads

The default maximum object size is 256 MiB (SILO_PG_MAX_OBJECT_SIZE), configurable up to 1 GiB at initial store setup. Single PUT, CopyObject, and completed multipart objects all enforce this limit.

Sending DELETE /{bucket} with a non-empty x-minio-force-delete header (including the literal string false) requires s3:ForceDeleteBucket in addition to s3:DeleteBucket. Object-lock buckets reject force deletion with HTTP 405 even when empty.

Versioning, conditionals, ranges, and checksums

Use GET/PUT /{bucket}?versioning to inspect or change bucket versioning (Enabled or Suspended) and GET /{bucket}?versions (ListObjectVersions) to list versions and delete markers.

FeatureHeaders or query parametersNotes
Read conditionalsversionId, If-Match, If-None-Match, If-Modified-Since, If-Unmodified-SinceReturns 304 Not Modified or 412 Precondition Failed according to HTTP method
Write / Copy destination conditionalsIf-Match, If-None-MatchChecked atomically at publication without a separate HEAD race
Conditional deleteIf-Match, optional versionIdVerifies target ETag before deleting or adding a delete marker
Copy source conditionalsx-amz-copy-source-if-*Checked against the selected source version
Byte range readsRange: bytes=start-endSingle byte range supported; cannot be combined with partNumber
Part readspartNumber=NReads a specific part of a completed multipart object

Supported checksum algorithms include CRC32, CRC32C, CRC64NVME, SHA1, SHA256, MD5, SHA512, XXHASH64, XXHASH3, and XXHASH128. Note that ETag values for multipart or encrypted objects are not plain MD5 digests.

Multipart uploads

StageHTTP formS3 operation
InitiatePOST /{bucket}/{key}?uploadsCreateMultipartUpload
Upload partPUT /{bucket}/{key}?partNumber=N&uploadId=IDUploadPart
Copy partPUT /{bucket}/{key}?partNumber=N&uploadId=ID + x-amz-copy-sourceUploadPartCopy
List partsGET /{bucket}/{key}?uploadId=IDListParts
List active uploadsGET /{bucket}?uploadsListMultipartUploads
CompletePOST /{bucket}/{key}?uploadId=IDCompleteMultipartUpload
AbortDELETE /{bucket}/{key}?uploadId=IDAbortMultipartUpload

Part numbers run from 1 to 10000, and every part except the last must be at least 5 MiB. Unfinished parts consume physical database storage but do not count toward logical bucket quota until CompleteMultipartUpload publishes the assembled object in a single transaction. Abort failed uploads explicitly or configure an AbortIncompleteMultipartUpload lifecycle rule.

Subresources: tags, lock, encryption, lifecycle, CORS, notifications

SubresourceMethodsScope and status
Object ?taggingGET / PUT / DELETEUp to 10 key-value tags per object version (MVP)
Bucket ?taggingGET / PUT / DELETEBucket-level tag set (MVP)
Bucket ?policyGET / PUT / DELETEBucket policies persisted in PostgreSQL; combined with native role grants under iam_and_pg (MVP)
Bucket ?encryptionGET / PUT / DELETEDefault AES256 encryption using built-in static KMS; external SSE-KMS is unsupported (MVP)
Bucket ?corsGET / PUT / DELETE, OPTIONSPer-bucket CORS rules; does not bypass SigV4 or IAM checks (MVP)
Bucket ?notificationGET / PUTPublishes S3 object events to configured webhook targets (MVP)
Bucket ?object-lockGET / PUT (enabled at bucket creation)Default GOVERNANCE or COMPLIANCE retention on versioned buckets (Preview)
Object ?retention, ?legal-holdGET / PUTPer-version retention and legal hold; governance bypass requires x-amz-bypass-governance-retention: true and s3:BypassGovernanceRetention (Preview)
Bucket ?lifecycleGET / PUT / DELETECurrent/noncurrent expiration, expired delete-marker cleanup, and incomplete multipart abort; no remote tiering (Preview)

Webhook notifications

  1. Configure a webhook target on the gateway via MINIO_NOTIFY_WEBHOOK_ENABLE_<ID>=on and MINIO_NOTIFY_WEBHOOK_ENDPOINT_<ID>=https://....
  2. Attach bucket notification rules referencing arn:minio:sqs:<region>:<ID>:webhook using PutBucketNotificationConfiguration or mcli event add.

S3 HTTP mutations and background lifecycle expirations emit bucket notifications after transaction commit (at-least-once delivery; consumers must handle duplicates). Direct SQL mutations via silo_api never emit S3 bucket notifications.

IAM service accounts and STS

IAM users, groups, policies, service accounts, and STS metadata are stored in PostgreSQL and managed through mcli admin user, mcli admin policy, and mcli admin user svcacct.

  • Service accounts belong to a parent IAM user, optionally carry a session policy (up to 2048 serialized bytes) that narrows the parent’s permissions, and support an optional expiration between 15 minutes and 365 days from issuance.
  • Basic AssumeRole STS (Preview) accepts a form POST / signed with an ordinary IAM user’s SigV4 credentials (Action=AssumeRole&Version=2011-06-15). DurationSeconds defaults to 3600 (1 hour) and accepts 900–31536000 seconds (15 minutes to 365 days) unless overridden by MINIO_STS_DURATION.
  • Service accounts and STS temporary credentials cannot call AssumeRole recursively to extend credential chains.
  • Direct exchange of PostgreSQL database usernames/passwords for STS credentials is not implemented, and external OIDC/LDAP STS flows (AssumeRoleWithWebIdentity, AssumeRoleWithLDAPIdentity) are not part of the validated pgsilo scope.

Unsupported S3 APIs

The PostgreSQL backend does not implement bucket or site replication, remote storage tiering, RestoreObject, object-level canned ACLs, S3 Inventory, static website hosting, server access logging, Transfer Acceleration, RequestPayment, BitTorrent, or external SSE-KMS. See Compatibility for the complete matrix.

5.4 - Authorization

IAM policies and native PostgreSQL authorization, and how the two combine.
Note

S3 IAM users, policies, and service accounts are part of the core pgsilo MVP. SQL application role grants (silo_api / silo_bucket) and joint S3-to-PostgreSQL authorization (iam_and_pg mode) are Preview features in the MVP release.

pgsilo separates three kinds of identities:

  1. Database owner (silo_owner): the trusted ordinary PostgreSQL role used by silo server gateways via SILO_PG_DSN.
  2. SQL application logins (e.g., app_sql): independent unprivileged PostgreSQL roles that call silo_api functions.
  3. S3 identities: S3 root credentials, IAM users, service accounts, and STS temporary sessions.

Never connect applications or S3 bindings as the installation owner (silo_owner) or a PostgreSQL superuser.

SQL application privileges

Create an unprivileged login role for SQL callers:

CREATE ROLE app_sql LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE
  NOREPLICATION NOBYPASSRLS;
\password app_sql

As the installation owner (silo_owner), grant schema USAGE, function EXECUTE, and table privileges on the target bucket’s ACL relation in silo_bucket:

GRANT USAGE ON SCHEMA silo_api, silo_bucket TO app_sql;
GRANT EXECUTE ON FUNCTION
  silo_api.put_object(text,text,bytea,text,jsonb,boolean,text),
  silo_api.get_object(text,text,uuid),
  silo_api.stat_object(text,text,uuid),
  silo_api.read_object(text,text,bigint,bigint,uuid,bigint),
  silo_api.list_objects(text,text,text,integer)
TO app_sql;

SELECT format('GRANT SELECT, INSERT ON TABLE %I.%I TO %I',
              n.nspname, c.relname, 'app_sql')
FROM silo.bucket_acl a
JOIN silo.buckets b ON b.id = a.bucket_id
JOIN pg_catalog.pg_class c ON c.oid = a.relation_oid
JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE b.name = 'attachments' AND n.nspname = 'silo_bucket'
\gexec
SQL operationRequired bucket ACL privilege
stat_object, get_object, read_object, list_objectsSELECT
put_object (including unconditional overwrite)INSERT
Conditional put_object, copy_object, delete_objectOperation privileges plus SELECT
copy_objectSource SELECT and destination INSERT
delete_object, drop_bucketDELETE (drop_bucket also requires an empty bucket)
bucket_info, list_bucketsAt least one of SELECT, INSERT, or DELETE
create_bucketEXECUTE on silo_api.create_bucket(text, text)

Callers must connect directly as app_sql (session_user is checked; SET ROLE is rejected). Recreating a dropped bucket generates a new ACL relation in silo_bucket and requires fresh GRANT statements.

Joint authorization (iam_and_pg)

By default (iam mode), S3 requests are authorized solely by S3 IAM and bucket policies. Optional iam_and_pg mode requires both S3 IAM evaluation and the bound PostgreSQL role’s silo_bucket privileges to succeed:

  • An explicit IAM Deny, service-account policy restriction, or STS session policy restriction always denies the request; PostgreSQL GRANT statements never override an IAM denial.
  • The authorization mode is stored in the shared database (silo.set_native_auth_mode) and applies across all gateways connected to that database.
  • Anonymous S3 requests have no PostgreSQL role binding and are rejected in iam_and_pg mode.

Bound PostgreSQL roles must be independent ordinary roles (NOLOGIN roles are recommended for S3-only principals) and must not:

  • Hold SUPERUSER, CREATEDB, CREATEROLE, REPLICATION, or BYPASSRLS
  • Inherit the installation owner (silo_owner), schema owners, pg_read_all_data, or pg_write_all_data
  • Hold privileges on the private silo schema
  • Hold WITH GRANT OPTION on silo_api functions or CREATE on silo_api / silo_bucket

Enabling iam_and_pg mode

After creating the IAM user app-s3 and granting bucket privileges to app_sql, create a dedicated NOLOGIN role for the S3 root identity and bind both principals inside a transaction as silo_owner:

CREATE ROLE silo_native_root NOLOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE
  NOREPLICATION NOBYPASSRLS;
BEGIN;
GRANT USAGE ON SCHEMA silo_bucket TO silo_native_root;

SELECT format('GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE %I.%I TO %I',
              n.nspname, c.relname, 'silo_native_root')
FROM silo.bucket_acl a
JOIN silo.buckets b ON b.id = a.bucket_id
JOIN pg_catalog.pg_class c ON c.oid = a.relation_oid
JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE b.name = 'attachments' AND n.nspname = 'silo_bucket'
\gexec

SELECT silo.bind_native_root('silo_native_root'::regrole);
SELECT silo.bind_native_principal('iam:app-s3', 'app_sql'::regrole);
SELECT silo.set_native_auth_mode('iam_and_pg');
COMMIT;

Before switching an active deployment to iam_and_pg, bind every required root and IAM user identity and grant privileges on all target buckets.

S3-to-PostgreSQL privilege mapping

S3 operation classRequired PostgreSQL privilege in iam_and_pg mode
Object GET/HEAD, version reads, listings, tag/retention/bucket-config readsSELECT on bucket ACL relation
Object PUT, tag writes, retention/legal-hold writes, annotation PUTINSERT on bucket ACL relation
Object/version DELETE, AbortMultipartUpload, annotation DELETEDELETE on bucket ACL relation
Bucket configuration changes, governance-retention bypassUPDATE on bucket ACL relation (plus operation-specific privileges)
DeleteBucket, ForceDeleteBucketDELETE and UPDATE on bucket ACL relation
CreateBucketEXECUTE on silo_api.create_bucket(text, text)
Conditional writes/deletes and annotation mutations with x-amz-object-if-matchOperation privilege plus SELECT on bucket ACL relation
CopyObjectSource SELECT and destination INSERT (plus annotation IAM actions when copying annotations)

Service accounts and STS temporary credentials inherit the PostgreSQL role binding of their parent IAM user while enforcing their own IAM and session-policy restrictions.

Revoking bindings and restoring default mode

As silo_owner, unbind principals or switch back to iam mode:

SELECT silo.unbind_native_principal('iam:app-s3');
-- To unbind the root identity:
-- SELECT silo.unbind_native_principal('root:');

-- To restore IAM-only S3 authorization:
SELECT silo.set_native_auth_mode('iam');

Bindings track both the PostgreSQL role OID and the IAM user generation. Dropping and recreating a role or IAM user with the same name requires re-running silo.bind_native_principal. Switching S3 back to iam mode does not relax privileges on the silo_api SQL functions.

5.5 - Annotations

The annotation API and its policy actions.
Note

The object annotation protocol is a Preview extension in the MVP release. Policy evaluation for the four s3:*ObjectAnnotation actions depends on the unpublished silo-pkg revision (27697e8) compiled into the pgsilo branch.

An object annotation is a named UTF-8 text payload attached to a specific parent object version—such as OCR text, classification labels, or review notes. Introduced in schema 13 and retained in schema 14, annotations are stored separately from S3 user metadata (x-amz-meta-*) and object tags. Updating an annotation neither rewrites the parent object body nor creates a new parent version.

HTTP requests and permissions

Target the parent object key and sign the full path, query string, and headers with AWS SigV4:

OperationHTTP requestRequired IAM actionAdditional bucket privilege (iam_and_pg)
Write or replacePUT /{bucket}/{key}?annotation=&annotationName=labels.jsons3:PutObjectAnnotationINSERT
Read payloadGET /{bucket}/{key}?annotation=&annotationName=labels.jsons3:GetObjectAnnotationSELECT
List namesGET /{bucket}/{key}?annotation=s3:ListObjectAnnotationsSELECT
DeleteDELETE /{bucket}/{key}?annotation=&annotationName=labels.jsons3:DeleteObjectAnnotationDELETE
  • Standard s3:GetObject and s3:PutObject permissions do not grant annotation access. IAM policy resources reference the parent object ARN (arn:aws:s3:::bucket/key or prefix).
  • The annotation query parameter must appear once with an empty value. PUT and DELETE require a non-empty annotationName. GET without annotationName lists all annotations on the selected parent version; GET with annotationName returns that annotation’s body. There is no annotation HEAD endpoint.
  • Successful PUT returns HTTP 200, DELETE returns HTTP 204, and GET returns Content-Type: text/plain; charset=utf-8 along with the annotation’s own ETag, Last-Modified, and parent x-amz-version-id.

Size and naming bounds

PropertyLimit
Annotations per parent object version1000
Plaintext payload size1 byte – 1 MiB
Annotation name (annotationName)1 – 512 UTF-8 bytes (no XML-invalid control characters)
Payload encodingValid UTF-8

Annotation names are treated as flat identifiers rather than filesystem paths. Annotation bytes count toward the bucket’s hard logical quota.

A list request (GET /{bucket}/{key}?annotation=) returns up to 1000 entries in a single response without pagination parameters:

<ListObjectAnnotationsOutput>
  <Annotation>
    <AnnotationName>labels.json</AnnotationName>
    <Size>18</Size>
    <ETag>"ANNOTATION_ETAG"</ETag>
    <LastModified>2026-10-08T00:00:00Z</LastModified>
  </Annotation>
</ListObjectAnnotationsOutput>

Parent version selection and conditional writes

Pass versionId to target a specific historical parent version; omitting versionId targets the current visible object (excluding delete markers).

PUT and DELETE accept x-amz-object-if-match: "<PARENT_ETAG>" to verify the parent object’s ETag atomically (requires SELECT under iam_and_pg mode). Note that x-amz-object-if-match checks the parent object body’s ETag, not the previous annotation’s ETag.

PUT /attachments/invoices/1001.txt?annotation=&annotationName=labels.json HTTP/1.1
Host: s3.example.net
x-amz-object-if-match: "PARENT_OBJECT_ETAG"
Content-Type: text/plain; charset=utf-8
Authorization: AWS4-HMAC-SHA256 ...

{"reviewed":true}

For runnable Python signing examples, see Annotations & ZIP Extraction.

Lifecycle, copying, and encryption

  • Independent mutability: annotations have no version history of their own. Updating an annotation leaves the parent object’s body, ETag, modification time, tags, Object Lock retention, and legal hold untouched. Parent Object Lock does not make annotations immutable.
  • Unlinking and cleanup: overwriting an unversioned object discards its previous annotation set; deleting a specific parent version unlinks only that version’s annotations. Unlinking releases logical bucket quota immediately, while a writable gateway’s background maintenance worker deletes the unlinked physical rows in batches.
  • Copy directives: S3 CopyObject accepts x-amz-annotation-directive: COPY (default) or EXCLUDE. Copying a non-empty annotation set requires s3:GetObjectAnnotation on the source and s3:PutObjectAnnotation on the destination. SQL silo_api.copy_object always copies plaintext annotations atomically and has no EXCLUDE option.
  • Encryption: annotations inherit the parent version’s SSE-C or static SSE-S3 protection and require the matching key on PUT and GET. Public SQL functions have no annotation CRUD endpoints and reject copying objects with encrypted annotations.

Error responses

Error or statusMeaning
InvalidArgument (HTTP 400)Malformed query parameters, invalid UTF-8 name/body, or unsupported headers
TooManyAnnotations (HTTP 400)Parent version already has 1000 annotations
NoSuchAnnotation (HTTP 404)Requested annotationName does not exist on the selected parent version
AccessDenied (HTTP 403)Missing s3:*ObjectAnnotation action, parent policy denial, or missing native bucket privilege
PreconditionFailed (HTTP 412)x-amz-object-if-match does not match the parent version’s ETag

5.6 - ZIP extraction

Extracting ZIP archives with x-minio-extract, and its limits.
Note

Read-only ZIP member extraction (x-minio-extract: true) is a Preview extension in the MVP release.

Introduced in schema 13 and retained in schema 14, the PostgreSQL backend can expose members inside a stored .zip object as read-only virtual objects over S3. The gateway never extracts files onto local disk, creates separate object rows, or persists a ZIP index in PostgreSQL.

Request forms

Include x-minio-extract: true on a GET or HEAD request whose key path traverses inside a .zip archive:

GET /attachments/archive.zip/docs/readme.txt HTTP/1.1
Host: s3.example.net
x-minio-extract: true
Authorization: AWS4-HMAC-SHA256 ...

To list archive members, send a ListObjectsV2 request (list-type=2) with x-minio-extract: true and a prefix containing .zip/:

GET /attachments?list-type=2&prefix=archive.zip%2F HTTP/1.1
Host: s3.example.net
x-minio-extract: true
Authorization: AWS4-HMAC-SHA256 ...

The first .zip/ boundary in the key identifies the parent archive object. In a.zip/b.zip/c.txt, the parent archive is a.zip and the requested member path is b.zip/c.txt; nested archives are not recursively opened. Without x-minio-extract: true, requests treat the full key as an ordinary S3 object name. For runnable SDK code, see Annotations & ZIP Extraction.

Authorization and snapshot isolation

  • Reading a member requires s3:GetObject on the parent .zip object (or s3:GetObjectVersion when versionId is specified). Listing members additionally requires s3:ListBucket. Under iam_and_pg joint authorization, only SELECT on the bucket ACL relation is required.
  • Central directory parsing, member decompression, parent version metadata, and SSE decryption all read from a single pinned PostgreSQL snapshot. Concurrent S3 or SQL overwrites, version deletions, or bucket recreations cannot swap the underlying archive segments mid-read.
  • SSE-C and static SSE-S3 encrypted .zip archives are supported through the standard parent decryption path, and read-only standby gateways (SILO_PG_READ_ONLY=on) can serve ZIP extraction requests.

Archive format and resource limits

ParameterLimit
Compression methodsStore (0) and Deflate (8)
ZIP64 descriptorsSupported within the size bounds below
Central directory size<= 16 MiB
Central directory entries<= 10000 entries
Single uncompressed member size<= 256 MiB
Total declared uncompressed archive size<= 1 GiB
Per-request execution timeout<= 1 minute (or shorter outer request timeout)
Member Range or partNumber readsUnsupported (rejected)
Password-protected / encrypted ZIP or multi-disk archivesUnsupported (rejected)

The gateway rejects archives with trailing or corrupt central directory records, out-of-range offsets, duplicate member names, absolute paths, .. path traversal segments, or special file types.

GET vs. HEAD execution cost

Before streaming a GET response body, the gateway validates the target member’s uncompressed size and CRC-32 across the member stream, then streams the decompressed payload from the same database snapshot. Consequently, every member GET performs two decompression passes. HEAD returns member metadata (Content-Length set to uncompressed size, Content-Type inferred from file extension) from the central directory without decompressing the member body.

Each extraction request holds its database connection and snapshot until the stream finishes or times out. For workloads that repeatedly read individual members at high concurrency, unpack and store those files as independent S3 objects instead.

5.7 - Storage layout

Tables, segments, versions and how space is reclaimed.
Note

Object versioning, multipart uploads, and SSE-S3/SSE-C encryption are part of the core pgsilo MVP. Object Lock retention/legal hold, bucket lifecycle rules, hard bucket quotas, and object annotations are Preview features in the MVP release.

pgsilo stores all bucket metadata, object versions, byte segments, multipart parts, annotations, and IAM state in PostgreSQL (schema 14). Understanding the boundary between object visibility, logical quota accounting, and PostgreSQL physical space reclamation is essential for capacity planning.

Segment layout and multipart publication

Object payloads are split into fixed-size bytea segments stored in silo.object_segments. The default segment size (SILO_PG_SEGMENT_SIZE) is 8 MiB, configurable from 1 MiB to 64 MiB at initial database setup. Streaming S3 reads and range requests fetch only the required segments without buffering the entire object in gateway memory.

The default maximum object size (SILO_PG_MAX_OBJECT_SIZE) is 256 MiB, configurable from 1 MiB to 1 GiB at initialization. Completed multipart uploads obey the same ceiling.

Unfinished multipart parts consume physical table space in PostgreSQL, but they do not count toward a bucket’s committed logical quota until CompleteMultipartUpload atomically validates part order, checksums, quota, and Object Lock rules and publishes the assembled version. Clean up abandoned uploads with AbortMultipartUpload or an AbortIncompleteMultipartUpload lifecycle rule.

Versions and delete markers

Bucket versioning state / operationStorage behavior
Unversioned PUT overwriteReplaces the current unversioned body and unlinks its previous annotation set
Versioned PUT overwritePublishes a new version_id and retains historical versions
Versioned DELETE without versionIdInserts a delete marker as the latest version; historical bodies remain stored and count toward quota
DELETE with explicit versionIdPermanently removes that version (unless blocked by Object Lock retention or legal hold)
Suspended versioning (Suspended)New writes use null-version semantics while preserving existing historical versions
Current version is a delete markerStandard GET / HEAD without versionId returns 404 NoSuchKey

Each published version carries an external version_id (UUID) and an internal object_id (bigint). Independent S3 HTTP requests never share a database snapshot, whereas SQL queries via silo_api can read object bodies and application tables within a single transaction snapshot.

Object Lock and retention (Preview)

Shared database mutation logic enforces GOVERNANCE retention, COMPLIANCE retention, and legal hold across both S3 HTTP requests and silo_api SQL calls. Object-lock buckets require versioning to be enabled at bucket creation.

  • Bypassing GOVERNANCE retention requires an S3 request with x-amz-bypass-governance-retention: true and s3:BypassGovernanceRetention permission (plus UPDATE on the bucket ACL relation under iam_and_pg).
  • Neither COMPLIANCE retention nor an active legal hold can be bypassed through S3 or SQL.
  • silo_api SQL functions inherit default bucket retention on put_object / copy_object and enforce lock checks on delete_object, but expose no governance bypass parameter.
  • Object Lock protects against untrusted S3 and SQL callers; it cannot prevent a PostgreSQL superuser or the trusted database owner (silo_owner) from modifying underlying database tables directly.

Server-side encryption

PathBehavior
SSE-CClient supplies the encryption key over HTTPS on every read, write, copy, or part upload
SSE-S3 (AES256)Uses the gateway’s static KMS key (MINIO_KMS_SECRET_KEY / MINIO_KMS_SECRET_KEY_FILE) for explicit header requests and default bucket encryption
SSE-KMS (external KMS)Not implemented in the PostgreSQL backend
Public SQL API (silo_api)Rejects reading encrypted bodies and rejects plaintext writes to default-encrypted buckets (SQLSTATE 0A000)
Annotations and ZIP extractionInherit the parent object version’s SSE-C or SSE-S3 encryption

SSE encrypts object segment payloads and annotation bodies; it does not encrypt bucket names, object keys, or PostgreSQL catalog metadata. Back up your static MINIO_KMS_SECRET_KEY alongside database backups—restoring PostgreSQL tables without the static KMS key leaves SSE-S3 payloads permanently unreadable.

Hard bucket quotas (Preview)

Hard bucket quotas are enforced atomically in PostgreSQL (silo.bucket_quota) rather than through asynchronous gateway estimates. Billable logical usage (billableBytes) equals the sum of committed object version bodies across all retained versions plus their linked annotation payloads.

OperationEffect on logical bucket quota
Overwrite in a versioned bucketBoth the new version and retained old versions count toward quota
DELETE without versionId in a versioned bucketAdds a zero-byte delete marker; retained historical versions still count
DELETE with versionIdImmediately decrements that version’s body bytes and linked annotation bytes
Replace or delete an annotationImmediately applies the net byte difference
CompleteMultipartUploadChecks total assembled object size against remaining quota at commit

For example, four retained 256 MiB versions consume a full 1 GiB bucket quota even when only one key is visible in ListObjectsV2. Physical overhead from incomplete multipart uploads, PostgreSQL indexes, WAL segments, and dead MVCC tuples is not bounded by logical bucket quota.

Configure and inspect quotas with mcli:

mcli quota set pg/attachments --size 1GiB
mcli quota info pg/attachments

Lifecycle rules, background cleanup, and VACUUM

  • Lifecycle worker (Preview): writable gateways coordinate through PostgreSQL leases (silo.TryLifecycleLock) to expire current/noncurrent versions, remove expired delete markers, and abort incomplete multipart uploads. Remote storage tiering is not supported.
  • Annotation orphan reaper: unlinking annotations (via unversioned overwrite, version deletion, or force bucket deletion) releases logical quota immediately and enqueues orphan payload rows for bounded batch deletion by a writable gateway. Always keep at least one writable silo server gateway connected to the PostgreSQL primary—even if applications only use silo_api over SQL—so background cleanup and native-auth heartbeats continue running.
  • PostgreSQL physical space reclamation: deleting objects or draining the annotation cleanup queue marks PostgreSQL tuples as dead for autovacuum reuse; it does not immediately shrink OS filesystem files. Long-running SQL transactions hold back VACUUM horizon and delay space reuse. Monitor logical bucket usage, annotation cleanup backlog, dead tuple ratios, physical database size, and WAL retention separately.

Force bucket deletion

Standard DeleteBucket (DELETE /{bucket}) requires an empty bucket. Sending x-minio-force-delete: true (any non-empty header value, including "false", triggers the permission check) requires both s3:DeleteBucket and s3:ForceDeleteBucket (plus DELETE and UPDATE under iam_and_pg) and removes all versions, delete markers, and incomplete uploads in a single transaction. Object-lock buckets reject force deletion with HTTP 405 even when empty. SQL silo_api.drop_bucket has no force option.

6 - Operations

Install, run highly available, back up, upgrade, monitor and troubleshoot.

pgsilo gateways serve the S3 API, web Console, and IAM evaluation while PostgreSQL stores all objects, segments, and control state. Operate and monitor both layers together: a live gateway process does not prove that PostgreSQL is writable, and logical bucket usage does not measure physical database disk consumption.

Operations guides

TaskGuide
Prepare PostgreSQL and install gateways on Linux or macOSInstall
Scale out stateless gateways, attach read-only standbys, and handle failoverHigh availability
Back up and restore the database, WAL stream, and external encryption keysBackup and restore
Perform coordinated schema migrations and binary upgradesUpgrade
Configure health probes, scrape /minio/metrics/v3/pg, and track capacityMonitoring
Diagnose TLS, pool exhaustion (HTTP 503 / 429), IAM leases, and space growthTroubleshooting
Automate multi-gateway deployment with the unpublished Pigsty role branchDeploy with Pigsty

Operating rules

  • All gateways in a deployment must connect to the same logical PostgreSQL database (or its physical standbys) and share identical root credentials, effective region, static SSE-S3 keys, SILO_PG_SEGMENT_SIZE, and SILO_PG_MAX_OBJECT_SIZE.
  • Gateways connect as the trusted ordinary database owner (silo_owner). Applications use separate SQL logins (app_sql) with access only to silo_api and silo_bucket, never the private silo schema.
  • Even if applications access objects exclusively through silo_api over SQL, keep at least one writable silo server gateway connected to the PostgreSQL primary. That gateway runs lifecycle expiration, reaps unlinked annotation payloads, and writes the control-plane heartbeats required by standby gateways.
  • During recovery or failover, evaluate consistency at the transaction boundary: application rows and silo_api calls inside one SQL transaction recover atomically, whereas separate S3 HTTP requests commit as independent transactions.

6.1 - Install

Database preparation and installation on Linux and macOS.
Important

Installation packages for the pgsilo PostgreSQL backend have not yet been publicly released (MVP in progress). No public download URLs exist yet. When released with Silo, the MVP targets linux/amd64 and linux/arm64 DEB and RPM packages (darwin/arm64 is used for local verification). The frozen October 8, 2026 local checkpoint (3c7fdc03) built only linux/arm64 DEB and darwin/arm64 artifacts.

This guide covers preparing the PostgreSQL database and configuring silo server on Linux (systemd) or macOS. For an existing database undergoing a schema change, follow Upgrade instead.

1. Prepare the PostgreSQL database

Prepare a PostgreSQL 16 or newer primary instance (pg.example.net:5432) with TLS enabled. Gateways must connect directly to PostgreSQL or through a session-preserving proxy; do not route SILO_PG_DSN through PgBouncer in transaction-pooling mode.

On the PostgreSQL primary, create an ordinary, non-superuser role (silo_owner) and a dedicated database (silo):

CREATE ROLE silo_owner LOGIN NOSUPERUSER NOCREATEDB NOCREATEROLE NOREPLICATION;
\password silo_owner
CREATE DATABASE silo OWNER silo_owner;

Require TLS and SCRAM authentication in pg_hba.conf for the gateway subnet:

hostssl silo silo_owner 192.0.2.0/24 scram-sha-256

From the gateway host, verify connectivity, TLS certificate verification (sslmode=verify-full), and primary write status (pg_is_in_recovery() = false):

psql 'host=pg.example.net port=5432 dbname=silo user=silo_owner sslmode=verify-full sslrootcert=/path/to/pg-ca.crt' \
  -W -c 'SELECT current_user, current_database(), pg_is_in_recovery();'

2. Install on Linux with systemd

Install the package and verify the binary

Once you have built or obtained the target DEB/RPM package for your architecture (amd64 or arm64), verify its SHA-256 checksum and install it:

sha256sum -c SHA256SUMS
sudo dpkg -i ./silo_<version>_<arch>.deb
sha256sum /usr/bin/silo

The package creates the silo system user and group. Complete the configuration steps below before starting the service.

Install TLS certificates and /etc/default/silo

Create /etc/silo and /etc/silo/certs, install the PostgreSQL CA certificate and the S3 server TLS certificate/key pair (public.crt and private.key), and create /etc/default/silo:

sudo install -d -o root -g silo -m 0750 /etc/silo /etc/silo/certs
sudo install -o root -g silo -m 0640 /path/to/pg-ca.crt /etc/silo/postgres-ca.crt
sudo install -o root -g silo -m 0640 /path/to/s3-server.crt /etc/silo/certs/public.crt
sudo install -o root -g silo -m 0640 /path/to/s3-server.key /etc/silo/certs/private.key

Write /etc/default/silo (mode 0640, owned by root:silo) using this template (silo-pg.env.example), replacing all placeholder values:

SILO_PG_DSN="postgresql://silo_owner:URL_ENCODED_PASSWORD@pg.example.net:5432/silo?sslmode=verify-full&sslrootcert=/etc/silo/postgres-ca.crt"
MINIO_ROOT_USER="REPLACE_WITH_ROOT_ACCESS_KEY"
MINIO_ROOT_PASSWORD="REPLACE_WITH_LONG_RANDOM_SECRET"
MINIO_REGION="us-east-1"
SILO_PG_READ_ONLY="off"
SILO_PG_MAX_CONNS="32"
SILO_PG_CONTROL_CONNS="4"
SILO_PG_COORD_CONNS="2"
SILO_PG_SEGMENT_SIZE="8MiB"
SILO_PG_MAX_OBJECT_SIZE="256MiB"
SILO_PG_ACQUIRE_TIMEOUT="5s"
SILO_PG_REQUEST_TIMEOUT="15m"
SILO_PG_QUEUE_TIMEOUT="5s"

SILO_PG_QUEUE_TIMEOUT takes effect from 1d387725c (2026-11-08); earlier builds ignore it.

Percent-encode reserved characters in the DSN password. This file is read by systemd EnvironmentFile; do not execute it with source.

Install the systemd drop-in and start silo

Install the service override (/etc/systemd/system/silo.service.d/postgresql.conf, matching silo-pg.conf) so systemd clears any default disk-mode arguments and starts silo server in PostgreSQL mode:

[Service]
EnvironmentFile=
EnvironmentFile=/etc/default/silo
ExecStart=
ExecStart=/usr/bin/silo server --address :9000 --console-address :9001 --certs-dir /etc/silo/certs

Reload systemd and start the first writable gateway:

sudo systemctl daemon-reload
sudo systemctl enable --now silo
sudo systemctl status silo --no-pager
sudo journalctl -u silo -n 100 --no-pager

On first startup against an empty database, the writable gateway initializes schema 14 (migrations 0001 through 0014) inside a transaction and persists SILO_PG_SEGMENT_SIZE and SILO_PG_MAX_OBJECT_SIZE. Wait for initialization to finish before starting additional gateways.

3. Run on macOS (Apple Silicon)

For local verification on Apple Silicon (darwin/arm64), place public.crt and private.key in your certificate directory and launch ./silo-darwin-arm64 with environment variables prompted interactively so secrets stay out of shell history:

chmod +x ./silo-darwin-arm64
read -r -s -p 'PostgreSQL DSN: ' SILO_PG_DSN; printf '\n'
read -r -p 'Root access key: ' MINIO_ROOT_USER
read -r -s -p 'Root secret key: ' MINIO_ROOT_PASSWORD; printf '\n'
export SILO_PG_DSN MINIO_ROOT_USER MINIO_ROOT_PASSWORD
export SILO_PG_READ_ONLY=off MINIO_REGION=us-east-1
./silo-darwin-arm64 server --address :9000 --console-address :9001 --certs-dir /path/to/certs

4. Verify database-aware health checks

From a client trusting the S3 TLS CA, verify both read and write health endpoints:

curl --fail --cacert /path/to/s3-ca.crt https://s3.example.net:9000/minio/health/cluster/read
curl --fail --cacert /path/to/s3-ca.crt https://s3.example.net:9000/minio/health/cluster

A healthy writable gateway returns HTTP 200 on both endpoints. Next, follow the Quickstart or SDK & CLI Access to create application credentials and buckets.

6.2 - High availability

Several stateless gateways, standby gateways and PostgreSQL failover.
Note

Running multiple stateless read-write gateways against a single PostgreSQL primary is part of the core pgsilo MVP. Read-only hot standby gateways (SILO_PG_READ_ONLY=on) connected to physical PostgreSQL standbys are a Preview feature. pgsilo does not provide automatic database failover, old-primary fencing, or zero-RPO guarantees; persistence, replication, and failover are governed by your PostgreSQL HA cluster.

Because pgsilo gateways hold no local object files on disk, multiple gateways can share one PostgreSQL primary while PostgreSQL physical replication protects the underlying data.

Add a writable gateway

  1. Install the exact same silo binary build on the new gateway host.
  2. Point SILO_PG_DSN to the same PostgreSQL primary database (silo) and owner (silo_owner). Use identical root credentials, effective region, static SSE-S3 keys, SILO_PG_SEGMENT_SIZE, and SILO_PG_MAX_OBJECT_SIZE.
  3. Install the PostgreSQL CA certificate and S3 TLS certificates covering the gateway’s hostname or load-balancer SANs.
  4. Let the first writable gateway finish schema initialization before starting additional gateways. Verify both /minio/health/cluster/read and /minio/health/cluster return HTTP 200 on the new gateway before adding it to the load balancer’s write pool.

Each gateway opens up to SILO_PG_MAX_CONNS connections (32 by default: 4 control, 2 coordination, and 26 data connections). Two default gateways consume up to 64 PostgreSQL connections before counting application SQL sessions, replication, and administration. Route read-write traffic with /minio/health/cluster and read-only traffic with /minio/health/cluster/read.

Read-only gateways on a physical standby (Preview)

After configuring PostgreSQL physical streaming replication and confirming the standby has replayed schema 14 (migration:0001 through 0014), configure a read-only gateway against the standby endpoint:

SILO_PG_DSN="postgresql://silo_owner:URL_ENCODED_PASSWORD@pg-read.example.net:5432/silo?sslmode=verify-full&sslrootcert=/etc/silo/postgres-ca.crt"
SILO_PG_READ_ONLY="on"

A read-only gateway verifies schema compatibility at startup but never initializes, migrates, or runs background maintenance. Even if pointed at a writable primary, SILO_PG_READ_ONLY=on rejects all S3 mutation requests.

Gateway & database state/minio/health/cluster/read/minio/health/clusterMutation behavior
Healthy writable gateway on primary200200Allowed (subject to IAM / native auth)
Healthy explicit read-only gateway (SILO_PG_READ_ONLY=on)200503Rejected with AccessDenied
Writable gateway whose database enters recovery / read-only200 (if readable)503Fails with retryable service/read-only error
Database unreachable503503Fails (process liveness /minio/health/live may remain 200)

Standby reads reflect asynchronous replication lag and can be canceled by PostgreSQL recovery conflicts. Applications requiring read-after-write consistency must read from a primary gateway or coordinate against PostgreSQL LSN replay positions.

IAM cache freshness and the 5-second lease

Gateways authorize S3 requests against an in-memory IAM and bucket-metadata snapshot governed by a strict 5-second lease measured from the start of each database observation query:

  • Gateways poll PostgreSQL every 1 second and also listen on LISTEN silo_control_rev for immediate wakeups. NOTIFY is only a hint; missed notifications never cause permanent staleness.
  • Schema 14 pairs the monotonic integer revision with a persistent random UUID revision_token updated in every control-plane transaction. After a failover, any change in revision_token—or any change in pg_is_in_recovery() state or listener reconnection—forces a full control-plane reload even if the integer revision matches.
  • Until a required reload completes, an unexpired snapshot keeps its existing deadline without renewal; local invalidation revokes the lease immediately. Once the 5-second lease expires without a fresh database observation, IAM-authenticated requests fail closed (503) rather than serving stale permissions.
  • Physical standby gateways verify freshness using replicated control-plane heartbeats written by a writable gateway on the primary. Clocks on the primary and standby hosts must stay synchronized within 500 milliseconds. Heartbeat age plus the 500 ms clock-skew allowance is subtracted from the 5-second lease window. Always keep at least one writable gateway running on the primary so standby heartbeats stay fresh.

For design details, see IAM, Control Plane & Cache Freshness.

PostgreSQL failover sequence

  1. Fence the old primary through your PostgreSQL HA manager (e.g., Patroni) and verify it can no longer accept writes.
  2. Promote the selected standby according to your RPO policy and update the primary DNS/VIP endpoint.
  3. Verify writable gateways reconnect to the promoted primary, observe pg_is_in_recovery() = false, and return HTTP 200 on /minio/health/cluster.
  4. Verify authorization and maintenance: test both allowed and denied S3 requests on every gateway, confirm clock synchronization (<= 500 ms) and heartbeat replication for any remaining standbys, and verify via metrics (minio_pg_lifecycle_leader) that a writable primary gateway has acquired the maintenance lease.
  5. Restore application traffic. Note that revision_token detects split-brain control caches after failover, but it does not fence an old primary or recover object writes lost during asynchronous replication.

6.3 - Backup and restore

Back up objects and IAM with PostgreSQL tools, and restore them.

Because pgsilo gateways are stateless, backing up the PostgreSQL cluster backs up all objects, versions, multipart parts, annotations, bucket policies, and IAM accounts together. Complete disaster recovery requires a physical PostgreSQL cluster backup, a continuous archived WAL stream, and separately preserved external secrets (especially static SSE-S3 KMS keys).

Preserve the complete recovery set

The PostgreSQL database stores all of the following in transactional consistency:

  • Object byte segments, version metadata, and delete markers
  • Active multipart upload state and uploaded parts
  • Object annotations, annotation payloads, and the orphan cleanup queue
  • Bucket configurations, quotas, Object Lock policies, S3 IAM users/policies/service accounts, and native PostgreSQL role bindings (silo.native_auth_principals)
  • Schema migration ledger (silo.meta) and control-plane revision tokens

Physical backups preserve database tables, role OIDs, and relation OIDs, but you must back up these external items independently:

  • The exact silo binary version and checksums matching the database schema version (schema_version = 14)
  • Gateway environment configuration (/etc/default/silo), S3 root credentials (MINIO_ROOT_USER / MINIO_ROOT_PASSWORD), and every static SSE-S3 master key (MINIO_KMS_SECRET_KEY / MINIO_KMS_SECRET_KEY_FILE) ever used to encrypt retained objects
  • PostgreSQL and S3 TLS certificates, private keys, CA bundles, and webhook notification target credentials
Caution

Never store the only copy of your PostgreSQL backup repository or KMS keys inside the same pgsilo S3 service that depends on the database being backed up. Without the matching static SSE-S3 key or customer SSE-C key, restored encrypted rows in PostgreSQL cannot be decrypted.

Physical backup with pgBackRest

Configure an independent pgBackRest repository, WAL archiving, and retention policy on your PostgreSQL cluster, then verify and run a full physical backup on the database host:

sudo -u postgres pgbackrest --stanza=YOUR_STANZA check
sudo -u postgres pgbackrest --stanza=YOUR_STANZA --type=full backup
sudo -u postgres pgbackrest --stanza=YOUR_STANZA info

Confirm that pgbackrest info reports a valid backup timestamp and continuous WAL archive range.

Rehearse physical restore and PITR

  1. Select the recovery target (timestamp, LSN, or transaction ID) and prepare an isolated PostgreSQL host so the restored cluster does not conflict with production.
  2. Restore the cluster and replay WAL to the target point using pgBackRest. Deploy the silo binary version compatible with the restored schema_version (14).
  3. Install matching external configuration and secrets: restore /etc/default/silo, static MINIO_KMS_SECRET_KEY values, and TLS certificates. Start gateways pointing only at the restored database.
  4. Verify data and authorization:
    • Check plaintext and SSE-S3 object SHA-256 digests, version histories, and delete markers.
    • Verify multipart uploads, object annotations, and ZIP extraction.
    • Test both allowed and denied requests for S3 IAM users and silo_api SQL roles, plus bucket quotas and Object Lock retention.
    • Review any IAM credential revocations or policy changes that occurred after the PITR target timestamp, since point-in-time recovery restores the IAM state as of that earlier timestamp.
  5. Check health and maintenance leases (/minio/health/cluster/read, /minio/health/cluster, and minio_pg_lifecycle_leader) before opening client traffic.

Application rows and silo_api object writes committed in the same SQL transaction recover atomically to the same point in time. Note that PostgreSQL PITR cannot recall webhook notifications already delivered to external endpoints before the rollback point.

Why logical pg_dump is not a drop-in migration

pg_dump exports SQL tables and definitions, but pgsilo records PostgreSQL internal role OIDs and relation OIDs (regclass / oid) inside silo.bucket_acl and silo.native_auth_principals. Restoring a logical dump into a new PostgreSQL cluster assigns different OIDs to roles and ACL tables, breaking native authorization and SQL bucket ACL lookups.

Current pgsilo builds do not include an automated cross-cluster OID remapping utility. Always use physical cluster backup and restore (pgBackRest / pg_basebackup + WAL replay) for full disaster recovery, and never manually edit private OID columns in silo.* tables.

6.4 - Upgrade

Schema migrations and gateway upgrades.

Upgrading pgsilo across schema versions requires a planned maintenance window. Because a database schema migration does not automatically stop running gateway binaries, never run mixed gateway schema versions concurrently against the same PostgreSQL database.

Coordinated upgrade sequence

  1. Record current versions and take a physical backup: record the running silo binary checksums and schema_version, take a verified physical backup (Backup and restore), and confirm external SSE-S3 KMS keys are backed up.
  2. Stop all gateways and SQL writers: drain client traffic, stop every writable and read-only silo gateway, disable automatic systemd/supervisor restarts, and pause direct silo_api SQL writer jobs. Verify in pg_stat_activity that all gateway sessions have exited.
  3. Install the new binary on all gateway hosts and verify SHA-256 checksums.
  4. Migrate the database from a single writable gateway: start one writable gateway connected to the PostgreSQL primary. On startup, it applies pending migrations inside a transaction as silo_owner. Never attempt schema migration from a read-only gateway.
  5. Verify schema 14 and health endpoints: confirm the first gateway passes /minio/health/cluster/read and /minio/health/cluster, and verify the migration ledger in silo.meta.
  6. Start remaining gateways: start the other writable gateways, wait for physical standbys to replay the schema migration WAL, and then start read-only standby gateways.
  7. Run post-upgrade verification before reopening client traffic: test plaintext and encrypted reads, versions, multipart completion, annotations, ZIP extraction, IAM allow/deny rules, and maintenance lease acquisition (minio_pg_lifecycle_leader).

As silo_owner or a database administrator, inspect the migration ledger with:

SELECT key, value
FROM silo.meta
WHERE key = 'schema_version' OR key LIKE 'migration:%'
ORDER BY key;

In the current build, schema_version must be 14, and entries migration:0001 through migration:0014 must match the SHA-256 migration hashes embedded in the silo binary. Never grant application roles access to silo.meta or manually edit migration rows.

Summary of historical schema versions

Schema versionKey changesCompatibility boundary
Schema 12Added checksum metadata compatibility verification (CRC64NVME, SHA512, XXHASH*)Schema 11 binaries cannot interpret new checksum type bits and are rejected after schema 12 commits
Schema 13Added object annotations, transactional quota counters, copy_object annotation support, and deferred annotation payload cleanupSchema 12 binaries are rejected after schema 13 commits
Schema 14Added persistent random UUID revision_token to the control-plane revision table so gateways detect split-brain IAM state after failoverSchema 13 binaries are rejected after schema 14 commits

When upgrading across builds that corrected region lookup precedence (MINIO_REGION > MINIO_REGION_NAME > MINIO_SITE_REGION > persisted site region), also verify that no gateway environment file carries an unintended legacy MINIO_REGION_NAME override. See Configuration: Region selection.

Rollback rules

Once a schema migration transaction commits in PostgreSQL, older gateway binaries refuse to start against that database. If a migration fails or you must roll back to an earlier schema version:

  • First check silo.meta in PostgreSQL to see whether the migration transaction actually committed (a lost network connection does not prove rollback).
  • Never decrement schema_version, alter migration:* hashes, or drop columns manually to force an older binary to start.
  • To revert to an older schema version, perform a full physical restore from your pre-upgrade backup and WAL archive.

6.5 - Monitoring

Health endpoints and the PostgreSQL metrics endpoint.

Monitor pgsilo gateways, PostgreSQL, and your backup repository as distinct layers. Health check endpoints control load-balancer routing, /minio/metrics/v3/pg exposes gateway-to-PostgreSQL Prometheus metrics, and PostgreSQL system views track physical storage and transaction age.

Health check endpoints

Note

The /minio/health/* and /minio/metrics/* HTTP paths are retained for compatibility with standard S3 load-balancer and Prometheus configurations.

EndpointWhat it checksLoad-balancer use
/minio/health/liveGateway process liveness and local request queueProcess liveness check
/minio/health/readyGateway startup initialization and local request queueGeneral readiness (does not verify PostgreSQL writability)
/minio/health/cluster/readPostgreSQL database readabilityRead-only gateway pool routing
/minio/health/clusterPostgreSQL database writability (pg_is_in_recovery() = false and SILO_PG_READ_ONLY=off)Read-write gateway pool routing
curl --fail --silent --show-error \
  --cacert /path/to/s3-ca.crt \
  https://s3.example.net:9000/minio/health/cluster/read
curl --fail --silent --show-error \
  --cacert /path/to/s3-ca.crt \
  https://s3.example.net:9000/minio/health/cluster

A healthy writable gateway returns HTTP 200 on both endpoints. A healthy read-only standby gateway (SILO_PG_READ_ONLY=on) returns 200 on /minio/health/cluster/read and 503 on /minio/health/cluster. Note that /minio/health/live can still return 200 when PostgreSQL is unreachable.

Prometheus metrics (/minio/metrics/v3/pg)

The PostgreSQL backend exposes Prometheus metrics at /minio/metrics/v3/pg with metric names prefixed by minio_pg_. Generate a Prometheus scrape configuration with mcli using your administrative alias (pg-admin):

umask 077
mkdir -p "$HOME/.config/pgsilo-monitoring"
mcli admin prometheus generate pg-admin --api-version v3 \
  > "$HOME/.config/pgsilo-monitoring/prometheus-generated.yml"

Set metrics_path in the generated job to /minio/metrics/v3/pg and configure your Prometheus server to trust the gateway’s TLS CA. Keep the generated file out of version control because it contains bearer tokens.

AreaMetric namesInterpretation
Pool utilizationminio_pg_pool_acquired_connections, minio_pg_pool_max_connectionsLabeled by pool (data, control, coord); track saturation per gateway
Admission & pool waitsminio_pg_data_permits_waiters, minio_pg_pool_canceled_acquires_totalRising waiters indicate concurrent S3 requests hitting the gateway slot ceiling
Statistics freshnessminio_pg_statistics_success, minio_pg_statistics_age_secondsVerify statistics_success == 1 before trusting gauge values
Database role stateminio_pg_in_recovery, minio_pg_writableReports whether the target PostgreSQL instance is in recovery or writable
Annotation reaperminio_pg_annotation_garbage_payloads, minio_pg_annotation_garbage_bytesUnlinked annotation payloads queued for background batch deletion
Lifecycle maintenanceminio_pg_lifecycle_leader, minio_pg_lifecycle_errors_totalExactly one writable primary gateway should report lifecycle_leader == 1
Physical DB & WAL sizeminio_pg_database_bytes, minio_pg_cluster_wal_bytes_totalTotal PostgreSQL database bytes and cluster-wide WAL bytes
Standby replay backlogminio_pg_replay_pending_bytesUnreplayed WAL bytes on a physical standby (omitted when unavailable)
Capacity declarationminio_pg_capacity_knownAlways 0 in PostgreSQL mode because PostgreSQL does not report an exclusive S3 disk volume size

Logical quota vs. physical PostgreSQL storage

  • Billable logical bytes (billableBytes): counts plaintext object bodies (size / objectsTotalSize) plus attached annotation bytes (annotationBytes) across all committed versions (excluding delete markers). Incomplete multipart uploads do not count toward logical quota until CompleteMultipartUpload, even though their uploaded parts already occupy physical table space.
  • Console Unknown capacity: because minio_pg_capacity_known is 0, the web Console displays Unknown for total/free drive capacity. Unknown does not mean 0 B free.
  • Physical database size: minio_pg_database_bytes (and pg_database_size()) includes co-located application tables, B-tree indexes, TOAST tables, and dead MVCC tuples awaiting VACUUM. Deleting objects or unlinking annotations releases logical quota immediately, while physical disk pages become reusable only after background cleanup and PostgreSQL VACUUM.

PostgreSQL inspection queries

Run these read-only queries with a PostgreSQL monitoring role to inspect connection states, long-running transactions (which hold back VACUUM), and total database size:

SELECT pg_is_in_recovery() AS in_recovery;
SHOW transaction_read_only;

SELECT application_name, state, count(*)
FROM pg_stat_activity
WHERE datname = current_database()
GROUP BY application_name, state
ORDER BY application_name, state;

SELECT pid, application_name, state,
       clock_timestamp() - xact_start AS transaction_age
FROM pg_stat_activity
WHERE datname = current_database() AND xact_start IS NOT NULL
ORDER BY xact_start;

SELECT pg_size_pretty(pg_database_size(current_database())) AS database_size;

6.6 - Troubleshooting

Common failures, HTTP 429 and 503, and how to resolve them.

When diagnosing failed S3 or SQL requests, record the timestamp, gateway host, binary commit, HTTP status and S3 error code (or SQLSTATE), request ID, bucket, key, and versionId. Strip Authorization headers, presigned URL query strings, passwords, DSNs, and KMS/SSE-C keys before sharing logs.

First checks

Inspect the gateway service status and recent journal logs on Linux:

sudo systemctl status silo --no-pager
sudo journalctl -u silo --since '15 minutes ago' --no-pager

Then check the database-aware health endpoints (/minio/health/cluster/read and /minio/health/cluster) and verify PostgreSQL recovery and read-only state directly using a protected libpq service entry (~/.pg_service.conf with sslmode=verify-full):

PGSERVICE=silo-ops psql -X -v ON_ERROR_STOP=1 \
  -c 'SELECT current_database(), session_user, pg_is_in_recovery();' \
  -c 'SHOW transaction_read_only;'

Symptoms, root causes, and actions

SymptomCheck firstResolution
TLS certificate or hostname verification failureSILO_PG_DSN hostname, certificate SANs, /etc/silo/postgres-ca.crt, and file ownership (root:silo)Fix certificate SANs or file permissions; keep sslmode=verify-full enabled
Gateway refuses to start due to storage setting mismatchPersisted SILO_PG_SEGMENT_SIZE and SILO_PG_MAX_OBJECT_SIZE in silo.metaMatch the gateway’s environment variables to the initialized store settings; never edit silo.meta manually
Read-only standby gateway refuses to startschema_version on the standby and replication replay lagMigrate the primary from a writable gateway first and wait for the standby to replay the migration WAL
HTTP 503 SlowDown (or HTTP 429 TooManyRequests on builds before 1d387725c) under concurrencyConcurrent request limit (min(SILO_PG_MAX_CONNS, memlimit / (2 * segment_size))) and SILO_PG_QUEUE_TIMEOUTIncrease SILO_PG_MAX_CONNS (e.g., to 72 for 64 concurrent clients), ensure gateway RAM and PostgreSQL max_connections are sufficient, and use 1d387725c or later so bursts queue up to SILO_PG_QUEUE_TIMEOUT (5s)
/minio/health/live is 200, but /minio/health/cluster returns 503PostgreSQL connectivity, pg_is_in_recovery(), connection pool exhaustion, or SILO_PG_READ_ONLY=onInspect PostgreSQL logs, pg_stat_activity, and minio_pg_* metrics
S3 AccessDeniedIAM policy Allow/Deny, service-account/STS session policy, SILO_PG_READ_ONLY=on, and iam_and_pg role bindingsVerify IAM permissions on the target key/version and check silo.native_auth_principals and silo_bucket grants if iam_and_pg is enabled
SQL SQLSTATE 42501session_user (whether SET ROLE was used), USAGE on silo_api/silo_bucket, function EXECUTE, and bucket ACL table grantsConnect directly as the application SQL login (app_sql) and grant the required function and bucket ACL privileges
SQL SQLSTATE 0A000Transaction isolation level (Repeatable Read / Serializable), SSE-encrypted object, or unsynchronized bucket policyRun SQL writes under Read Committed; use the S3 API to read/write encrypted objects
CompleteMultipartUpload failsTotal assembled size vs. SILO_PG_MAX_OBJECT_SIZE, part sizes (>= 5 MiB except last part), part order, and ETagsEnsure the combined object does not exceed SILO_PG_MAX_OBJECT_SIZE (default 256 MiB, max 1 GiB)
IAM requests fail across gateways after failoverOld-primary fencing, revision_token reload, standby replication heartbeats, and host clock skew (<= 500 ms)Ensure a writable gateway is connected to the promoted primary, writing heartbeats, and NTP keeps primary/standby clocks within 500 ms
Database disk size stays high after DELETERetained historical versions, incomplete multipart uploads, minio_pg_annotation_garbage_bytes, long SQL transactions, and VACUUMDelete old versions or abort incomplete uploads, verify minio_pg_lifecycle_leader == 1, and check pg_stat_activity for long-running snapshots blocking VACUUM

HTTP 503 SlowDown vs. HTTP 429 TooManyRequests

Each gateway limits active S3 requests to min(SILO_PG_MAX_CONNS, memlimit / (2 * SILO_PG_SEGMENT_SIZE), api requests_max). With the default SILO_PG_MAX_CONNS=32, bursts above 32 concurrent requests hit admission control:

  • Starting with 1d387725c on feat/pg-backend (2026-11-08), excess requests wait in an admission queue for up to SILO_PG_QUEUE_TIMEOUT (5s by default) without holding a database connection. If the wait expires, the gateway returns HTTP 503 SlowDown, which boto3 and AWS SDK for Go v2 automatically retry with backoff.
  • In earlier builds, including 299378b and the frozen October 8, 2026 local checkpoint (3c7fdc03), admission queueing does not exist: excess requests immediately receive HTTP 429 TooManyRequests, which standard S3 SDKs do not retry by default.

See Configuration: Concurrent request limit for capacity sizing steps.

Uncertain writes after network timeouts

A network drop or request timeout can occur after PostgreSQL commits the transaction but before the client receives the HTTP or SQL response. Blindly retrying an unconditional PutObject in a versioned bucket creates a duplicate version.

  • Before retrying a timed-out write, check whether the expected key, versionId, ETag, or business operation ID already exists.
  • When writing application rows and objects together in one SQL transaction via silo_api, record an application idempotency key in your business table inside the same transaction so you can query its commit status deterministically.

6.7 - Deploy with Pigsty

The Pigsty role for Silo with a PostgreSQL backend, and its status.
Important

The minio_backend: postgres branch in the Pigsty minio Ansible role is pinned to an unpublished coordination commit (5633285b2b8d40321e458026abe2656944674ed3) and depends on the unpublished silo DEB/RPM packages (MVP in progress). Released versions of Pigsty do not yet include this backend branch.

The coordinated Pigsty minio role adds a minio_backend: postgres execution path to minio.yml. It deploys silo systemd services connected to an existing PostgreSQL database without inheriting erasure-coded disk arguments or local volume mounts.

Scope and prerequisites

  • The role deploys stateless silo gateways only; it does not create the PostgreSQL cluster, database owner (silo_owner), or silo database, and it does not configure database backups. Complete the database setup in Install first.
  • minio_pg_dsn must be a single-host postgresql:// URI with an explicit username, database name, sslmode=verify-full, and sslrootcert matching minio_pg_ca_file (located under /etc/silo/). The role rejects multi-host fallback URIs and query parameters that override connection identity.
  • Certificates used by the gateway must include 127.0.0.1 in their IP SANs because the role’s post-start health check probes https://127.0.0.1:9000/minio/health/cluster (for writable gateways) or /minio/health/cluster/read (for read-only gateways) with strict TLS verification.

Example two-gateway inventory

Store credentials (vault_silo_root_user, vault_silo_root_password, and URL-encoded vault_silo_pg_dsn) in an encrypted Ansible Vault file (vault.yml), and define the two-gateway silo_pg group in inventory.yml:

all:
  children:
    silo_pg:
      hosts:
        10.10.10.11: { minio_seq: 1 }
        10.10.10.12: { minio_seq: 2 }
      vars:
        minio_cluster: silo-pg
        minio_type: silo
        minio_backend: postgres
        minio_https: true
        minio_domain: s3.example.net
        minio_access_key: "{{ vault_silo_root_user }}"
        minio_secret_key: "{{ vault_silo_root_password }}"
        minio_pg_dsn: "{{ vault_silo_pg_dsn }}"
        minio_pg_ca_src: /srv/pgsilo-pki/postgres-ca.crt
        minio_pg_ca_file: /etc/silo/postgres-ca.crt
        minio_pg_max_conns: 32
        minio_pg_control_conns: 4
        minio_pg_coord_conns: 2
        minio_pg_acquire_timeout: 5s
        minio_pg_request_timeout: 15m
        minio_pg_segment_size: 8MiB
        minio_pg_max_object_size: 256MiB
        minio_pg_package_src: /srv/artifacts/silo_<version>_<arch>.deb
        minio_pg_package_sha256: REPLACE_WITH_PACKAGE_SHA256
        minio_pg_binary_sha256: REPLACE_WITH_BINARY_SHA256
        minio_extra_vars: |
          MINIO_REGION=us-east-1
        minio_buckets: []
        minio_users: []

Setting minio_buckets: [] and minio_users: [] skips Pigsty’s default pgbackrest backup bucket/user creation so database backups are never stored inside the pgsilo service that depends on that same database.

Deploy the first writable gateway alone (-l 10.10.10.11 -e minio_provision=false) so it initializes the PostgreSQL schema without racing a second node, then run the playbook across the group:

ansible-playbook -i inventory.yml -l 10.10.10.11 --ask-vault-pass \
  -e minio_provision=false -e @vault.yml minio.yml

ansible-playbook -i inventory.yml -l silo_pg --ask-vault-pass \
  -e @vault.yml minio.yml

What the role configures

ComponentBehavior in minio_backend: postgres
Package & binary verificationCopies the local .deb/.rpm from minio_pg_package_src, verifies minio_pg_package_sha256, installs it, and verifies /usr/bin/silo against minio_pg_binary_sha256
OS accountRuns the service as minio:minio (minio_user defaults to minio, whereas manual DEB installation uses silo:silo)
Service & environmentWrites /etc/systemd/system/silo.service and /etc/default/silo (root:minio, mode 0640) with no_log secret protection
TLS certificatesPlaces public.crt and private.key in /home/<minio_user>/.minio/certs/ and the PostgreSQL CA at /etc/silo/postgres-ca.crt
Read-only gatewaysSetting minio_pg_read_only: true on a standby gateway host configures SILO_PG_READ_ONLY=on, skips bucket/user provisioning, and probes /minio/health/cluster/read
MonitoringDefaults MINIO_PROMETHEUS_AUTH_TYPE=public in the environment template and provides the files/grafana/minio/silo-pg.json dashboard; restrict metrics network access or override to jwt authentication

Note that re-running minio.yml across nodes does not replace the stop-all-writers procedure required for a schema migration; follow Upgrade whenever schema_version changes.

7 - pgs3: in-process S3

The alternative that serves S3 from PostgreSQL background workers, compared with pgsilo.

pgs3 is an alternative S3 implementation for PostgreSQL written in Rust with pgrx (0.19.2) under the Apache-2.0 licence. Instead of running an external Go gateway in front of PostgreSQL as pgsilo does, pgs3 loads into PostgreSQL via shared_preload_libraries and serves path-style S3 HTTP requests directly from PostgreSQL background workers.

Note

pgs3 is an early alpha (v0.1.1, commit d841238, 2026-09-03). Its functional and Ceph compatibility suites pass, but small-object latency/throughput and the 100,000-object bucket Fork target do not meet its release gates. Mimus documents pgsilo as the primary S3 path and summarizes pgs3 here for comparison.

How pgs3 works

pgs3 splits protocol framing from storage semantics across two layers inside the PostgreSQL server process:

  1. PostgreSQL background workers (Rust) own the HTTP listener (pgs3.listen_addr, pgs3.port, pgs3.workers), verify SigV4 headers and presigned URLs, parse aws-chunked streaming payloads, and invoke SQL functions over SPI in short transactions.
  2. SQL semantic layer defines buckets, permanently versioned objects, delete markers, multipart uploads, content-addressed canonical blobs (pgs3.blob) and chunk extents (blob_extent).

Because identical payloads reference the same canonical blob rows, CopyObject, historical version Restore, and metadata-only bucket Fork share physical bytes through reference counts rather than copying payload bytes. Access keys map to unprivileged PostgreSQL roles, and PostgreSQL row-level security (RLS) enforces tenant isolation inside the database.

pgs3 vs pgsilo

The pgsilo PRD evaluated the in-process background-worker and deduplicating-blob model before choosing an external stateless Silo gateway (ObjectLayer). The two designs make opposite trade-offs:

Dimensionpgsilo (Silo PostgreSQL backend)pgs3 (Rust/pgrx extension)
StatusMVP in progress (feat/pg-backend @ 1d387725c, schema 14)Research / early alpha (v0.1.1, d841238)
LicenceAGPL-3.0-or-laterApache-2.0
Process modelExternal stateless Go gateway (silo server) connecting over pgx poolsIn-process PostgreSQL background workers (shared_preload_libraries = 'pgs3')
PostgreSQL versionsStock PostgreSQL 16–18 (no extension binary required on the DB host)PostgreSQL 17 and 18 (16 best-effort); requires installing the pgs3 C/Rust extension
Addressing and TLSPath-style and virtual-host style; native TLS terminationPath-style only; cleartext HTTP only (requires an external TLS reverse proxy)
Authentication and authorizationS3 IAM users, groups, policies, service accounts, Basic AssumeRole STS, plus optional IAM AND PostgreSQL native authorizationSigV4 access keys mapped to PostgreSQL roles; PostgreSQL GRANT and default-deny RLS (no IAM policy language or STS)
Object storage modelDedicated per-version bytea segments (8 MiB default); no cross-object deduplicationContent-addressed canonical blobs (pgs3.blob) and chunk extents with reference-counted deduplication
Encryption, Lifecycle, Object Lock, QuotaSSE-C and static-key SSE-S3; Preview lifecycle, Object Lock and hard bucket quotasNot implemented
Protocol extensionsObject annotations (?annotation), ZIP member extraction (x-minio-extract), force bucket delete, silo_api SQL functionsSQL historical version Restore and metadata-only bucket Fork
Failure and resource isolationGateway CPU/memory is isolated from the PostgreSQL server; gateway limits concurrency to 32 connections by defaultBackground workers share CPU, memory, I/O and connection slots with the PostgreSQL instance

Current status and validation (v0.1.1)

At v0.1.1 (validated 2026-08-31 on an 18-core Apple M5 Max Docker Desktop arm64 environment with PostgreSQL 17.10 and 18, fsync=on, synchronous_commit=on, 16 workers and 4 MiB default chunk size):

  • Passing gates:
    • PostgreSQL 17 and 18 SQL semantics, package runtime and 0.1.0 -> 0.1.1 extension upgrade.
    • Client matrix on PostgreSQL 17 and 18: AWS CLI (s3 and s3api), boto3, rclone, DuckDB httpfs, and a privileged s3fs FUSE mount (including a 100 MiB, 13-part multipart upload).
    • Selected Ceph s3-tests compatibility suite: 195/195 pass (from 209 candidate cases with 14 documented exclusions).
    • Crash recovery (SIGKILL), pending blob garbage collection, live SIGHUP reload, hot-standby GET/LIST with write rejection, and deterministic malformed-request fuzz suites.
    • 8 MiB staged PUT throughput (167.894 MiB/s, p50 47.40 ms, target ≥ 150 MiB/s) and 100k-object LIST / delimiter LIST (2.358 ms / 9.487 ms, targets < 5 ms / < 10 ms).
  • Failing performance gates:
    • Small-object GET (Gate 12): p50 up to 3.342 ms (target < 0.5 ms) and minimum rate 3,989.933 ops/s at 16 KiB (target ≥ 30,000 ops/s). Content-addressed deduplication requires an extra indexed lookup into pgs3.blob on every small read.
    • Small-object PUT (Gate 13): minimum rate 1,555.986 ops/s at 4 KiB (target ≥ 5,000 ops/s).
    • 100,000-object bucket Fork (Gate 16): 1,944.071 ms on the authoritative golden image (target < 1,000 ms), emitting 154,178,689 bytes of WAL to update reference counts.

Deliberate exclusions and limitations

  • No built-in TLS or virtual-host addressing: pgs3 listens on cleartext HTTP and serves one configured database (pgs3.target_database). Production deployments must terminate TLS in an external reverse proxy (nginx, HAProxy) that preserves the signed path and headers.
  • No IAM policy language, ACLs, lifecycle or encryption: access control relies entirely on PostgreSQL roles, grants and RLS. Because SigV4 verification requires the secret key, secrets are stored reversibly in the database catalog; backups must be treated as credential-bearing material.
  • Whole-object GET buffering: full-object GET currently materializes the response through a single SQL bytea and Rust Vec before writing to the socket. Until response streaming is added, deployments must cap object sizes well below the 5 GiB HTTP parser ceiling.
  • Composite checksums: SHA-256 COMPOSITE multipart checksums are verified and stored; non-SHA multipart selections (such as CRC32) verify per-part checksums but do not validate or persist a final composite checksum.

Source code, build instructions and design records (D001–D027) are available at github.com/pgsty/pgs3.

8 - Status

MVP goal, release checklist, 2026-11-08 baseline and fixes, known issues and the history of local deliveries.
Protocol status
MVP in progress
Target release form
Experimental PostgreSQL storage backend merged into Silo and shipped with standard Silo releases (linux/amd64 and linux/arm64, DEB and RPM); no standalone pgsilo executable
Current candidate
Silo branch feat/pg-backend at 1d387725c86e8f81fe86a70c30cf25ce5048b189 (2026-11-08, schema 14): 299378b plus two fixes, ca158fb6 and 1d387725c. Companion silo-pkg at cc22fd9
Public release
None. The candidate has not been pushed, merged into Silo main, tagged or published. The October 2026 local preview (3c7fdc03) remains an internal ARM64 preview

MVP goal and release form

Since 2026-11-08, the goal for pgsilo is an MVP release candidate that merges into Silo main as an experimental storage backend. Users start PostgreSQL mode by passing a postgres:// or postgresql:// DSN or setting SILO_PG_DSN on the standard silo binary. The full goal is recorded in MVP goal; the Supported, Preview and Not supported tiers are in Compatibility.

The merge into Silo main has three prerequisites:

  1. The current Silo release completes. feat/pg-backend is then synced to that release tag, upstream changes to shared files and new ObjectOptions semantics are implemented or explicitly rejected in PostgreSQL mode, and the release checklist runs again.
  2. The four annotation policy actions are public. The server uses GetObjectAnnotationAction, ListObjectAnnotationsAction, PutObjectAnnotationAction and DeleteObjectAnnotationAction, which exist only in an unpublished silo-pkg branch (cc22fd9). They must be published to the public silo-pkg, coordinated with the Server and Console releases, or handled another way. Without them the server does not compile against its public go.mod (checked on 2026-11-08).
  3. The user decides the merge. Pushing, merging, publishing packages or images, and deploying each need separate approval.

Release checklist

Verification is proportional to an MVP: each item is a functional or smoke test that completes in minutes, and the whole checklist completes in one to two hours. Long-running stability or endurance runs, full instrumentation matrices, repeated benchmark rounds and root-cause campaigns for rare intermittent failures are not part of the MVP and are not gates after it.

#Item
1internal/pgstore tests on PostgreSQL 18 and on PostgreSQL 16
2Regular Silo unit tests (go test, no race detector), to show that erasure-coded mode did not regress
3mint core once over HTTPS (covers SSE-C)
4Ceph s3-tests, 195 pinned cases
5Client smoke: mcli, AWS CLI v2, boto3, AWS SDK for Go v2
6Reduced performance smoke that takes minutes; numbers are recorded, not gated
7General Silo Console 2.6.0 smoke against PostgreSQL mode
8Runtime smoke on linux/amd64

Item 2 needs free disk space: when the temporary directory’s disk is nearly full, erasure-coded tests fail in bulk at Silo’s minimum free-space threshold.

Baseline on 299378b (2026-11-08)

On 2026-11-08, an earlier, fuller form of the checklist ran once against feat/pg-backend at 299378b562395989eb666d048b4f6138be7deb25 (schema 14, Go 1.27.3) with PostgreSQL 18.6 and 16.15 containers (fsync=on, synchronous_commit=on). It used race-enabled unit tests, mint core and full over HTTP and HTTPS, and a performance smoke. These are one-off results; they do not apply to newer commits.

#ItemResultDetail (299378b, 2026-11-08)
1internal/pgstore on PG 18 and PG 16Pass185 top-level / 326 tests pass on both (-race, 0 skip)
2cmd and erasure-coded regressionFail (1 test)Linux container, -race: 1,515 top-level tests, 1,499 pass, 8 skip, 8 fail. Seven failures were file-permission tests that fail as root and pass when rerun as a non-root user. The remaining failure, TestPGIAMPolicyReadersKeepCompleteSnapshot, was fixed in ca158fb6 (see Fixes). internal/... without pgstore: 511 top-level pass, 4 skip
3mint over HTTP and HTTPSPassCore: HTTP 614 pass / 6 NA, HTTPS 644 pass / 6 NA. Full: HTTP 872 pass / 8 NA, HTTPS 947 pass / 7 NA, 0 fail. NA cases are replication, SSE-KMS, and SSE-C over HTTP. One transient container-to-host dial timeout in HTTP minio-go passed 185/185 on rerun
4Ceph s3-tests (195)Pass195/195 in 191.6 s (ceph/s3-tests@5522d1c)
5Client smokePassmcli, AWS CLI v2 2.37.9, boto3 1.43.108 and Go SDK: CRUD, 64 MiB multipart, cross-segment Range, 256 MiB read-back, EntityTooLarge at 256 MiB + 1 B
6Performance smokeRecordedSee Performance smoke
7Silo Console 2.6.0PassAPI and browser: sign-in, bucket creation and listing, 3 MiB upload, download with matching SHA-256, delete
8linux/amd64Pass (emulated)All four client suites and the 256 MiB check under x86_64 emulation; not tested on native amd64 hardware

The mint image was rebuilt from the pinned source and locks with the same 11 fixture revisions used in October 2026, so mint results are not from an unmodified upstream image.

Fixes after the baseline (2026-11-08)

Both fixes are local commits on feat/pg-backend; neither has been pushed.

CommitChange
ca158fb6Test only. TestPGIAMPolicyReadersKeepCompleteSnapshot now asserts that cache misses and mutations never merge single stored records, and that a listing or a revision-driven refresh installs the complete snapshot, so added and deleted records appear and disappear together. See Status review and baseline
1d387725cWhen the request budget is full, PostgreSQL mode waits up to SILO_PG_QUEUE_TIMEOUT (5 s by default, 0 s–1 min, 0s disables waiting) without holding a database connection. A disconnecting client stops waiting at once (499). When the wait expires, the gateway answers HTTP 503 SlowDown. Erasure-coded mode still answers HTTP 429 at once

Verification on 1d387725c (2026-11-08):

  • cmd IAM-related tests and the new queue tests (no race): 161 top-level pass, 5 skip, 0 fail; the queue test also passed once with -race. internal/pgstore: 185 top-level / 326 pass.
  • Ceph s3-tests: 195/195. mint core over HTTPS: 644 pass, 6 NA, 0 fail.
  • 64 concurrent clients with the default pool (SILO_PG_MAX_CONNS=32) and default AWS SDK for Go v2 retries, 90 s per phase:
PhaseSucceededFailedHTTP 429 / 503 seenp50 / p95 / p99 / max
PUT 4 KiB26,625 (295 ops/s)00 / 0210 / 326 / 466 / 1,110 ms
GET 4 KiB33,288 (369 ops/s)00 / 0162 / 247 / 362 / 591 ms

With SILO_PG_QUEUE_TIMEOUT=0s for comparison (20 s per phase), the gateway returned 596 (PUT) and 646 (GET) HTTP 503 responses. The SDK retried them; most succeeded, but 160 PUT and 188 GET requests still failed after three attempts. Retries alone do not cover a sustained 64-to-32 overload; the queue does.

Performance smoke on 299378b (2026-11-08)

The 2026-11-08 smoke ran a darwin/arm64 gateway (299378b) on an 18-core Apple Silicon macOS host against PostgreSQL 18.6 in a Docker Desktop VM over port forwarding, using aws-sdk-go-v2 on the same host with default checksums and no retries. These numbers cannot be compared with the October 2026 Lima VM benchmark in the history below.

WorkloadDefault pool (SILO_PG_MAX_CONNS=32)Expanded pool (SILO_PG_MAX_CONNS=72)
1 KiB PUT / GET p507.92 ms / 5.77 ms6.08 ms / 5.68 ms
1 MiB PUT / GET p5021.9 ms / 12.6 ms21.0 ms / 10.9 ms
64 MiB PUT / GET median95.8 MB/s / 234.6 MB/s82.9 MB/s / 155.1 MB/s
64-worker 4 KiB PUT (single bucket / spread)Requests above 32 got HTTP 429 TooManyRequests at once (fixed in 1d387725c)350.6 ops/s / 469.1 ops/s (0 errors)
ListObjectsV2 (1,000 keys) p5010.4 ms14.1 ms

Known issues

As of 1d387725c (2026-11-08):

IssueImpact and status
Brief HTTP 503 after IAM modificationsWhen one gateway updates IAM state, requests can briefly return HTTP 503 while caches refresh. Clients should retry HTTP 503. Deferred beyond the MVP.
Console 2.6.0 /api/v1/admin/site-replication returns HTTP 500PostgreSQL mode does not implement site replication and returns NotImplemented. Other Console pages work.
Lifecycle worker log noise under loadAt peak load, the lifecycle worker logs a one-time lease query timeout or "lifecycle policy changed". Lease takeover and epoch progression continue normally.
Version string reports DEVELOPMENT.GOGETDevelopment builds do not inject a version; the Silo release pipeline will.
Unpublished silo-pkg annotation actionsMerge prerequisite 2 above. Building from source needs silo-pkg at cc22fd9 until the actions are public.
amd64 tested only under emulationThe 2026-11-08 amd64 smoke ran under x86_64 emulation, not on native hardware.

Deferred beyond the MVP

  • Automatic high availability: define the scope and the validation when it is needed.
  • The brief HTTP 503 window during cross-gateway IAM refresh, and Python client throughput.
  • Merging the annotation interface into the general Silo Console and promoting Preview features to Supported.
  • Objects above 1 GiB, higher throughput, and multi-architecture container images.

Historical local delivery (2026-10-08)

Before the MVP plan was adopted on 2026-11-08, an internal schema 14 preview was frozen locally on 2026-10-08 (recorded at 2026-10-07T22:16:50Z). That build is ARM64-only and will never be pushed, merged, tagged, published or deployed.

ComponentCommit / artifact (2026-10-08 frozen preview)
Silo server3c7fdc03a27740526e9e6d8b1987a3ed00691948 (schema 14, built with Go 1.27.1)
Embedded Console3c4469d47a62526e008e25b8d415f2912f76a919 (custom build with annotation UI)
silo-pkg58686c71b9bc70d77ec945488548c140c0f776b0
Pigsty integration5633285b2b8d40321e458026abe2656944674ed3 (unpublished local branch)
Local ARM64 artifactssilo-linux-arm64, silo-darwin-arm64, silo_20261007153132.0.0-1PGSTY_arm64.deb, silo-postgresql-source.tar.gz

What the October 2026 validation on 3c7fdc03 and its preceding schema 13/14 candidates (dca464e5, 7cfea651) established:

  • Functional suites: Mint full HTTP (872 pass / 8 NA) and HTTPS (947 pass / 7 NA), Ceph s3-tests (195/195), 18 configured feature checks, two 10,000-part multipart runs, 32 application integration checks, 28 Console checks (including SQL, usage and TLS), 5 multi-gateway checks, 7 PITR checks, 11 Basic AssumeRole STS checks (including 900-second natural expiration), and 10 Pigsty v7 checks. Core kernel tests passed on PostgreSQL 16.15, 17.11 and 18.6.
  • Mixed recovery preflight (3c7fdc03): 1,208.363 active seconds, 24,186 mixed operations, 8 recovery scenarios passed, 418 verified objects, 0 request errors.
  • 3-round benchmark in a Lima Linux VM (3c7fdc03): Silo and PostgreSQL 18 shared 4 vCPUs and 8,000,000,000 bytes of memory on a local SSD (fsync=on, synchronous_commit=on, SILO_PG_MAX_CONNS=72), with a separate 4-vCPU / 2 GiB client boundary. Using a 64-worker AWS Go SDK v2 client for the concurrent 4 KiB PUT cases and the pinned Python client for the remaining cases, all 3 rounds (27 rows, 204,024 measured requests, 123,482 mixed operations, 0 errors) passed:
    • hot (single bucket, 64 workers, 4 KiB PUT): 806.963, 660.593, 736.328 ops/s across Rounds 1–3.
    • spread (spread buckets, 64 workers, 4 KiB PUT): 1500.231, 1249.699, 1400.237 ops/s across Rounds 1–3.
    • Earlier 3-round runs on the same 3c7fdc03 candidate that used the Python client for concurrent 4 KiB PUT failed 4 of 27 rows (hot 528.203 / 498.072 / 485.675 ops/s and spread 537.303 / 476.434 / 493.809 ops/s against the 500 ops/s target).
  • 72-hour endurance run (3c7fdc03) — Canceled, not passed: stopped at the user’s request after approximately 4.05 hours (14,562.377 active seconds, 287,912 operations, 0 request errors). Final post-run verification never executed, and the run is not recorded as a 72-hour pass.

9 - Design

Why pgsilo exists and the decisions that shaped it.

This section documents the engineering rationale and internal architecture of pgsilo: why the project pairs the Silo S3 frontend with a PostgreSQL ObjectLayer backend, how S3 and SQL share a single transactional state machine, and how multi-gateway caches and background workers maintain consistency.

Design documents

DocumentTopic
Why a PostgreSQL backendTarget workloads, lessons from pgs3, when to choose PostgreSQL vs. erasure-coded storage, and capacity bounds
Design decisionsThe ObjectLayer seam, 8 MiB bytea segments, commit_seq version ordering, lock hierarchy, and rejected alternatives
Integration with SiloAuditing erasure-coded assumptions in Silo, .minio.sys persistence, S3 Select snapshots, and why iam_and_pg intersects IAM
SQL API designSeparating silo, silo_api, and silo_bucket, session_user security hardening, and per-bucket security_barrier ACL views
IAM control planePool isolation, the 5-second freshness lease, standby heartbeats, and the schema 14 revision_token split-brain fix
Lifecycle and Object LockDatabase-enforced WORM retention, keyset lifecycle scanning, and epoch-fenced maintenance leases
MVP goal2026-11-08: ship as an experimental Silo backend; support tiers, release checklist, merge prerequisites
Status review and baseline, 2026-11-08Why testing did not close, the runtime baseline on 299378b, the IAM snapshot experiment and the request queue fix

9.1 - Why a PostgreSQL backend

Who it is for, when it beats erasure-coded storage, and the alternatives that were evaluated.

Many small-to-medium applications already run a managed or high-availability PostgreSQL cluster, yet still need an S3 endpoint for user attachments, avatars, PDF exports, or CI artifacts. Running a separate object storage cluster splits operational state across two systems: backups, point-in-time recovery (PITR), database clones, and access control must be coordinated twice and can drift apart.

pgsilo solves this by adding a PostgreSQL ObjectLayer backend to Silo (PGSTY’s fork of MinIO), storing all object data, versions, bucket configurations, multipart uploads, and IAM state inside a single PostgreSQL database.

Lessons from pgs3

Before building pgsilo, PGSTY built pgs3, an in-process PostgreSQL extension in Rust/pgrx that speaks S3 from a background worker. pgs3 (v0.1.1) passed 195 of 195 Ceph s3-tests cases and proved that S3 versioning, delete markers, conditional writes, and multipart semantics map cleanly onto PostgreSQL tables. However, it also exposed three structural trade-offs:

  1. Protocol surface maintenance: implementing SigV4 variants, aws-chunked streaming, presigned URLs, POST policies, and modern SDK trailing checksums (CRC32C, CRC64NVME) from scratch inside a C/Rust extension is a major ongoing cost. Silo already implements the full HTTP and S3 wire layer.
  2. Write-path deduplication overhead: pgs3 used content-addressed SHA-256 chunk deduplication and reference counting, which added index lookups and row-lock contention on small-object writes. pgsilo drops deduplication: each segment belongs to a single object version or active upload and is deleted by cascade.
  3. Process isolation and managed PostgreSQL compatibility: a compiled extension cannot be installed on locked-down managed PostgreSQL services, and an HTTP parser bug in a background worker runs inside the database process tree. pgsilo runs as a stateless external Go binary and installs only standard SQL tables and PL/pgSQL functions (PostgreSQL 16+).
Note

The initial October 2026 PRD targeted PostgreSQL 18 as the baseline version, but the implemented schema 14 tables and PL/pgSQL functions avoid PostgreSQL 18-only DDL dependencies and run on PostgreSQL 16, 17, and 18.

Target scenarios vs. anti-patterns

PriorityUser / ScenarioWhy pgsilo fits
P1Business apps (Odoo, ERP, CRM)Invoices, attachments, and business rows are backed up and restored together to the exact same PITR timestamp
P1Self-hosted Supabase / app platformsPoints Supabase Storage’s S3 backend at the existing PostgreSQL cluster without provisioning dedicated object disks
P1Local development & CI pipelinesOne PostgreSQL database backs both SQL tables and S3 buckets; DROP DATABASE resets the entire test environment
P2Private / on-premises appliance deliveryShips S3 storage on customer infrastructure that only permits standard PostgreSQL instances
P2Transactional SQL + S3 workflowsReads and writes objects inside Read Committed SQL transactions via silo_api and joins metadata with business tables

When NOT to use pgsilo (use Silo erasure-coded mode instead):

  • Backing up the hosting PostgreSQL cluster itself: never point a PostgreSQL cluster’s own pgBackRest repository at a pgsilo instance stored inside that same cluster—if the database fails, the backup is unreachable.
  • Large objects (> 256 MiB default, > 1 GiB hard ceiling): video archives, LLM weights, and large Parquet lakes belong on erasure-coded disks.
  • High-throughput observability sinks: continuous high-bandwidth write streams (Loki, Tempo, Mimir, Thanos) or CDN origin workloads.

Silo PostgreSQL mode vs. Silo erasure-coded mode

Both modes ship in the same silo binary and share the same S3 HTTP frontend, SigV4 authentication, IAM engine, and Console:

DimensionSilo PostgreSQL mode (pgsilo)Silo erasure-coded mode
StartupSILO_PG_DSN="postgresql://..." silo serversilo server /data{1...4}
Recommended scale<= 200 GB per database, <= 10M object versions, <= 256 MiB per object (max 1 GiB)Terabytes to petabytes; up to 5 TiB per object
Where state lives100% in PostgreSQL tables (silo schema)Local/distributed disks (xl.meta + erasure shards)
Unique strengthsTransactional SQL API (silo_api), unified pgBackRest PITR, stateless gatewaysHigh streaming throughput, erasure coding, site replication, remote tiering
Rule of thumbChoose when objects must share backup, PITR, or SQL transactions with relational dataChoose when object volume exceeds 200 GB or sustained write throughput exceeds 50 MB/s

Capacity and sizing rationale

  • Database object volume (<= 200 GB recommended): at typical pgBackRest restore speeds (200–500 MB/s), a 200 GB database restores in 7–17 minutes, keeping RTO predictable.
  • Object version count (<= 10M versions): at roughly 0.6 KB of row and B-tree index metadata per version, 10 million versions occupy ~6 GB of catalog metadata, keeping ListObjectsV2 and lifecycle index scans fast.
  • Segment size (8 MiB default, 1–64 MiB configurable): PostgreSQL TOAST supports values up to 1 GB, but buffering a single large bytea requires 2–3x its size in gateway and backend memory. Splitting objects into 8 MiB rows bounds per-request memory to two segment buffers (16 MiB) regardless of total object size while matching the AWS CLI’s default 8 MiB multipart chunk size.

9.2 - Design decisions

The ObjectLayer seam, the data model and the rejected alternatives.

This page summarizes the core architectural decisions behind pgsilo, including how initial design assumptions were refined during implementation and verification.

1. The ObjectLayer seam

Silo’s architecture separates HTTP request parsing, SigV4 authentication, and XML serialization (cmd/) from storage operations via the ObjectLayer interface (44 methods). Below ObjectLayer, the erasure-coded backend uses StorageAPI to read and write reed-solomon shards and binary xl.meta files across disks.

pgsilo implements ObjectLayer directly (internal/pgstore + cmd/object-api-pg*.go) rather than StorageAPI:

  • Implementing StorageAPI would still run the erasure-coding engine and store opaque xl.meta blobs in PostgreSQL, making object metadata unreadable from SQL.
  • At the ObjectLayer level, 26 methods carry object, bucket, multipart, and system-file semantics, while the remaining 18 erasure-specific methods (disk healing, pool decommissioning, rebalancing, remote tiering) cleanly return NotImplemented.
  • Server configuration, IAM users/policies, and bucket metadata (.minio.sys/*) already read and write through ObjectLayer, so redirecting .minio.sys to a silo.sys_files table persists control-plane state in PostgreSQL automatically.

2. Data model and 8 MiB bytea segments

All buckets share a single set of tables in the private silo schema (silo.meta, silo.buckets, silo.objects, silo.object_segments, silo.uploads, silo.upload_parts, silo.sys_files, plus annotation and control tables):

Design choiceRationale
Shared tables keyed by bucket_idCreating or deleting a bucket performs ordinary row DML rather than CREATE TABLE ... PARTITION OF, which would acquire an ACCESS EXCLUSIVE lock on the parent table and block concurrent S3 traffic
key COLLATE "C"S3 lists keys in raw UTF-8 byte order; C collation lets prefix queries (key >= prefix AND key < upper_bound) use standard B-tree index range scans
Separate metadata (silo.objects) and payload (silo.object_segments) tablesHEAD, ListObjectsV2, and tag updates never touch segment pages; silo.object_segments tunes autovacuum independently
Fixed-size bytea segments (8 MiB default) with TOAST lz4Bounds per-request gateway memory to 2 * segment_size; PostgreSQL TOAST compresses compressible text/JSON with lz4 (falling back to pglz if built without lz4) and stores incompressible JPEG/PDF segments uncompressed without hurting byte-range slicing
No content-addressed deduplicationEvery segment row belongs to one object version or one active upload (ON DELETE CASCADE), eliminating refcount hot spots

3. Version ordering (commit_seq) and lock hierarchy

Early design drafts considered ordering object versions by their auto-increment id or mod_time. Implementation audits identified a flaw: streaming PUT transactions pre-allocate object_id before streaming segments, so two concurrent uploads to the same key can finish in the reverse order of their id allocation, and gateway wall clocks can skew.

To guarantee linearizable version ordering across S3 and SQL writers:

  • commit_seq ordering: object_id is allocated when segment streaming begins, but the version publication order is defined by a dedicated commit_seq assigned after acquiring the per-key transaction advisory lock (silo.lock_key). Deleting the latest version promotes the remaining version with the highest commit_seq.
  • Strict lock hierarchy: every mutation acquires locks in a fixed order to prevent deadlocks:
    1. Bucket row lock: FOR SHARE for object writes/uploads/deletes; FOR UPDATE for bucket deletion or bucket configuration changes.
    2. Upload row lock (multipart only): FOR SHARE for UploadPart; FOR UPDATE for CompleteMultipartUpload and AbortMultipartUpload.
    3. Part advisory lock (multipart UploadPart only): serializes concurrent uploads of the same (upload_id, part_no).
    4. Per-key transaction advisory lock: pg_advisory_xact_lock(1936288879, hashtext(bucket_id || '/' || key)) held only during the final metadata publication and precondition check (If-Match / If-None-Match).
  • Shared SQL state machine: S3 gateway writes and silo_api SQL functions call the same PL/pgSQL state-transition functions (silo.commit_version, silo.delete_version, silo.complete_upload), ensuring identical versioning, quota, and Object Lock behavior.

4. Read snapshots, CopyObject budgets, and empty-bucket deletion

  • Snapshot-isolated reads: multi-segment GET and SelectObjectContent open a REPEATABLE READ READ ONLY transaction before querying silo.objects. Even if another client overwrites or deletes the object while segments are streaming, the reader sees a consistent object body until completion or timeout.
  • Deadlock-free CopyObject connection budget: a server-side copy reads from a source snapshot while writing to a destination transaction. To prevent 16 concurrent CopyObject calls from acquiring 16 source connections and deadlocking while waiting for destination connections, the data pool uses a FIFO weighted semaphore that atomically reserves two data connections before opening the source snapshot (which is why data_conns must be at least 2).
  • Connection liveness on checkout: pgxpool by default only pings connections idle for more than 1 second, which allowed a sub-second PostgreSQL restart to leave stale connections that failed the first S3 GET with HTTP 500. pgsilo enables connection health checks on checkout bounded by SILO_PG_ACQUIRE_TIMEOUT.
  • Empty-bucket DeleteBucket with unfinished multipart uploads: verified against both AWS S3 general-purpose bucket semantics and Silo’s erasure-coded implementation, DeleteBucket acquires FOR UPDATE on the bucket row, rejects deletion with HTTP 409 if any published object version or delete marker exists, and otherwise cascades deletion of any unfinished multipart uploads and parts in the same transaction.

5. Rejected alternatives

AlternativeWhy it was rejected
Hooking PostgreSQL at StorageAPI (disk layer)Still runs erasure coding and stores binary xl.meta blobs, preventing SQL queries and adding unnecessary CPU overhead
Single unsegmented bytea column per objectRequires buffering the entire object (up to 256 MiB–1 GiB) in both gateway and PostgreSQL backend memory; forces CompleteMultipartUpload to copy and concatenate all parts
PostgreSQL Large Objects (pg_largeobject)Stored in a cluster-wide system catalog (pg_largeobject), unfriendly to per-bucket permissions, requires vacuumlo for orphan cleanup, and complicates logical dumps
Storing large object bodies on local filesystemBreaks unified pgBackRest backup, PITR, and stateless gateway failover
One PostgreSQL table or partition per bucketCREATE TABLE ... PARTITION OF requires an ACCESS EXCLUSIVE lock on the parent table, blocking concurrent reads/writes during bucket creation or deletion
Content-addressed deduplication and reference countingIntroduces hash-lookup overhead and reference-count row contention on small writes (observed in pgs3)
Compiled C or Rust PostgreSQL extensionCannot be installed on managed PostgreSQL services; standard SQL + PL/pgSQL suffices for all state transitions

9.3 - Integration with Silo

Where Silo assumes erasure coding, and why IAM and native authorization both apply.

Replacing the newObjectLayer() constructor in Silo is only the first step of integrating a PostgreSQL backend. Although Silo routes object and configuration storage through ObjectLayer, several startup routines, background workers, HTTP handlers, and IAM entry points in cmd/ implicitly assume a distributed erasure-coded (erasureServerPools) deployment.

This page documents the coupling points identified during the Stage 0 source audit and how pgsilo resolves each one without breaking erasure-coded mode.

Startup, DSN parsing, and concurrency budgets

Subsystem in cmd/Original erasure-coded assumptionPostgreSQL backend adaptation
Command-line / env argument parsing (server-main.go, common-main.go)Requires positional disk directory arguments or MINIO_VOLUMES; normalizes arguments as filesystem pathsDetects SILO_PG_DSN or a single postgres:// / postgresql:// URI before disk parsing; rejects mixing disk paths with PostgreSQL mode; redacts DSN passwords from debug output
Peer RPC grid (grid.go, internal/grid)Unconditionally initializes peer-to-peer WebSocket grids and distributed lock grids across globalEndpointsSkips grid and lock-grid initialization when globalIsPGBackend is set; gateways coordinate solely through PostgreSQL transactions and LISTEN/NOTIFY
Default request concurrency (handler-api.go: apiConfig.init)When api requests_max <= 0, computes memory limits using slices.Max(setDriveCounts)—which panics on an empty drive-count slice in PostgreSQL modeBounds concurrent S3 requests by min(SILO_PG_MAX_CONNS, memlimit / (2 * SILO_PG_SEGMENT_SIZE), api requests_max) coupled with the SILO_PG_QUEUE_TIMEOUT admission queue
Bucket metadata batch loader (bucket-metadata-sys.go)Computes batch step as globalEndpoints.ESCount() * 10, causing an infinite 0-step loop when ESCount() == 0Enforces max(1, ...) batch sizing so empty and non-empty bucket catalogs load cleanly on startup
Deployment identity and readiness (erasure-server-pool.go, server-main.go)Generates deployment UUID inside newErasureServerPools and logs single-drive parity warningsPersists a stable deployment_id in silo.meta, publishes setObjectLayer after schema check/migration, suppresses erasure parity warnings, and separates /minio/health/cluster/read from /minio/health/cluster

Guarding the 20 .(*erasureServerPools) type assertions

A static audit of cmd/ found 20 .(*erasureServerPools) type assertions across 9 files (admin-handlers-pools.go, admin-handlers.go, background-newdisks-heal-ops.go, data-usage.go, erasure-multipart-listing.go, global-heal.go, notification.go, peer-rest-server.go, and site-replication.go), plus several non-assertion handlers that reference erasure-only state:

  • Pool decommission, rebalance, and drive healing: all pool status, decommission, rebalance, and heal endpoints return NotImplemented at the handler boundary in PostgreSQL mode rather than reaching uninitialized globalAllHealState pointers.
  • Replication and remote tiering: background replication resync, site replication, and remote tier transition workers are not started in PostgreSQL mode, while global wrapper pointers remain nil-safe when DeleteBucket or metrics handlers run.
  • Admin server and storage info (madmin): StorageInfo and /minio/metrics/v3/pg report PostgreSQL database usage, logical bucket quotas, and minio_pg_capacity_known = 0 (Unknown exclusive disk capacity in Console) instead of fabricating fake erasure drives.

.minio.sys persistence in silo.sys_files

Silo stores server configuration (config.json and configuration history), IAM users/groups/policies/service accounts, and per-bucket metadata (.minio.sys/buckets/<bucket>/.metadata.bin) as objects inside the reserved .minio.sys bucket.

In PostgreSQL mode, operations on .minio.sys route to silo.sys_files:

  1. Exact prefix-object delete vs. subtree delete: deleteConfig passes DeletePrefix=true, DeletePrefixObject=true to delete an exact configuration key without deleting adjacent keys sharing that string prefix (a vs. ab).
  2. Asynchronous Walk for IAM startup: IAMObjectStore.listIAMConfigItems invokes ObjectLayer.Walk and reads from the returned channel; pgsilo implements ordered prefix walking over silo.sys_files (including IAM tombstones) and closes the channel on completion or cancellation.
  3. Read-only standby startup: on a read-only gateway (SILO_PG_READ_ONLY=on or pg_is_in_recovery() = true), startup loads existing .minio.sys records in read-only mode without writing default configuration files or IAM format markers.

SelectObjectContent multi-seek snapshot consistency

In Silo’s SelectObjectContentHandler, the handler first calls GetObjectInfo to inspect the object and then passes a NewObjectReadSeekCloser to the S3 Select engine (especially for Parquet and CSV streams), which invokes GetObjectNInfo repeatedly across seek callbacks without pinning a VersionID.

On an erasure-coded cluster, an in-process read lock prevents local overwrites during the query. In PostgreSQL mode, however, another gateway or a silo_api SQL transaction can overwrite the key or replace a null version between seeks. To prevent S3 Select from splicing bytes from two different object generations, pgsilo pins a single REPEATABLE READ READ ONLY transaction snapshot before the initial metadata lookup and reuses that snapshot across all subsequent seek callbacks until the request closes.

Why iam_and_pg cannot use globalAuthZPlugin directly

Early architecture notes proposed implementing PostgreSQL native authorization (iam_and_pg) by registering an in-process globalAuthZPlugin. Auditing cmd/iam.go (IAMSys.IsAllowed) revealed a critical security flaw with that approach:

if authz := newGlobalAuthZPluginFn(); authz != nil {
    ok, err := authz.IsAllowed(args)
    return ok
}

When globalAuthZPlugin is non-nil, IAMSys.IsAllowed short-circuits and returns the plugin’s boolean immediately—skipping built-in owner checks, service-account parent and inline policy intersections (IsAllowedServiceAccount), STS session policy restrictions (IsAllowedSTS), and explicit IAM Deny statements.

To preserve full S3 IAM semantics, pgsilo evaluates PostgreSQL native role privileges as an additional AND gate after built-in IAM evaluation succeeds:

  1. The request must first pass full S3 IAM evaluation (including explicit Deny, bucket policies, service-account restrictions, and STS session policies).
  2. When silo.set_native_auth_mode('iam_and_pg') is active, the gateway resolves the authenticated S3 principal (or the parent IAM user for a service account / STS token) in silo.native_auth_principals and verifies that the bound PostgreSQL role holds the required privilege (SELECT, INSERT, UPDATE, DELETE, or EXECUTE on silo_api.create_bucket) on the target bucket’s silo_bucket ACL relation.
  3. Both checks must return allow; a PostgreSQL GRANT never overrides an S3 IAM Deny.

9.4 - SQL API design

Why objects are reachable from SQL and how per-bucket ACL relations work.
Note

The public silo_api SQL interface and silo_bucket ACL relations are Preview features in the MVP release.

Storing objects inside PostgreSQL unlocks a capability that external object stores cannot provide: applications can read, write, copy, and delete S3 objects inside the same Read Committed SQL transaction as ordinary relational tables. This page explains how pgsilo exposes that SQL interface without compromising the internal version state machine or tenant isolation.

Three-schema separation (silo, silo_api, silo_bucket)

Early design drafts placed public SQL functions directly in the silo schema. Implementation reviews separated the database surface into three schemas:

SchemaPurposeAccess policy
siloPrivate storage tables (buckets, objects, object_segments, sys_files, bucket_acl) and internal SECURITY INVOKER state-machine helpers (commit_version, delete_version, lock_key)Owned by silo_owner; REVOKE ALL FROM PUBLIC; never granted to application roles
silo_apiThe 11 public SECURITY DEFINER functions (put_object, get_object, read_object, stat_object, list_objects, delete_object, copy_object, create_bucket, bucket_info, list_buckets, drop_bucket)REVOKE ALL FROM PUBLIC at creation; administrators explicitly GRANT USAGE and per-function EXECUTE to application SQL logins
silo_bucketPer-bucket ACL relations (silo_bucket.b_<bucket_id>) created automatically when a bucket is createdNon-updatable security_barrier views carrying SELECT, INSERT, UPDATE, and DELETE grants

Public silo_api functions return flat RETURNS TABLE (...) columns or bytea rather than composite types from silo.*, so application roles never need USAGE on the private silo schema.

Per-bucket ACL relations (silo_bucket.b_<bucket_id>)

Why represent bucket permissions with a view named b_<bucket_id> in silo_bucket?

  1. Identifier length and collision safety: S3 bucket names can be up to 63 bytes (and internal table columns allow up to 255 bytes) with dots and hyphens, whereas PostgreSQL identifiers are capped at 63 bytes (NAMEDATALEN - 1). Naming the relation silo_bucket.b_<bucket_id> avoids truncation collisions while silo.bucket_acl maps each immutable bucket_id to its exact relation_oid (regclass).
  2. Non-updatable security_barrier views: each silo_bucket.b_<bucket_id> view is a security_barrier = true join over silo.objects and silo.buckets without INSTEAD OF triggers. Granting INSERT or DELETE on the view serves purely as an authorization bit checked via has_table_privilege(session_user_oid, relation_oid, priv) IS TRUE; an application role cannot execute raw INSERT, UPDATE, or DELETE statements against the view to bypass the version state machine.
  3. Clean lifecycle on bucket recreation: dropping a bucket drops its silo_bucket.b_<bucket_id> view in the same transaction. Recreating a bucket with the same name allocates a new bucket_id and a new ACL relation with no stale grants carried over.

Caller identity (session_user) and SECURITY DEFINER hardening

Inside a SECURITY DEFINER function, current_user and current_role resolve to the function owner (silo_owner), not the caller. Checking privileges against current_user would grant every caller full owner access.

To prevent privilege escalation:

  • Fixed session_user principal: every silo_api entry point authenticates session_user (resolved to its role OID) and explicitly verifies has_function_privilege(session_user_oid, '<function_signature>'::regprocedure, 'EXECUTE') IS TRUE.
  • Rejecting SET ROLE and owner logins: if current_setting('role') is not 'none', or if session_user is the installation owner (silo_owner) or a member of it, the function rejects the call with SQLSTATE 42501. An unprivileged user cannot wrap a silo_api call inside their own SECURITY DEFINER function or use SET ROLE to impersonate another role.
  • Locked search_path: all silo_api functions set search_path = pg_catalog, pg_temp and schema-qualify every table, function, and operator reference so user-created objects in pg_temp or public cannot hijack execution.
  • Immediate REVOKE visibility: cached PL/pgSQL plans do not always process PostgreSQL catalog invalidation messages before evaluating has_table_privilege. Every silo_api call first runs a lightweight dynamic EXECUTE 'SELECT 1 FROM silo.meta LIMIT 0' to force syscache invalidation acceptance, ensuring a committed REVOKE takes effect on the very next statement.

Transactional semantics and synchronized bucket policies

  • Read Committed write contract: put_object, delete_object, copy_object, create_bucket, and drop_bucket require Read Committed isolation. Under Repeatable Read or Serializable, a transaction waiting on silo.lock_key would still see its pre-lock snapshot and miss a concurrent latest version; write functions therefore reject higher isolation levels with SQLSTATE 0A000.
  • Deadlock-safe copy_object: silo_api.copy_object acquires FOR SHARE on the source and destination bucket rows in ascending bucket_id order, reads the source metadata, segments, and annotations from a single snapshot without holding a source key lock across the destination write, and publishes the destination version atomically.
  • Policy synchronization (policy_ready): S3 stores bucket configuration in .minio.sys/buckets/<bucket>/.metadata.bin, while SQL functions inspect structured columns on silo.buckets (versioning, object_lock, default_sse, policy_ready). Whenever a gateway updates .metadata.bin, it decodes and updates those structured columns in the same FOR UPDATE transaction. SQL write functions require policy_ready = true, enforce default Object Lock retention and hard bucket quotas, and reject plaintext writes to buckets with default SSE enabled.

9.5 - IAM control plane

Pools, advisory locks, the 5-second bound and the revision token added in schema 14.

In a multi-gateway pgsilo deployment, gateways cache IAM users, groups, policies, service accounts, STS sessions, and bucket metadata in memory so ordinary S3 requests do not query .minio.sys tables on every packet. However, an unbounded or loosely synchronized cache creates a security gap: a revoked credential or deleted policy could remain usable on another gateway for minutes.

This page explains how pgsilo bounds IAM and control-plane cache staleness to 5 seconds, isolates control traffic from slow object streams, validates standby gateways, and prevents split-brain cache renewal after asynchronous PostgreSQL failover (schema 14).

1. Three-pool connection isolation

If S3 object uploads, IAM refreshes, health checks, and LISTEN notifications shared a single database connection pool, a burst of slow 256 MiB uploads could exhaust all connections and starve health checks or credential revocations.

pgsilo splits each gateway’s connection budget (SILO_PG_MAX_CONNS, default 32) into three isolated pools:

PoolDefault sizeConfigurable rangeResponsibilities
Control pool (SILO_PG_CONTROL_CONNS)41–64Atomic IAM snapshot reloads, bucket metadata refreshes, revision polling, and /minio/health/cluster* probes
Coordination pool (SILO_PG_COORD_CONNS)22–64One dedicated LISTEN silo_control_rev connection plus serialized IAM control-plane write transactions
Data pool (MAX - CONTROL - COORD)26>= 2Streaming S3 object reads, writes, multipart uploads, and 2-connection CopyObject reservations

Data-pool saturation never borrows connections from the control or coordination pools.

2. Serialized IAM mutations and atomic snapshot reloads

Silo’s upstream IAMObjectStore loads users, groups, policy mappings, and STS tokens across separate file reads and merges partial maps in memory. Against a shared PostgreSQL database, separate reads could observe a half-applied multi-file IAM update.

pgsilo replaces both sides of the IAM persistence lifecycle:

  • Serialized IAM writes: every administrative IAM mutation acquires a connection from the coordination pool, begins a READ COMMITTED transaction, takes a fixed global IAM transaction advisory lock, performs the compare/merge and silo.sys_files updates inside that single transaction, and bumps silo.sys_revision before COMMIT. If the connection drops, the lock and file mutations roll back together.
  • Single-snapshot IAM reload: when a gateway reloads IAM state, it opens a REPEATABLE READ READ ONLY transaction on the control pool, reads silo.sys_revision and all IAM records from silo.sys_files in one consistent snapshot (bounded by file count and byte limits), decodes the complete identity and policy graph, and swaps the in-memory IAM cache atomically.

3. The 5-second freshness lease

Every gateway enforces a hard 5-second lease on its installed IAM snapshot:

  1. Monotonic start-of-query anchor: the 5-second timer starts at the monotonic wall-clock instant before the gateway sends its database observation query (SELECT revision, revision_token, pg_is_in_recovery() ...), not when a slow query finishes.
  2. 1-second polling + LISTEN/NOTIFY hints: gateways poll silo.sys_revision every 1 second and also subscribe to LISTEN silo_control_rev. A NOTIFY wakes the poller immediately, but notifications are never trusted as a durable stream; listener connect or reconnect always forces a full snapshot reload.
  3. Fail-closed expiration: before authorizing any IAM-dependent S3 or admin request, the middleware checks whether the current snapshot lease is still valid. If the lease has expired and a shared refresh cannot verify database authority within the deadline, the gateway fails closed with HTTP 503 rather than evaluating stale permissions.

4. Physical standby freshness and the 500 ms clock contract

Polling silo.sys_revision on a physical PostgreSQL standby is not sufficient by itself: if streaming replication is paused or lagging by 10 minutes, the standby still returns a valid-looking old revision row.

To bound staleness on read-only standby gateways (SILO_PG_READ_ONLY=on):

  • A writable gateway connected to the primary periodically writes a timestamped authority heartbeat row that replicates through WAL without incrementing silo.sys_revision or triggering full IAM reloads.
  • Primary and standby host clocks must stay synchronized within 500 milliseconds.
  • When a standby gateway polls its replica database, it subtracts (now - heartbeat_timestamp) + 500 ms from the 5-second lease budget. If replication stalls, the primary writable gateway stops, or clock skew exceeds bounds, the standby lease expires within 5 seconds and IAM-authenticated requests fail closed (503).

5. Schema 14: revision_token for divergent failover histories

Testing asynchronous PostgreSQL failover exposed a subtle split-brain edge case with integer revisions:

  1. Suppose the primary is at revision = 42. An administrator revokes a user’s policy (revision = 43), and Gateway A caches revision = 43.
  2. Before WAL for revision = 43 replicates to the standby, the primary crashes and the standby is promoted at revision = 42.
  3. On the newly promoted primary, an unrelated control-plane change (such as creating a bucket) increments revision from 42 to 43.
  4. Gateway A polls the new primary, sees revision = 43 (equal to its cached integer 43), and—if it checked only the integer—would renew its lease while holding a divergent IAM state from the old timeline.

The Schema 14 fix (revision_token):

Schema 14 adds a revision_token uuid column to the singleton silo.sys_revision row, updated by a BEFORE UPDATE trigger to a fresh random UUID (gen_random_uuid()) whenever revision changes.

  • Gateways record (revision, revision_token, in_recovery) alongside every installed IAM snapshot.
  • A poll renews the 5-second lease only if both revision and revision_token match the installed snapshot and in_recovery has not changed.
  • After an asynchronous failover, even if the promoted primary reaches the same integer revision = 43, its revision_token UUID differs, immediately forcing every gateway to discard its old timeline cache and perform a full REPEATABLE READ reload.

9.6 - Lifecycle and Object Lock

How lifecycle rules and retention work under leases.
Note

Object Lock (GOVERNANCE / COMPLIANCE retention and legal hold) and bucket lifecycle rules (version expiration, expired delete-marker cleanup, and incomplete multipart upload abort) are Preview features in the MVP release.

In Silo’s erasure-coded backend, lifecycle expiration and Object Lock checks rely on the distributed disk scanner (NSScanner), in-memory expiry queues, and handler-level pre-checks. Directly enabling those paths on a shared PostgreSQL backend would fail in four ways:

  1. MultiDelete TOCTOU window: Silo’s DeleteObjects handler pre-checked Object Lock retention before calling the backend delete loop, leaving a race window where a concurrent request could enable a legal hold or extend retention before the row was deleted.
  2. Unbounded version slices in Evaluator.Eval: the upstream lifecycle evaluator expects all versions of a key in a single in-memory slice, which would allocate unbounded gateway memory on keys with deep version histories.
  3. Subtree vs. exact-key delete mismatch: erasure-coded lifecycle DeleteAll passes DeletePrefix=true, DeletePrefixObject=true to delete all versions of an exact key, which a naive prefix delete would misinterpret as deleting an entire / key subtree.
  4. Missing AbortIncompleteMultipartUpload rule wiring: upstream rule structs lacked complete AbortIncompleteMultipartUpload evaluation fields and relied on a global stale-upload timer rather than per-bucket prefix and initiation-age rules.

This page describes how pgsilo implements authoritative Object Lock enforcement and fenced lifecycle execution directly in PostgreSQL.

1. Authoritative Object Lock in the database state machine

Rather than trusting unvalidated JSON headers in user_defined, pgsilo stores normalized lock columns on silo.objects (retention_mode, retain_until, legal_hold) and default retention settings on silo.buckets (synchronized transactionally whenever .metadata.bin is saved under the bucket FOR UPDATE lock):

  • Database UTC clock: all retention expiration checks compare retain_until against PostgreSQL’s clock_timestamp() inside the key lock, ensuring S3 requests, silo_api SQL calls, and background lifecycle workers agree on a single clock.
  • Every mutation path shares one check:
    • Single DeleteObject and batch DeleteObjects: each key deletion runs inside the per-key advisory lock (silo.lock_key), re-reading the target version’s retention_mode, retain_until, and legal_hold atomically so no TOCTOU window exists between pre-check and deletion.
    • PutObjectMetadata (?retention / ?legal-hold): modifies retention and legal hold in place on the target version without creating a new version or altering the object ETag. Shortening COMPLIANCE retention or switching COMPLIANCE to GOVERNANCE before expiration is rejected even for the S3 root user.
    • Governance bypass: requires both an explicit x-amz-bypass-governance-retention: true header and s3:BypassGovernanceRetention authorization evaluated per target version (plus UPDATE on the bucket ACL relation under iam_and_pg). Governance bypass never overrides COMPLIANCE retention or an active legal_hold.
    • SQL silo_api integration: silo_api.put_object and copy_object automatically apply default bucket retention on object-lock buckets, while silo_api.delete_object enforces retention and legal hold with no governance bypass parameter.
    • Force bucket deletion blocked: DELETE /{bucket} with x-minio-force-delete is rejected with HTTP 405 on any object-lock-enabled bucket, even when the bucket is empty.

2. Streaming keyset lifecycle scanner and executor

Instead of running the erasure-coded NSScanner, writable pgsilo gateways run a PostgreSQL-native lifecycle worker covering four rule actions (remote storage tiering Transition and RestoreObject are rejected at configuration time):

  1. Current version expiration (Expiration by Days or Date): deletes the current object in an unversioned bucket, inserts a delete marker in a versioned bucket (without duplicating an existing latest delete marker), or applies null-version expiration in a suspended bucket.
  2. Noncurrent version expiration (NoncurrentVersionExpiration): computes noncurrent age from the creation timestamp of the version’s successor (noncurrent_since), not the old version’s own mod_time, and preserves at least NewerNoncurrentVersions newer historical versions before deleting eligible versions.
  3. Expired object delete marker cleanup (ExpiredObjectDeleteMarker): removes a current delete marker when it is the only remaining version row for that key.
  4. Incomplete multipart upload cleanup (AbortIncompleteMultipartUpload): matches active uploads in silo.uploads by rule prefix and initiated age and aborts them atomically, cascading deletion of uploaded parts and segments.

To keep memory bounded, the scanner iterates over buckets and keys using keyset pagination ((key COLLATE "C", commit_seq) for objects and (key, initiated, upload_id) for multipart uploads) reading only metadata columns—never decrypting or loading SSE-C / SSE-S3 object bodies.

Before executing any deletion or marker insertion, the worker locks the target key (silo.lock_key), re-reads the current version chain and bucket lifecycle configuration revision, and re-verifies Object Lock protections. If a concurrent PUT, tag change, legal hold, or rule update occurred after the scan pass, the stale candidate becomes a safe no-op.

3. Multi-gateway maintenance leases and epoch fencing

When multiple writable gateways share a PostgreSQL primary, only one gateway should execute background lifecycle and annotation cleanup at a time, and a partitioned or paused leader must never commit stale deletions after another gateway takes over.

pgsilo coordinates background workers through a database lease table (silo.TryLifecycleLock) rather than a long-lived session advisory lock on the coordination pool:

  • Short-transaction lease claims and renewals: a writable primary gateway claims or renews the maintenance lease in a short transaction using PostgreSQL’s clock. Whenever a different gateway takes over an expired lease, the database increments a monotonic epoch counter.
  • Transactional epoch fencing: every destructive lifecycle or annotation-cleanup batch locks the lease row (FOR SHARE) inside the same transaction as the object/annotation deletion and verifies that (owner_id, epoch) still matches the worker’s lease and has not expired. If a new leader has incremented epoch, the old worker’s transaction aborts before committing.
  • Standby and read-only safety: gateways with SILO_PG_READ_ONLY=on or connected to a database where pg_is_in_recovery() = true never claim the maintenance lease. Lease ownership and errors are exported at /minio/metrics/v3/pg via minio_pg_lifecycle_leader and minio_pg_lifecycle_errors_total.

9.7 - Status review and baseline, 2026-11-08

Where pgsilo stood on 2026-11-08, why testing did not close, the runtime baseline on 299378b and the two fixes that followed.
Date
2026-11-08
Applies to
Frozen local delivery 3c7fdc03; baseline on 299378b; fixes up to 1d387725c (all on Silo branch feat/pg-backend, not pushed)
Finding
The feature scope was broad and well tested in October, but the evidence was split across candidates and the current source had never run. A GA-level gate set had kept testing open.
Led to
MVP goal
Replaces
Nothing; this is a review record

State before the review

Candidate identity was split. No single commit carried complete runtime evidence:

CommitWhat had run
dca464e5 (2026-10-07, schema 14)All functional gates: mint full HTTP 872 pass / 8 NA and HTTPS 947 pass / 7 NA, Ceph s3-tests 195/195, pgstore kernel 185 top-level / 326 tests on PostgreSQL 16, 17 and 18, cmd and erasure-coded regression 1,336 top-level / 6,913 tests, 32 application checks, 28 Console checks, 10 Pigsty checks, 35 upgrade and recovery checks, 11 STS, 15 native authorization, 36 A/Z and 5 multi-gateway checks
3c7fdc03 (2026-10-07, frozen delivery)Eight files (+99/−34) after dca464e5. Focused regression tests, the formal 3-round performance run (with SILO_PG_MAX_CONNS=72 and a Go SDK client for the 64-concurrency rows) and a 20-minute mixed preflight
299378b (2026-10-26)October upstream sync plus two review fixes: 158 files, +19,000/−2,035 lines after 3c7fdc03. Compiled and vetted only; no test had been executed

The frozen delivery was not publishable. 3c7fdc03 was based on Silo code from 2026-09-26 and lacked the October upstream fixes (IAM credential boundaries, scoped STS revocation, Object Lock authorization and others), built for ARM64 only, and reported the version DEVELOPMENT.GOGET. It had never been pushed.

Source entry points were broken. The working checkouts the delivery records pointed to had been removed, the documented compile script referred to missing paths, and the October test environment no longer existed.

The fork kept drifting. Against the synced upstream (RELEASE.2026-10-25), the backend added about 17,200 production lines (Go store, 14 SQL migrations, gateway code), modified 79 upstream production files (+1,922/−425), and added about 22,400 test lines. By 2026-11-08 Silo main had 138 further commits; 16 of the files they changed were also modified by the backend, including new ObjectOptions semantics.

Why testing did not close

  1. The goal was GA-level. It required stages 0–5, mint full, every application integration, HA, PITR and performance gates, and a 72-hour endurance run on the frozen candidate, with any later change to a persistence or concurrency path requiring the affected endurance to run again.
  2. Every change produced a new candidate. At least six candidates followed each other, and results were never carried across candidates without a fresh run.
  3. The performance gate measured the client. The 64-concurrency 4 KiB PUT target of 500 ops/s failed repeatedly with the Python client and passed only after the concurrency rows switched to the Go SDK.
  4. Most failures came from the test harness. Of 14 preflight runs, 2 passed, 11 failed (mostly fixture errors such as port timing, parameter encoding and credential limits; one real race, later fixed) and 1 was stopped. Of about 45 performance-related runs, 1 was a formal pass and about 25 tested the harness itself.
  5. Evidence outgrew the work. The run directory held 29,823 files (5.8 GB), including 95 self-verification receipts and 342 review documents.
  6. A real defect arrived late. On 2026-10-07 an IAM cache defect after failover (same revision, different content) led to schema 14 and a rerun of almost every gate.
  7. The endurance run came last. It could start only after everything else passed, and it was stopped at the user’s request after about 4.05 hours. It is not a 72-hour pass.

Decision

Three release forms were compared. Merging into Silo as an experimental backend was chosen, because it stops the fork drift and reuses the Silo release pipeline. A standalone release would make the drift permanent. An extension-only release is not possible, because the project has no PostgreSQL extension. The goal itself is recorded in MVP goal.

Runtime baseline on 299378b

The release checklist ran on 299378b on 2026-11-08 with PostgreSQL 18.6 and 16.15. Seven items passed: pgstore on both versions, mint core and full over HTTP and HTTPS (no failures; full-mode counts match October), Ceph 195/195, four client smokes, the Silo Console 2.6.0 smoke and an amd64 smoke under emulation. The cmd regression had one failing test. Details and the performance numbers are on Status.

Two environment effects were separated from product results: erasure-coded tests fail in bulk when the temporary directory’s disk is nearly full, and seven file-permission tests fail when run as root.

IAM snapshot assertion

TestPGIAMPolicyReadersKeepCompleteSnapshot failed in every run. Its last assertion, added during the October sync and never executed, expected a policy written directly with pgstore.PutSystem to stay outside the cache after ListPolicies. A control experiment wrote one policy and deleted another installed policy directly in storage, then compared two paths:

GroupOperationAdded policy visibleDeleted policy visibleInstalled / stored revisionCache replaced
Start—NoYes2 / 4—
AListPolicies onlyYesNo4 / 4Yes
BDeletePolicy onlyNoYes2 / 5No

The user, group, service-account and temporary-account list paths neither reloaded nor merged records.

Conclusion: PutSystem and DeleteSystem advance the stored revision, so the record was not outside it. In PostgreSQL mode, a policy listing reloads the complete snapshot at the stored revision and replaces the cache: additions and deletions appear together, and nothing is merged record by record. The behavior was the same on 3c7fdc03. Commit ca158fb6 rewrote the assertion to test that invariant, including the deleted record; product code was not changed.

Request queue

In PostgreSQL mode the request budget equals SILO_PG_MAX_CONNS (32 by default). Above it, builds up to 299378b answered HTTP 429 TooManyRequests at once, and the default retry rules of the AWS SDK for Go v2 and boto3 do not cover that response, so ordinary 64-client bursts failed.

Commit 1d387725c makes a request wait up to SILO_PG_QUEUE_TIMEOUT (5 s by default) for a free slot without holding a database connection, stops waiting when the client disconnects, and answers HTTP 503 SlowDown when the wait expires. Erasure-coded mode is unchanged. With the default pool, 64 clients ran PUT and GET for 90 s each with no failed request; with the wait disabled, the SDK retried the 503 responses but 160 PUT and 188 GET requests still failed. Ceph 195/195 and mint core over HTTPS (644 pass, 6 NA) showed no regression. Numbers are on Status.

What remained open

  • Merge prerequisites: the Silo release, the public silo-pkg annotation actions, and the user’s decision.
  • Release engineering: formal version string, amd64 and arm64 builds, DEB and RPM.
  • Known issues listed on Status.

9.8 - MVP goal

The 2026-11-08 goal: ship pgsilo as an experimental Silo backend, with a release checklist sized for an MVP.
Date
2026-11-08, approved by the user
Applies to
Silo branch feat/pg-backend from 299378b onward; current candidate 1d387725c
Replaces
The completion criteria of the original development goal (stages 0–5 up to a GA-level release candidate, including a 72-hour endurance run) and the 2026-10-08 local delivery freeze
Status
Current

Decision

The only completion criterion is an MVP release candidate. When it is reached, work stops and the result is reported; later phases do not start automatically. The stages and the GA-level release candidate of the original goal remain a roadmap after the MVP, not a completion criterion.

The reasons are recorded in Status review and baseline: by 2026-11-08 the feature work was broad, but no single commit carried complete runtime evidence, and a GA-level gate set kept the testing from closing.

Release form

  • pgsilo merges into Silo main as an experimental PostgreSQL storage backend and ships with standard Silo releases. A postgres:// or postgresql:// DSN, or SILO_PG_DSN, selects PostgreSQL mode.
  • There is no standalone pgsilo executable and no SQL-only release. An extension-only release was rejected: the project has no PostgreSQL extension, because the gateway installs and migrates the schema itself.
  • The frozen local delivery 3c7fdc03 stays an internal ARM64 preview and is not published.

Support tiers

TierScope
SupportedOne PostgreSQL primary with one or more writable gateways; PostgreSQL 16–18; linux/amd64 and linux/arm64
SupportedBucket and object CRUD, ListObjects V1/V2, versions and delete markers, conditional requests, Range, copy, tagging, multipart upload, checksums, presigned URLs, POST policy, CORS
SupportedIAM users, groups, policies and service accounts; SSE-C and static-key SSE-S3; object backup through PostgreSQL backup and PITR
PreviewSQL transaction API, PostgreSQL native authorization, STS, lifecycle, Object Lock, quotas, annotations and ZIP extraction, hot standby gateways
Not supportedSSE-KMS and external KMS, replication, tiering, erasure-coded disk management, S2 compression, etcd IAM, objects above 1 GiB, high-throughput workloads, RPO guarantees under automatic HA

The MVP uses the general Silo Console, without an annotation interface. Preview features ship with the release but may change without compatibility guarantees. The current tier table is on Compatibility.

Working principles

  1. Scope freeze. Only the listed work items and fixes for MVP-blocking problems. No new features, test layers, evidence formats or infrastructure.
  2. Proportional verification. Only functional and smoke tests that finish in minutes; the whole release checklist finishes in one to two hours. Long-running stability or endurance runs, full instrumentation matrices, repeated benchmark rounds, consistency tests that need a large external environment to be rebuilt, and diagnostic campaigns for rare intermittent failures are not done and are not gates after the MVP. The user raises them separately if needed.
  3. Honest results. Each check is recorded as pass, fail or not applicable, with the command and the location of the raw output. A failure is fixed or listed as a known issue with a statement of whether it blocks; the user decides. Failures are never hidden or silently waived.
  4. Performance. The MVP publishes measured baseline numbers and the test environment. There is no SLA, and performance does not block the release.
  5. Authorization. Local commits with DCO sign-off are allowed. Pushing, merging into Silo main, publishing packages or images, and deploying sites each need separate approval.

Release checklist

The checklist runs in full once the release candidate is frozen; during development only the items affected by a change run.

#Item
1internal/pgstore tests on PostgreSQL 18 and on PostgreSQL 16
2Regular Silo unit tests (go test, no race detector) to show that erasure-coded mode did not regress
3mint core once over HTTPS (covers SSE-C)
4Ceph s3-tests, 195 pinned cases
5Client smoke: mcli, AWS CLI v2, boto3, AWS SDK for Go v2
6Reduced performance smoke that takes minutes; numbers are recorded only
7General Silo Console 2.6.0 smoke against PostgreSQL mode
8Runtime smoke on linux/amd64

Items 2, 3 and 6 were narrowed on 2026-11-08 from an earlier draft that asked for race-enabled regression, mint full over both HTTP and HTTPS, and a 20-minute mixed preflight.

Merge prerequisites

  1. The current Silo release is published. feat/pg-backend is then synced to that release tag; upstream changes to files the backend also modifies, and new ObjectOptions semantics such as DeleteAllVersions, are implemented or explicitly rejected in PostgreSQL mode; the checklist runs again.
  2. The four annotation policy actions the server uses are published in the public silo-pkg, coordinated with the Server and Console releases, or handled another way. This needs the user’s approval.
  3. The user decides the merge.

Work items

#Work itemState on 2026-11-08
1Restore a working source checkout of feat/pg-backend that contains no unpublished Silo main commits, and repair broken build pathsDone
2Set up a lean test environment with PostgreSQL and gateways; rebuild the pinned mint and Ceph inputsDone
3Run the release checklist on 299378b to catch problems from the October upstream syncDone; see Status. Two fixes followed in ca158fb6 and 1d387725c
4Sync to the Silo release and rerun the checklistWaiting for the Silo release
5Release engineering (formal version string, amd64/arm64 builds, DEB and RPM) and release notes stating the experimental status, tiers, mint fixture revisions and not-applicable casesNot started

Deferred beyond the MVP

  • Automatic high availability: define the scope and the validation when it is needed.
  • The brief HTTP 503 window after an IAM change on another gateway, and Python client throughput.
  • The annotation interface in the general Console, and promoting Preview features to Supported.
  • Objects above 1 GiB, higher throughput, multi-architecture container images, and running the test harness in CI.