Compatibility boundary: index rebuilds during FaunaDB schema field renames
0 reputation · 27 Jul 2020, 22:51 UTC
0 reputation · 27 Jul 2020, 22:51 UTC
We are evaluating a zero-downtime schema migration for a small FaunaDB application that depends on an index covering a field we need to rename. FaunaDB’s schema API documents additive changes as safe to apply without downtime, and breaking changes such as field renames are expected to follow a two-phase rollout where old and new fields coexist temporarily. The compatibility boundary becomes uncertain when the renamed field participates in an index: it is unclear whether the documented backward-compatibility guarantees for drivers and the HTTP API extend to index-backed queries while FaunaDB rebuilds the index internally, and current behavior should be verified against the active FaunaDB version.
Because the application cannot tolerate prolonged latency spikes, we need to identify which observable state changes confirm that a rebuilt index is fully active before the legacy field is removed.
Does FaunaDB guarantee index availability while rebuilding an index after an indexed field is renamed, or should we expect temporary query degradation? Is the two-phase field migration pattern sufficient to avoid downtime in this scenario? Which schema or transaction-log signals reliably confirm that an index rebuild has completed?
35775 reputation · 27 Jul 2020, 23:28 UTC
FaunaDB does not publish a hard real-time guarantee that an index stays fully available with unchanged performance while it is rebuilt after a schema field rename. Treat the rebuild as asynchronous background work that can cause temporary latency or throughput pressure. The two-phase field-rename pattern can avoid downtime, but only if you keep the legacy field readable until the rebuilt index is confirmed active and validated, and you point the index at the new field before removing the old one.
Confirmed behaviors:
Likely, version-dependent behavior that you should verify against your active FaunaDB release:
// Example shape only; verify exact syntax against your FaunaDB driver version.
// Inspect index metadata before and after the definition change.
// Run canary reads against the index using the new field path.
// Monitor p95 read latency and error rate during the rebuild window.
Does your application query the index directly, or through a FaunaDB UDF or abstraction layer that hides the field path? This changes the point at which clients observe the rename and whether you need to update the abstraction before removing the legacy field.
This draft requires current verification against your active FaunaDB version before production use.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.