Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
7d999df
Update DO migration docs
harshil1712 Jan 23, 2025
c989609
Update src/content/docs/durable-objects/reference/durable-objects-mig…
Oxyjun Jan 23, 2025
88bfdac
Update src/content/docs/durable-objects/reference/durable-objects-mig…
Oxyjun Jan 23, 2025
29b43d9
Resolving merge conflict.
Oxyjun Jan 23, 2025
258e52e
Docs enhancement part 1
Oxyjun Jan 23, 2025
a9c8987
add note for create class
harshil1712 Jan 30, 2025
46e363c
Editing the structure for better clarity.
Oxyjun Jan 30, 2025
1cf14cc
Merging HEAD back into the branch.
Oxyjun Jan 31, 2025
fbccebc
Improving explanation and code examples.
Oxyjun Jan 31, 2025
a5b2905
Improving structure.
Oxyjun Feb 11, 2025
c79860b
Creating a new "Concepts" node
Oxyjun Feb 11, 2025
3653945
Initialising D1 RR docs. Introducing Concepts and Glossary.
Oxyjun Feb 11, 2025
0f5d328
Fleshing out the RR chapter.
Oxyjun Feb 11, 2025
efd3905
Rewording extend with continue.
Oxyjun Feb 11, 2025
c91594d
Manually reversing any changes to DO Migrations
Oxyjun Feb 11, 2025
0b47e8f
Merge commit '28cb6c1a1ae9e32af5198c5498e259edba6a2afa' into jun/d1/rr
Oxyjun Feb 11, 2025
c769b63
Merge commit 'b2d52b8e3848364df3d5fef4a77fca95e166f776' into jun/d1/rr
Oxyjun Feb 24, 2025
b2bccd1
Initialising `withSession` in the D1 API docs
Oxyjun Feb 25, 2025
c07415e
Initialising API docs for getBookmark
Oxyjun Feb 25, 2025
9d37df2
Adding type for `bookmark`
Oxyjun Feb 25, 2025
cf40610
Adding placeholder D1 read replication demo
Oxyjun Feb 27, 2025
ca8a352
Updating Data Locations chapter to reference RR.
Oxyjun Mar 3, 2025
79a6785
Updating api playground, minor rephrasing
Oxyjun Mar 4, 2025
0861280
Adding placeholder example.
Oxyjun Mar 5, 2025
1e3d32b
Adding Worker code to RR tutorial.
Oxyjun Mar 6, 2025
d2f0dfe
Fixing Steps component.
Oxyjun Mar 6, 2025
114b2e7
Fixing broken link.
Oxyjun Mar 6, 2025
3ef1ad4
Update src/content/docs/d1/tutorials/test-read-replication/index.mdx
Oxyjun Mar 6, 2025
71fc1e1
Merge commit 'ed9ff0caa8d2d2b68fde67f89f1279163726a73f' into jun/d1/rr
Oxyjun Mar 6, 2025
598f769
Merge branch 'jun/d1/rr' of github.com:cloudflare/cloudflare-docs int…
Oxyjun Mar 6, 2025
17f5cfa
Merge commit '2ebfe0ca296685004ce4a063e4e3032991984b1c' into jun/d1/rr
Oxyjun Mar 12, 2025
7ceabd7
Consolidating Best practices and Concepts into
Oxyjun Mar 12, 2025
229543c
Fixing links, editing the chapter structure.
Oxyjun Mar 12, 2025
07ff81b
Introducing code example better.
Oxyjun Mar 12, 2025
b540f59
Fixing redirects
Oxyjun Mar 12, 2025
bec5654
Adding more links to supplementary information.
Oxyjun Mar 12, 2025
4aba48a
Merge commit '0d7ef0a4e6064fdc22d5aa436090ae4105bfcad3' into jun/d1/rr
Oxyjun Mar 13, 2025
9442780
Updating `withSession` to mention it will default
Oxyjun Mar 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 28 additions & 21 deletions public/_redirects
Original file line number Diff line number Diff line change
Expand Up @@ -279,23 +279,30 @@
# D1
/d1/client-api/ /d1/worker-api/ 301
/d1/build-with-d1/d1-client-api/ /d1/worker-api/ 301
/d1/build-with-d1/import-data/ /d1/best-practices/import-export-data/ 301
/d1/build-with-d1/ /d1/best-practices/ 301
/d1/build-with-d1/import-export-data/ /d1/best-practices/import-export-data/ 301
/d1/build-with-d1/use-indexes/ /d1/best-practices/use-indexes/ 301
/d1/build-with-d1/remote-development/ /d1/best-practices/remote-development/ 301
/d1/build-with-d1/local-development/ /d1/best-practices/local-development/ 301
/d1/build-with-d1/import-data/ /d1/features/import-export-data/ 301
/d1/build-with-d1/ /d1/features/ 301
/d1/build-with-d1/import-export-data/ /d1/features/import-export-data/ 301
/d1/build-with-d1/use-indexes/ /d1/features/use-indexes/ 301
/d1/build-with-d1/remote-development/ /d1/features/remote-development/ 301
/d1/build-with-d1/local-development/ /d1/features/local-development/ 301
/d1/build-with-d1/foreign-keys/ /d1/sql-api/foreign-keys/ 301
/d1/build-with-d1/query-json/ /d1/sql-api/query-json/ 301
/d1/build-with-d1/use-d1-from-pages/ /d1/best-practices/use-d1-from-pages/ 301
/d1/build-with-d1/use-d1-from-pages/ /d1/features/use-d1-from-pages/ 301
/d1/best-practices/ /d1/features/ 301
/d1/best-practices/import-export-data/ /d1/features/import-export-data/ 301
/d1/best-practices/local-development/ /d1/features/local-development/ 301
/d1/best-practices/query-d1/ /d1/features/query-d1/ 301
/d1/best-practices/remote-development/ /d1/features/remote-development/ 301
/d1/best-practices/use-d1-from-pages/ /d1/features/use-d1-from-pages/ 301
/d1/best-practices/use-indexes/ /d1/features/use-indexes/ 301
/d1/learning/using-d1-from-pages/ /pages/functions/bindings/#d1-databases 301
/d1/learning/debug-d1/ /d1/observability/debug-d1/ 301
/d1/learning/using-indexes/ /d1/best-practices/use-indexes/ 301
/d1/learning/using-indexes/ /d1/features/use-indexes/ 301
/d1/learning/querying-json/ /d1/sql-api/query-json/ 301
/d1/learning/importing-data/ /d1/best-practices/import-export-data/ 301
/d1/learning/importing-data/ /d1/features/import-export-data/ 301
/d1/learning/generated-columns/ /d1/reference/generated-columns/ 301
/d1/learning/local-development/ /d1/best-practices/local-development/ 301
/d1/learning/remote-development/ /d1/best-practices/remote-development/ 301
/d1/learning/local-development/ /d1/features/local-development/ 301
/d1/learning/remote-development/ /d1/features/remote-development/ 301
/d1/learning/data-location/ /d1/configuration/data-location/ 301
/d1/migrations/ /d1/reference/migrations/ 301
/d1/platform/wrangler-commands/ /workers/wrangler/commands/#d1 301
Expand All @@ -310,20 +317,20 @@
/d1/reference/environments/ /d1/configuration/environments/ 301
/d1/reference/metrics-analytics/ /d1/observability/metrics-analytics/ 301
/d1/reference/wrangler-commands/ /d1/wrangler-commands/ 301
/d1/how-to/ /d1/best-practices/ 301
/d1/how-to/query-databases/ /d1/best-practices/query-d1/ 301
/d1/how-to/using-indexes/ /d1/best-practices/use-indexes/ 301
/d1/how-to/ /d1/features/ 301
/d1/how-to/query-databases/ /d1/features/query-d1/ 301
/d1/how-to/using-indexes/ /d1/features/use-indexes/ 301
/d1/how-to/querying-json/ /d1/sql-api/query-json/ 301
/d1/how-to/importing-data/ /d1/best-practices/import-export-data/ 301
/d1/how-to/importing-data/ /d1/features/import-export-data/ 301
/d1/how-to/generated-columns/ /d1/reference/generated-columns/ 301
/d1/build-databases/ /d1/best-practices/ 301
/d1/build-databases/query-databases/ /d1/best-practices/query-d1/ 301
/d1/build-databases/use-indexes/ /d1/best-practices/use-indexes/ 301
/d1/build-databases/import-data/ /d1/best-practices/import-export-data/ 301
/d1/build-databases/ /d1/features/ 301
/d1/build-databases/query-databases/ /d1/features/query-d1/ 301
/d1/build-databases/use-indexes/ /d1/features/use-indexes/ 301
/d1/build-databases/import-data/ /d1/features/import-export-data/ 301
/d1/build-databases/client-api/ /d1/worker-api/ 301
/d1/reference/query-json/ /d1/sql-api/query-json/ 301
/d1/configuration/local-development/ /d1/best-practices/local-development/ 301
/d1/configuration/remote-development/ /d1/best-practices/remote-development/ 301
/d1/configuration/local-development/ /d1/features/local-development/ 301
/d1/configuration/remote-development/ /d1/features/remote-development/ 301
/d1/reference/database-commands/ /d1/reference/sql-statements/ 301
/d1/reference/sql-statements/ /d1/sql-api/sql-statements/ 301

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 8 additions & 0 deletions src/content/apps/index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -340,3 +340,11 @@
languages: [TypeScript]
cloudflare: false
updated: 2024-10-07
- link: https://github.com/harshil1712/e-com-d1
id: E-commerce Store
description: An application to showcase D1 read replication in the context of an online store.
tags: []
products: [Workers, D1]
languages: [TypeScript]
cloudflare: true
updated: 2025-02-27
16 changes: 11 additions & 5 deletions src/content/docs/d1/configuration/data-location.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Learn how the location of data stored in D1 is determined, including where the l

## Automatic (recommended)

By default, D1 will automatically create your database in a location close to where you issued the request to create a database. In most cases this allows D1 to choose the optimal location for your database on your behalf.
By default, D1 will automatically create your primary database instance in a location close to where you issued the request to create a database. In most cases this allows D1 to choose the optimal location for your database on your behalf.

## Provide a location hint

Location hint is an optional parameter you can provide to indicate your desired geographical location for your database.
Location hint is an optional parameter you can provide to indicate your desired geographical location for your primary database instance.

You may want to explicitly provide a location hint in cases where the majority of your writes to a specific database come from a different location than where you are creating the database from. location hints can be useful when:
You may want to explicitly provide a location hint in cases where the majority of your writes to a specific database come from a different location than where you are creating the database from. Location hints can be useful when:

- Working in a distributed team.
- Creating databases specific to users in specific locations.
Expand All @@ -33,9 +33,7 @@ Providing a location hint does not guarantee that D1 runs in your preferred loca
### Use Wrangler

:::note

To install Wrangler, the command-line interface for D1 and Workers, refer to [Install and Update Wrangler](/workers/wrangler/install-and-update/).

:::

To provide a location hint when creating a new database, pass the `--location` flag with a valid location hint:
Expand Down Expand Up @@ -70,3 +68,11 @@ D1 supports the following location hints:
:::caution
D1 location hints are not currently supported for South America (`sam`), Africa (`afr`), and the Middle East (`me`). D1 databases do not run in these locations.
:::

