Broker / Nginx modules

Durable store

Bind broker state to PostgreSQL and select the acknowledgement policy.

Implemented Core boundary with PostgreSQL authority

ngz_iot_store declares the provider boundary for retained messages, persistent sessions, offline queues, QoS state, audit records, rule state, bridge buffers, and restart recovery.

Nginx configuration

stream {
  iot_store_postgres dsn=env:NGINZ_IOT_POSTGRES_DSN role=state,audit;

  server {
    iot_store on;
    iot_store_ack_policy durable;
  }
}

Production service rejects an enabled store without a provider and durable acknowledgement policy. Keep credentials outside nginx configuration and reference a secret environment variable or mounted secret.

Daemon configuration

The matching nginz-iotd sections select provider = "postgres", a dsn_ref, ack_policy = "durable", and explicit recovery bounds. Provisioning is an operator action:

nginz-iotd --provision-store --config /etc/nginz-iot/iotd.toml
nginz-iotd --test-config --config /etc/nginz-iot/iotd.toml

Normal startup validates the schema; it does not silently provision or migrate it.

Failure behavior

A durable acknowledgement follows the committed broker frontier. Store failure exits without publishing the dependent acknowledgement, event, or delivery.

Implementation authority

This page is a customer-oriented guide. The source contract remains authoritative for exact behavior and release evidence.

src/modules/iot-store-nginx-module/README.md