Skip to content

Commit 3653945

Browse files
committed
Initialising D1 RR docs. Introducing Concepts and Glossary.
1 parent c79860b commit 3653945

File tree

3 files changed

+51
-0
lines changed

3 files changed

+51
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
title: D1 read replication
3+
pcx_content_type: concept
4+
sidebar:
5+
order: 2
6+
7+
---
8+
9+
import { GlossaryTooltip } from "~/components"
10+
11+
D1 read replication is a feature which reduces the <GlossaryTooltip term = "request latency">request latency</GlossaryTooltip> for read requests for users who may be located far away from the <GlossaryTooltip term="primary database instance">primary database instance</GlossaryTooltip>.
12+
13+
## Primary database instance vs read replicas
14+
15+
When using D1 without read replication, D1 routes all queries (both read and write) to a specific database instance in [one location in the world](/d1/configuration/data-location/), known as the primary database instance. The request latency is dependent on the physical closeness of a user to the primary database instance - it takes less time for light (information) to travel between the user and the primary database instance if that distance is shorter. Users located further away from this database instance experience the longest request latency.
16+
17+
When using read replication, D1 introduces multiple “almost up-to-date” copies of the primary database instance which only serve read requests, called <GlossaryTooltip term="read replica"> read replicas </GlossaryTooltip>. D1 creates the read replicas in multiple regions throughout the world [across the Cloudflare network](/d1/concepts/read-replication/#read-replica-locations).
18+
19+
A user may be located far away from the primary database instance but close to a read replica. By sending their read requests to the read replica instead of the primary database instance, the user enjoys shorter read request response times. For example, the request latency when using the primary database instance may be 250 ms, versus 20 - 50 ms when using a read replica.
20+
21+
:::note
22+
All write requests are still forwarded to the primary database instance. Read replication only improves the query response time for read requests.
23+
:::
24+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
title: Glossary
3+
pcx_content_type: glossary
4+
sidebar:
5+
order: 12
6+
7+
---
8+
9+
import { Glossary } from "~/components"
10+
11+
Review the definitions for terms used across Cloudflare's D1 documentation.
12+
13+
<Glossary product="d1" />

src/content/glossary/d1.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
productName: D1
3+
entries:
4+
- term: primary database instance
5+
general_definition: |-
6+
the primary database instance is the original instance of a database. This database instance only exists in one location in the world.
7+
8+
- term: request latency
9+
general_definition: |-
10+
the request latency is the time it takes for a request from a user to be returned by D1.
11+
12+
- term: read replica
13+
general_definition: |-
14+
a read replica is an “almost up-to-date” copy of the primary database instance which only serve read requests. There may be multiple read replicas for a single primary database instance.

0 commit comments

Comments
 (0)