What the database stores
The current appliance bundles PostgreSQL 15 in the single-container profile. Persistent Docker volume contains database, encryption secrets, certificate assets and backups. SQLAlchemy ORM owns schema; Alembic upgrades it. Separate tables hold endpoint inventory, MAC/IP evidence, switch/port observations, authentication events, RADIUS sessions, users, policies, admin roles, guest lifecycle, audit-chain records, setup progress and license identity.
Do not treat PostgreSQL, Redis or external storage as interchangeable configuration options. v0.13 is designed for its embedded PostgreSQL. A distributed database/HA architecture would require explicit design and failure testing rather than changing the connection URL alone.
Sizing guidance, not a performance guarantee
| Pilot size | Starting host proposal | Why it is only an estimate |
|---|---|---|
| <=100 managed endpoints | 4 vCPU, 8 GiB RAM, 80 GiB SSD | CPU/RAM depend on polling cadence, event rate, TLS and guest flows |
| 100–500 managed endpoints | 8 vCPU, 16 GiB RAM, 200 GiB SSD | Measure discovery/evidence volume and backup duration |
| 500–1,000 managed endpoints | 8–16 vCPU, 32 GiB RAM, 500 GiB SSD | Requires profiling and soak tests before contractual SLA |
These are conservative planning starting points, not measured benchmark results. Use SSD/NVMe with sustained writes and filesystem free-space monitoring; Docker and DB share the appliance host. Isolate the management NIC. No horizontal scaling or active/active HA is currently validated.
Why evidence retention matters
One thousand endpoint observations every hour yield ~24,000 observation events per day or ~8.76 million per year before adding authentication/accounting/system events. Evidence volume is workload dependent and will grow unless managed. The inventory endpoint license counter counts Device rows, not evidence rows; deleting old evidence doesn't free an endpoint license.
Implemented index and retention changes
Migration 0011 adds time-based indexes on devices.last_seen, device_evidence.observed_at, authentication_events.at, system_events.at, radius_sessions.last_seen, discovery_runs.started_at and audit_records.at. The maintenance CLI offers preview then explicit manual purge, with fixed cutoffs and a maximum of 1,000 rows per table per invocation.
Default proposed periods: evidence 90 days; authentication events 180; system events 90. They are not configured to purge automatically. Login credentials, settings, user and endpoint inventories, paid-license records, policy revisions, and the tamper-evident audit_records are never removed by this command.
bash ./wg.sh retention-preview preproduction
# Only AFTER a verified external backup and retention/legal approval:
bash ./wg.sh retention-prune preproduction --yes
The command rechecks the audit-chain integrity, records a privileged audit event and deletes at most 1,000 eligible records per table. Repeat in controlled windows if necessary. Legal-hold, deletion/erasure and retention-period customization are not yet implemented; do not enable regular purges without a reviewed data policy.
Database operations playbook
bash ./wg.sh status preproduction, then check disk usage, PostgreSQL logs, database size, row counts and slow query patterns.- Verify backup success, available restore keys and offline backup storage.
- Inspect top event tables and planned retention before any deletion. Never manually truncate the audit chain or commercial-license table.
- Run index and migration checks in staging; any high-volume deployment needs PostgreSQL query-plan and memory measurements under realistic polling.
- After maintenance, confirm dashboard, license usage, endpoint inventory, authorization records and audit verification all still work.
Unimplemented launch work: automated data archival, encryption-key rotation, PITR/WAL shipping, HA, partitioning, custom retention policies, per-table compression, restore automation, GDPR erasure cases and production load testing at sustained 1,000-endpoint rates.
en/docs/operations/database-and-retention.mdRead documentation Not a certified production NAC. Physical switch/RADIUS enforcement and 1,000-device traffic remain unverified.

