drift Docs
Start
What is Drift?
The tour, if you are new here.
Why Drift?
The case for a smaller cloud.
Getting started
Nothing to deployed, in one command.
Architecture
How a slice is put together.
What it costs
The free grant, five unit prices, two rules.
Build
Canvas
Static sites, same origin as your API.
Tools
Operate
Auth
Accounts, tokens and scopes.
Security
Boundaries, sandboxing and hardening.

Anatomy

The Driftfile is the project. The top level carries the project name, the two retention knobs, four resource sections (atomic, backbone, canvas, domains) each optional and independent (a static site needs only name and canvas; a data pipeline needs only atomic and backbone), and three optional siblings: environments (per-environment config overrides), hooks (local pre/post-deploy commands), and tests (e2e commands for drift project test). Within a section, the envelope limits come first, then the resources that run inside them.

Driftfile
name: my-app              # required: the project / slice name
log_retention:    7d      # optional: TOP LEVEL, not inside a section
backup_retention: 30d

atomic:                   # optional: function limits + functions
  function_memory:  128MB
  function_timeout: 30s
  rate_limit:       1000/min
  egress:  { ... }
  functions: [ ... ]

backbone:                 # optional: data limits + resources
  nosql:    [ ... ]        # each entry carries its own size
  sql:      [ ... ]        # each entry carries its own size
  blobs:    [ ... ]        # each entry carries its own size
  queues:   [ ... ]
  cache:    { ... }
  secrets:  { ... }

canvas:                   # optional: site limit + site(s)
  canvas_size: 50MB
  sites: [ ... ]

domains:                  # optional: custom hostnames the slice answers on
  - host: forms.example.org

environments:             # optional: per-environment config overrides
  prod: {}
  staging: { atomic: { rate_limit: 100/min } }

hooks:                    # optional: local pre/post-deploy commands
  pre_deploy:  [npm run build]
  post_deploy: [./smoke.sh]

tests:                    # optional: e2e commands for `drift project test`
  e2e: [npx playwright test]

Project identity

The top of the file carries the project's identity. The Driftfile never declares a tier or a price because the cost is computed from the limits and resource counts you declare, per environment.

TypeDefaultMeaning
  • name
    Type
    string
    Default
    required
    Meaning
    The project name; also the slice name. 1–32 lowercase letters, numbers, or hyphens. With environments, prod deploys under this bare name and others under name-<env>.
  • log_retention
    Type
    duration
    Default
    platform default
    Meaning
    How long Atomic invocation logs are kept (e.g. 72h, 7d).
  • backup_retention
    Type
    duration
    Default
    platform default
    Meaning
    How long Backbone backup snapshots are kept.

Names

One identifier shape covers almost everything you name: the project, every environment, every function, collection, bucket, and queue. 1–32 characters, lowercase letters and digits, hyphens allowed in the interior only. No underscores, no uppercase, no leading or trailing hyphen.

# pattern: ^[a-z0-9](?:[a-z0-9-]{0,30}[a-z0-9])?$
permit-types      # fine
audit-log-2       # fine
Permit_Types      # rejected: uppercase and underscore
-uploads          # rejected: leading hyphen

SQL database names are the one exception: 1–64 characters, and underscores are allowed in the interior. That is why the SQL section states its own rule.

Short forms

Three sections accept sugar for their common case. The CLI expands it before validating.

Written asMeans
canvas: ./sitecanvas: { sites: [./site] }
canvas: [./a, ./b]canvas: { sites: [./a, ./b] }
atomic: [submit, notify]atomic: { functions: [submit, notify] }
environments: [prod, staging]Each environment inherits the base unchanged
queues: [validate]queues: [{ name: validate }]

drift file fmt preserves whichever form you wrote. Tidying a file never restructures it.