Skip to content

Concepts

Each D1 database is a local-primary SQLite file. Every query hits that one authority. Read replicas and a read-replica / write-primary split are not provided.

Sessions and opaque bookmarks still exist. A bookmark preserves same-database local sequential visibility, not cross-region causality. rows_read / rows_written are stable counts for that SQLite execution, not Cloudflare billing.

dump() is rejected for the current hosted non-alpha model (D1_DUMP_ERROR), matching hosted behavior.

preparebindrun / all / first / raw. batch is sequential and atomic. exec runs parameter-free SQL. withSession accepts "first-primary" / "first-unconstrained" / a bookmark string. See the D1 Worker API.

Compatibility

TopicCloudflareopen-compute
Worker APID1 Worker APISame: prepare / bind / run / all / first / raw / exec / batch, sessions, bookmarks
Read replicas / region routingAvailableNot provided
BookmarksCross-replica causalityLocal ordering on the same database
rows_read / rows_writtenBilling countersLocal SQLite execution counts
dump()Rejected on hosted non-alphaRejected

Next: Guides.