Documentation
What backd is, and where to find things.
backd is an open-source (MIT), config-driven backend: one stateless Go service over MongoDB. You declare realms, databases and collections as files on disk (a JSON Schema per collection, optional indexes and access rules) and backd serves a schema-validated, queryable REST API for them, with built-in users and sessions, API keys, an admin API, and server-side functions for the logic clients can’t be trusted with.
Where to start
| I want to… | Go to |
|---|---|
| Try it in a few minutes | Getting started |
| Build a whole app, chapter by chapter | Tutorial |
| Describe my data: schemas, indexes, realms | Configuration |
| Read, write and query documents | HTTP API and the JavaScript client |
| Control who can do what: users, sessions, API keys, rules, administration | Authentication |
| Run server-side logic: privileged changes, background jobs, cron, webhooks | Functions (start with the Quickstart) |
| Put it in production, back it up, harden it | Operations |
| See complete applications | Examples |
| Work on backd itself | Development |
What you get
- Configuration as files. Invalid config stops startup and names the file;
backd config checkruns the same checks in CI. - Schema-validated writes, mirrored as a MongoDB validator, with field-level errors and optimistic concurrency (
ETag,If-Match). - Queries without injection:
where,order_by, pagination and counts over an allowlisted query language. - Users, sessions and API keys per realm, with brute-force protection, invitations, network restrictions and an audit trail; administration through an admin API and the command line, never database credentials.
- Access rules (
rules:incollection.yaml) decided per document, with read rules applied inside the database query. - Server-side functions in isolated Deno processes: sync calls, background jobs, cron schedules, webhooks, encrypted secrets, rate limits, idempotency and a network allowlist.
- A production path: a tested reference deployment (TLS, least-privilege MongoDB, encrypted backups), a config fingerprint so every instance runs the same configuration, and signed releases.
Versions
- v0.2.0 added users, single sign-on per realm, access rules and secure administration. See upgrading to v0.2.0.
- v0.3.0 adds server-side functions, the flag-based command line, listing of jobs, and this documentation’s Functions section. See the release notes for what changed and what breaks.
- v0.4.0 adds email (verification, password reset, address changes and invitations, through a delivery function you write or the Postmark example), hosted pages for the emailed links, custom emails from functions, erasure (deactivate by default, erase on request), Prometheus metrics with Grafana dashboards, the example attack scripts that CI runs, and the JavaScript client on npm (
backd-js). See upgrading to v0.4.0. - v0.5.0 adds cursor pagination (
afterandnext_cursor), API keys limited to grants (scopes), HttpOnly session cookies for browser apps,Idempotency-Keyon document creates and batches, dates stored as real dates (x-backd-store: date),backd rules test, shorter sessions for administrators, a login throttle that holds across instances, and a tutorial that builds a complete app. The JavaScript client moves to 0.4.0 with the matching options. See upgrading to v0.5.0. - v0.6.0 adds soft delete per collection (a trash with
restoreandpurge, retention, unique values freed by a delete), admin rights per role (admin: [users, invitations]instead of everything),Prefer: respond-asyncto run a sync function as a job, a tunable login throttle (login_throttle), and the matching options in the JavaScript client (0.5.0). See upgrading to v0.6.0. - v0.7.0 adds the admin web interface (users, invitations, API keys, secrets, audit, functions and jobs, the configuration, and a data browser with forms drawn from your schemas), a read-only admin level (
admin: read,admin.read_access), an audited admin data route, a switch that turns the admin API off per instance (BACKD_ADMIN_API), and the matching methods in the JavaScript client (0.6.0). See upgrading to v0.7.0. - v0.8.0 adds files: documents carry files in a realm’s own S3-compatible storage (AWS S3, MinIO, Cloudflare R2 or DigitalOcean Spaces) with
files:incollection.yaml, uploads through backd or straight to the bucket, signed downloads and links for apps, rules that apply to every file operation, erasure andbackd storage reconcile, files in functions and in the JavaScript client (0.7.0) and the admin UI, and chapters 13 to 15 of the tutorial. It also adds schema checks (backd data check),on_complete, job steps and progress, and pausing, time zones andoverlap: skipfor schedules. See upgrading to v0.8.0. - v0.8.1 (a minor release with breaking changes, as allowed before a stable one) adds image versions (resized copies of uploaded images made by workers, served with
?version=), metadata removal from JPEG and PNG originals by default, storage quotas, multipart direct uploads of files up to 4 TiB, and checks of a change against the realm’s whole configuration. Rules now live incollection.yaml, andbackdwithout a command prints its help. See upgrading to v0.8.1.
backd has no installed base yet: until a stable release is declared, breaking changes are allowed and are listed in the release notes.
Run backd with docker compose, or build it from source.
ConfigurationEnvironment variables that control backd at runtime.
TutorialBuild Shelf, a team asset library, one feature per chapter — every chapter ends in a working app.
HTTP APIRequest IDs, request bodies, errors and health endpoints.
OperationsMongoDB, provisioning, health checks, logging, timeouts, shutdown, and running backd in production.
AuthenticationUsers, sign-in methods and passwords in each realm.
FunctionsRun server-side logic next to your data: sync calls, background jobs, cron schedules and webhooks, with the rules, secrets and limits that keep them safe.
FilesLet documents carry files, kept in the realm’s own S3-compatible object storage: how a realm connects its storage, and what backd checks.
ClientsLibraries for calling backd from applications.
ExamplesExample applications built on backd, and what each one shows.
DevelopmentWorkflow, repository layout, tests and CI.