Skip to content

Establish blue/green deployment flow for mojidata-api D1 #36

Description

@mandel59

Summary

Current D1 deployment flow imports generated SQL dumps directly into the D1 databases bound by the live Worker. That is not safe for no-downtime deployment because the Worker can read a partially dropped, partially imported, or schema-incompatible database during import.

Goal

Change the D1 operational flow so database refreshes are treated as immutable blue/green releases:

  1. create new D1 databases with a release label
  2. import mojidata and idsfind data into those new databases
  3. smoke-test the new databases through a non-production Worker target
  4. promote by switching Worker bindings to the new database IDs and deploying the Worker
  5. keep the previous database IDs available for rollback

Acceptance criteria

  • Production docs no longer recommend importing directly into the currently bound D1 databases.
  • Repository scripts can create/import a release pair of D1 databases without mutating the active Worker bindings.
  • Promotion is an explicit step that updates Worker bindings only after import and smoke validation.
  • The flow records enough metadata to identify the promoted and previous database IDs.
  • Rollback is documented as switching bindings back to the previous database IDs and redeploying.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions