Skip to content

Commit 743ce11

Browse files
Apply Lambros' suggestions from code review part 2
Co-authored-by: Lambros Petrou <[email protected]>
1 parent ca8210e commit 743ce11

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/content/docs/d1/best-practices/read-replication.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ sidebar:
88

99
import { GlossaryTooltip, Details, GitHubCode, APIRequest, Tabs, TabItem, TypeScriptExample } from "~/components"
1010

11-
D1 read replication can lower latency for read queries and scale read throughput by adding read-only database copies, called read replicas, across global regions closer to clients.
11+
D1 read replication can lower latency for read queries and scale read throughput by adding read-only database copies, called read replicas, across regions globally closer to clients.
1212

1313
Your application can use read replicas with D1 [Sessions API](/d1/worker-api/d1-database/#withsession). A Session encapsulates all the queries from one logical session for your application. For example, a Session may correspond to all queries coming from a particular web browser session. All queries within a Session read from a database instance which is as up-to-date as your query needs it to be. Sessions API ensures [sequential consistency](/d1/best-practices/read-replication/#replica-lag-and-consistency-model) for all queries in a Session.
1414

@@ -369,7 +369,7 @@ async function getBillStatement(accountId: string, billId: string, bookmark: str
369369

370370
### Start a Session from previous context (bookmark)
371371

372-
To create a new Session from the context of a previous Session, pass a `bookmark` parameter to guarantee that the Session starts with database state as of or later than the provided `bookmark`. `bookmark` could be saved in HTTP header from previous Session.
372+
To create a new Session from the context of a previous Session, pass a `bookmark` parameter to guarantee that the Session starts with a database version that is at least as up-to-date as the provided `bookmark`.
373373

374374
```ts
375375
const bookmark = request.headers.get('x-d1-bookmark') ?? 'first-unconstrained';
@@ -493,7 +493,6 @@ console.log({
493493
```
494494

495495
- `served_by_region` and `served_by_primary` fields are present for all D1 remote requests, regardless of whether read replication is enabled or if the Sessions API is used. On local development, `npx wrangler dev`, these fields are `undefined`.
496-
- You can also manually calculate the query latency using `Date.now()` before and after your query.
497496

498497
## Read replica locations
499498

0 commit comments

Comments
 (0)