| ID | product.ingestion.command_router.command_repo |
|---|---|
| Description | Stores pending and delivered commands. |
| Key | command_repo |
| Type | component:database |
| Team | Ingestion |
| Owner | ingestion@iotgateway.example |
| Status | active |
| Technologies | PostgreSQL |
| Attributes | retention: 90d, store: PostgreSQL |
| Tags |
The Command Repository is the relational store behind the Command Router. It is the authoritative history of what was asked of a device, when, how many times we tried, and how it ended. Every status the API reports comes from here.
Storage profile
PostgreSQL, single logical database. Commands and their attempts are retained for 90 days for audit and debugging, then archived out of the hot path.
The schema is built around the command and its lifecycle: the command itself, each delivery attempt, the terminal result, and the (potentially large) payload split into its own table. The ERD is embedded on the Overview tab.
COMMAND.idempotency_key is unique, which is what makes the API’s
idempotencyKey guarantee enforceable at the storage layer.DELIVERY_ATTEMPT rows are append-only — one per try by the
Delivery Engine
— giving a full retry timeline per command.COMMAND_PAYLOAD is separated from COMMAND so that listing and status
queries stay fast and never drag large bodies through the index scans.1 incoming link
| Source object | Label | Link type | Relation | Raw id | Required | Description | |
|---|---|---|---|---|---|---|---|
| loads commands from | — | links | product.ingestion.command_router.command_repo | — | — |