Chapter 7 — Storage & Data Layer

7.1 Data Layer Overview

Three engines serve the Platform, each with a distinct role; nothing else is introduced without a Change Order:

Engine Role Persistence class
PostgreSQL System of record — Compartment relational data, platform configuration, decision metadata Durable, backed up, point-in-time recovery target
MongoDB Document workloads — agent artifacts, semi-structured Compartment content Durable, backed up
Redis Cache, queues, session and rate-limit state Ephemeral by default; only explicitly declared keyspaces persisted (AOF), never treated as a system of record

As of 2026-07-18 none of the three is installed — this chapter is fully normative, with the §6.5 interim placement (containers on sbsdash-server-prod) as the build path and managed services as the preferred end state.

7.2 Managed vs. Self-Hosted Decision
7.3 Object Storage

DigitalOcean Spaces (S3-compatible), region NYC3 (Spaces is not offered in NYC2; object storage over TLS to a neighboring region is acceptable — unlike database traffic, it is not latency- or VPC-bound):

Bucket Content Access
sbs-dash-artifacts Compartment file artifacts (agent outputs, uploads) Per-Compartment prefix + per-Compartment scoped keys (§7.4)
sbs-dash-audit Hash-chained audit log archives (Ch. 13) Write-once pattern: writer key has PUT-only; no key held by the platform can DELETE (deletion requires the account control plane)
sbs-dash-backups Database dumps + config archives (Ch. 14) Backup identity only; replicated to SFO3 per §2.3

Rules: all buckets private (no public-read ever — FE family applies to storage too); access exclusively via scoped Spaces keys stored in Vault, one keypair per purpose, never a shared account-wide key (INF-02); TLS enforced on every operation; bucket inventory and lifecycle policies defined in IaC (Ch. 10). CDN feature on Spaces stays off — these are private buckets, and enabling the CDN endpoint would create an unauthenticated public URL surface.

7.4 Data Isolation Boundaries (per-Compartment)

The data and storage slices of the eight-layer model (§1.2), stated per engine. The principle throughout: isolation is enforced by the engine's own privilege system, not by application discipline — a compromised Compartment 03 credential must be structurally unable to read Compartment 08 data.

7.5 Encryption
7.6 Operational Rules
7.7 Verification

Gates (LH-SBS-INST-001): cross-Compartment access probe per engine fails (c03 role → c08 database denied in PostgreSQL, MongoDB, Redis ACL, and Spaces prefix); no public listener on any engine port (ss -tlnp + external scan); TLS handshake required on every engine (plaintext connection refused); PUBLIC/default access revoked (engine ACL dump review); dumps encrypted before leaving host (backup pipeline inspection); Dev contains no production data (sampled content check); Spaces buckets private (unauthenticated GET fails); audit bucket writer key cannot DELETE (negative test).


Revision #1
Created 2026-07-18 05:17:28 UTC by SBS Admin
Updated 2026-07-18 05:19:14 UTC by SBS Admin