Name the SQL document storage crate sql_storage

This commit is contained in:
2026-11-30 03:47:24 +08:00
parent 2f2a39621c
commit bb15a7043c
12 changed files with 28 additions and 20 deletions
+9 -1
View File
@@ -1,6 +1,14 @@
# Bedrock storage
Bedrock stores JSON documents in SQLite, PostgreSQL or MySQL. Each backend has its own module in the `persistence` crate. SQLite is the default and creates `bedrock.sqlite3` in the current directory on first start.
Bedrock stores JSON documents in SQLite, PostgreSQL or MySQL. Each backend has its own module in the `sql_storage` crate. SQLite is the default and creates `bedrock.sqlite3` in the current directory on first start.
## Storage boundaries
`sql_storage` owns the transactional document data, revisions, and snapshots used by the application. `clusters` resolves deployment settings and `db_connection` selects the SQL driver and read endpoints.
Notion describes sharding online PostgreSQL block data by workspace and feeding a downstream S3 data lake from PostgreSQL changes. Bedrock currently supports selecting a configured SQL cluster and using its read replicas. Workspace sharding, S3 object storage, 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)
## Database configuration
Set `BEDROCK_DB_CONFIG` to the path of a private JSON deployment configuration to select a different cluster. For example: