Merge main into SQL persistence and integrate backend configuration

This commit is contained in:
2026-11-30 19:19:27 +08:00
25 changed files with 1284 additions and 4 deletions
+24
View File
@@ -8,6 +8,30 @@ Bedrock stores JSON documents in SQLite, PostgreSQL or MySQL. Each backend has i
Notion describes sharding online PostgreSQL block data by workspace and feeding a downstream S3 data lake from PostgreSQL changes. Bedrock supports named SQL roles and read replicas. The catalog can describe S3 buckets. Object I/O, workspace routing, and data-lake ingestion are future work. [Notion's PostgreSQL sharding](https://www.notion.com/blog/sharding-postgres-at-notion) · [Notion's data lake](https://www.notion.com/blog/building-and-scaling-notions-data-lake)
## Web backend
Run the Axum service with `cargo run --locked -p backend`. One process owns
the database connection, loads one deployment configuration, and serves
separate routers on the business and optional admin listeners.
| Listener | Setting and default | Routes |
|---|---|---|
| Business | `BEDROCK_BACKEND_LISTEN`, default `127.0.0.1:8080` | `GET /healthz`, `GET /readyz` |
| Admin | `BEDROCK_ADMIN_LISTEN`, default `127.0.0.1:8081` when enabled | `GET /healthz`, `GET /readyz`, `GET /admin/v1/status` |
The business readiness probe checks access to the current deployment revision.
Set `BEDROCK_ADMIN_TOKEN` from a private credential source to enable the admin
listener. Send it as `Authorization: Bearer <token>` for the status endpoint.
Keep the admin listener on loopback or behind an internal TLS endpoint.
The `admin_backend` library reports the deployment, storage driver, read-only
mode, and the loaded configuration version for the instance that served the
request. `BEDROCK_CONFIG_VERSION` can override the reported version label. The
admin router reads the same resolved configuration the process used to open the
database. Give every replica the same config file and version label through your
deployment process. The root `bedrock` binary remains the one-shot storage
initializer.
## Database configuration
Set `BEDROCK_DB_CONFIG` to a private YAML deployment configuration. See the [multi-storage example](deploy/kubernetes/multi-storage.yaml). TOML and existing JSON files also load through the same configuration model.