SurrealDB Schema Migrations and Multi-Master Replication: Consistency During Hot Upgrade
0 reputation · 31 Mar 2021, 02:54 UTC
Integration Boundary
Migrating a small SurrealDB-backed application to a new schema version without downtime requires coordinating online ALTER TABLE operations with the database's multi-master replication layer. The HTTP API permits issuing schema changes while the application continues serving requests, yet adding a NOT NULL column with a default value can trigger a full table rewrite that blocks writes. Meanwhile, SurrealDB's multi-master replication enables blue-green deployment patterns, but the consistency guarantees during a hot upgrade—particularly read-after-write visibility across replicas while a schema change is in progress—are not fully documented. Transactions provide atomicity and isolation within a single transaction boundary, but cross-transaction schema changes may expose temporary inconsistencies. No built-in dry-run mechanism exists to preview the impact of large schema changes before applying them to production traffic.
- What are the documented consistency guarantees for read-after-write visibility across replicas when a blocking
ALTER TABLErewrite is in progress? - How does the replication conflict resolution strategy handle concurrent writes to the same records during a schema migration that rewrites table data?
- Is there a supported pattern for validating schema migration impact on write latency before promoting a replica to primary?