Generate typed cluster service clients and Axum routes from one contract

This commit is contained in:
2026-12-02 21:26:01 +08:00
parent 83a30fad4a
commit 46b85a9d47
9 changed files with 539 additions and 27 deletions
+8 -1
View File
@@ -8,6 +8,13 @@ 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)
## Cluster service calls
[bedrock-rpc](crates/bedrock-rpc/README.md) generates typed clients, handlers,
and Axum routes from a shared Rust declaration. The first contract reads
deployment status via `POST /admin/v1/deployment/status` with JSON body `{}`
and the admin listener's existing bearer authentication.
## Web backend
Run the Axum service with `cargo run --locked -p backend`. One process owns
@@ -17,7 +24,7 @@ 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` |
| Admin | `BEDROCK_ADMIN_LISTEN`, default `127.0.0.1:8081` when enabled | `GET /healthz`, `GET /readyz`, `GET /admin/v1/status`, `POST /admin/v1/deployment/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