Database Layer
CockroachDB Features
Bastion uses CockroachDB as its distributed SQL backbone. Every memory operation — store, search, audit, time-travel — runs against CockroachDB with SERIALIZABLE isolation.
Why CockroachDB?
SERIALIZABLE Isolation
CockroachDB uses SERIALIZABLE by default — the strictest isolation level. No phantom reads, no write-write conflicts between concurrent agents. This is critical when multiple agents write to the same memory store.
AS OF SYSTEM TIME
Point-in-time queries via MVCC. Query exactly what an agent knew at any timestamp without maintaining separate snapshots. Zero-copy reads.
C-SPANN Vector Index
Distributed vector similarity search for memory embeddings. Sub-linear query time at scale. Used by memory_search and multi_signal_search.
PostgreSQL Wire Protocol
100% compatible with psycopg2, pg drivers, and ORMs. No vendor lock-in — switch to any Postgres-compatible database.
CDC Changefeeds
Change data capture for real-time event streaming. Powers the dashboard's live event feed and A2A push notifications.
Multi-Region Ready
Schema uses REGIONAL BY ROW locality. Deploy to multiple regions with automatic failover when ready.