- Created `StellaOps.TestKit.Tests` project for unit tests related to determinism. - Implemented `DeterminismManifestTests` to validate deterministic output for canonical bytes and strings, file read/write operations, and error handling for invalid schema versions. - Added `SbomDeterminismTests` to ensure identical inputs produce consistent SBOMs across SPDX 3.0.1 and CycloneDX 1.6/1.7 formats, including parallel execution tests. - Updated project references in `StellaOps.Integration.Determinism` to include the new determinism testing library.
1.2 KiB
1.2 KiB
PostgreSQL operations
Purpose
- Operate the canonical PostgreSQL control plane with deterministic behavior.
Schema topology
- Per-module schemas: authority, vuln, vex, scheduler, notify, policy, concelier, audit.
- Tenant isolation enforced via tenant_id and RLS policies.
Performance setup
- Enable pg_stat_statements for query analysis.
- Tune shared_buffers, effective_cache_size, work_mem, and WAL sizes per host.
- Use PgBouncer in transaction pooling mode for high concurrency.
Session defaults
- SET app.tenant_id per connection.
- SET timezone to UTC.
- Enforce statement_timeout for long-running queries.
Query analysis
- Use pg_stat_statements to find high total and high mean latency queries.
- Use EXPLAIN ANALYZE with BUFFERS to detect missing indexes.
Backups and restore
- Use scheduled logical or physical backups with tested restore paths.
- Keep PITR capability where required by retention policies.
- Validate backups with deterministic restore tests.
Monitoring
- Track connection count, replication lag, and slow query rates.
- Alert on pool saturation and replication delays.
Related references
- data/postgresql-patterns.md
- data/persistence.md
- docs/operations/postgresql-guide.md