## Read replica locations

D1 read replication allows you to create and distribute read-only copies of the primary database instance around the world. This reduces the query latency for users located far away from the primary database instance.

When using D1 read replication through [Sessions API](/d1/features/read-replication/#how-d1-read-replication-works), D1 automatically creates a read replica in [every available region](/d1/configuration/data-location#available-location-hints), including the region where the primary database instance is located.

Refer to [D1 read replication](/d1/features/read-replication/) for more information.
2 changes: 1 addition & 1 deletion src/content/docs/d1/configuration/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Configuration
pcx_content_type: navigation
sidebar:
order: 8
order: 9
group:
hideIndex: true
---
Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/d1/d1-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ pcx_content_type: navigation
title: REST API
external_link: /api/resources/d1/subresources/database/methods/create/
sidebar:
order: 6
order: 7
---
2 changes: 1 addition & 1 deletion src/content/docs/d1/demos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pcx_content_type: navigation
title: Demos and architectures
sidebar:
order: 12
order: 13

---

Expand Down
2 changes: 1 addition & 1 deletion src/content/docs/d1/examples/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ hideChildren: false
pcx_content_type: navigation
title: Examples
sidebar:
order: 10
order: 11
group:
hideIndex: true
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,4 @@ If you receive an error deploying:

- Refer to [Workers Python documentation](/workers/languages/python/) to learn more about how to use Python in Workers.
- Review the [D1 Workers Binding API](/d1/worker-api/) and how to query D1 databases.
- Learn [how to import data](/d1/best-practices/import-export-data/) to your D1 database.
- Learn [how to import data](/d1/features/import-export-data/) to your D1 database.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar:

D1 allows you to import existing SQLite tables and their data directly, enabling you to migrate existing data into D1 quickly and easily. This can be useful when migrating applications to use Workers and D1, or when you want to prototype a schema locally before importing it to your D1 database(s).

D1 also allows you to export a database. This can be useful for [local development](/d1/best-practices/local-development/) or testing.
D1 also allows you to export a database. This can be useful for [local development](/d1/features/local-development/) or testing.

## Import an existing database

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: Best practices
title: Features
pcx_content_type: navigation
sidebar:
order: 3
Expand Down
Loading
Loading