D1 Database Benchmark

Compare D1 performance with Smart Placement, Read Replication + KV Caching

Worker Colo -
Region -
Smart Placement Enabled
D1 Region -
Read Replication -
- Users
- Products
- Orders
- Cached Keys

D1 Direct Queries

Direct database queries (Smart Placement optimized)

Single Read

SELECT single row by ID

Batch Read

5 SELECT queries in batch

Single Write

INSERT single row

Batch Write

10 INSERTs in batch

JOIN Query

3-table JOIN (orders+users+products)

Aggregation

GROUP BY with SUM, COUNT, AVG

Read Replication (Beta)

Sessions API routes reads to nearest replica for lower global latency

Session Read (Replica)

Routes to nearest read replica

Session Read (Primary)

Forces routing to primary DB

Replication Comparison

Compare Direct vs Replica vs Primary

KV Cached Queries

Queries with Workers KV caching layer (run twice to see cache hits)

Cached Single Read

KV cache with D1 fallback

Cached Batch Read

Multi-key KV lookup

Cached JOIN Query

Complex query result caching

Performance Comparison

Run D1 direct vs KV cached (cold + warm) side-by-side

Benchmark History