-
Notifications
You must be signed in to change notification settings - Fork 10k
[D1] D1 RR #19896
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[D1] D1 RR #19896
Changes from 21 commits
7d999df
c989609
88bfdac
29b43d9
258e52e
a9c8987
46e363c
1cf14cc
fbccebc
a5b2905
c79860b
3653945
0f5d328
efd3905
c91594d
0b47e8f
c769b63
b2bccd1
c07415e
9d37df2
cf40610
ca8a352
79a6785
0861280
1e3d32b
d2f0dfe
114b2e7
3ef1ad4
71fc1e1
598f769
17f5cfa
7ceabd7
229543c
07ff81b
b540f59
bec5654
4aba48a
9442780
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| title: Concepts | ||
| pcx_content_type: navigation | ||
| sidebar: | ||
| order: 3 | ||
| group: | ||
| hideIndex: true | ||
| --- | ||
|
|
||
| import { DirectoryListing } from "~/components"; | ||
|
|
||
| <DirectoryListing /> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,167 @@ | ||||||
| --- | ||||||
| title: D1 read replication | ||||||
| pcx_content_type: concept | ||||||
| sidebar: | ||||||
| order: 2 | ||||||
|
|
||||||
| --- | ||||||
|
|
||||||
| import { GlossaryTooltip } from "~/components" | ||||||
|
|
||||||
| 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>. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @vy-ton - I think this needs to be framed better. “Distributes read-only copies of your database that <…>” |
||||||
|
|
||||||
| ## Primary database instance vs read replicas | ||||||
|
|
||||||
| 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. | ||||||
|
|
||||||
| 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). | ||||||
|
||||||
| 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). | |
| 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). |
I replaced the curly quotes with standard straight quotes to adhere to the style guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The end user (client) doesn’t choose to do this. Need to reframe all of this.
Oxyjun marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
Oxyjun marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The examples need to be more real. Show users what a bookmark can be - don’t leave it so abstract.
is it meant to be a user Id? Random? The letter “B” - ?
help users understand what they need to do + make it simple.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
show a real example SQL query. No placeholders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc @vy-ton - this makes the API seem more complex than it is. Too many placeholders instead of actually describing a constraint and how it is useful for enabling session consistency for a given client.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again: what is a constraint?
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| pcx_content_type: navigation | ||
| title: Demos and architectures | ||
| sidebar: | ||
| order: 12 | ||
| order: 13 | ||
|
|
||
| --- | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| pcx_content_type: navigation | ||
| title: Platform | ||
| sidebar: | ||
| order: 12 | ||
| order: 13 | ||
| group: | ||
| hideIndex: true | ||
| --- | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| pcx_content_type: navigation | ||
| title: Reference | ||
| sidebar: | ||
| order: 13 | ||
| order: 14 | ||
| group: | ||
| hideIndex: true | ||
| --- | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| title: SQL API | ||
| pcx_content_type: navigation | ||
| sidebar: | ||
| order: 5 | ||
| order: 6 | ||
| group: | ||
| hideIndex: true | ||
| --- | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ pcx_content_type: navigation | |
| title: Tutorials | ||
| hideChildren: true | ||
| sidebar: | ||
| order: 11 | ||
| order: 12 | ||
|
|
||
| --- | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,18 @@ | ||
| --- | ||
| productName: D1 | ||
| entries: | ||
| - term: primary database instance | ||
| general_definition: |- | ||
| the primary database instance is the original instance of a database. This database instance only exists in one location in the world. | ||
| - term: request latency | ||
| general_definition: |- | ||
| the request latency is the time it takes for a request from a user to be returned by D1. | ||
| - term: read replica | ||
| general_definition: |- | ||
| 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. | ||
| - term: replica lag | ||
| general_definition: |- | ||
| the difference between the primary database instance and a read replica. | ||
| - term: "query planner" | ||
| general_definition: |- | ||
| A component in a database management system which takes a user query and generates the most efficient plan of executing that query (the query plan). For example, the query planner decides which indices to use, or which table to access first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doc needs:
it uses too much prose to try to explain instead of showing with code + comments (first) and then walking through it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My strong advice:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for taking the time to review this @elithrar! I'll work with @vy-ton to see how to best improve this chapter in context of your suggested approach 👍🏻