Back to changelog
New
•2 minute read

Schema Registry: Bring Your Own Storage

Schema repositories can now be stored outside Atlas Cloud, in your own blob storage or OCI registry.

Set url in the repo block of a schema, and Atlas pushes schema states and plans there and reads atlas:// references from it.

Configure the Repository

The url points to a blob storage bucket or an OCI registry:

Storageurl
AWS S3s3://my-bucket/atlas-registry?region=us-east-1
Google Cloud Storagegs://my-bucket/atlas-registry
Azure Blob Storageazureblob://my-container/atlas-registry?storage_account=myaccount
OCI registryoci://<user>:<token>@ghcr.io/org/atlas-registry

Buckets authenticate with the provider's standard credentials, the same as backup URLs. An OCI URL carries its credentials, so read it from an environment variable or a secret store, never as a literal in atlas.hcl:

atlas.hcl
env "prod" {  url = "sqlite://app.db"  dev = "sqlite://dev?mode=memory"  schema {    src = "file://schema.sql"    repo {      name = "app"      url  = getenv("ATLAS_REGISTRY_URL")    }  }}

Push the Schema

With ATLAS_REGISTRY_URL set to the OCI URL, push the schema. It lands in the registry, not in Atlas Cloud:

shell
atlas schema push --env prod
Output
Schema: app  -- Atlas URL: atlas://app  -- Registry URL: oci://ghcr.io/org/atlas-registry

Plan and Apply

Plans and deployments work as before, with atlas:// resolved against the url. Plan a change, push the new state, and schema apply runs the approved plan it finds there:

shell
atlas schema plan --env prod --from atlas://app --name add-posts --auto-approveatlas schema push --env prodatlas schema apply --env prod --to atlas://app --auto-approve
Output
Applying approved migration using pre-planned file add-posts (1 statement in total):

Notes

  • Applies to the registry entries of schema repositories: schema states, tags, versions, and plans. They are stored at the url, not in Atlas Cloud.
  • Running these commands still requires atlas login.
  • backup works alongside url. Every write is also copied to the backups, and a backup that fails does not fail the command. Reads fall back to the backups when the url cannot serve them.
  • States and plans already in Atlas Cloud are not copied to the url. Push them to it after setting url.
featureatlas prodeclarative-schemaregistryblob storages3gcsazureocischema-push