Skip to content

Commit 05cebf5

Browse files
Oxyjunsdnts
authored andcommitted
Centralising FAQs for D1 using partial files (cloudflare#23898)
1 parent 0dc9948 commit 05cebf5

File tree

9 files changed

+95
-68
lines changed

9 files changed

+95
-68
lines changed

src/content/docs/d1/platform/alpha-migration.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pcx_content_type: concept
33
title: Alpha database migration guide
44
sidebar:
5-
order: 2
5+
order: 3
66
---
77

88
:::caution

src/content/docs/d1/platform/limits.mdx

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,4 @@ Cloudflare also offers other storage solutions such as [Workers KV](/kv/api/), [
5454

5555
Frequently asked questions related to D1 limits:
5656

57-
### How much work can a D1 database do?
58-
59-
D1 is designed for horizontal scale out across multiple, smaller (10 GB) databases, such as per-user, per-tenant or per-entity databases. D1 allows you to build applications with thousands of databases at no extra cost for isolating with multiple databases, as the pricing is based only on query and storage costs.
60-
61-
- Each D1 database can store up to 10 GB of data, and you can create up to thousands of separate D1 databases. This allows you to split a single monolithic database into multiple, smaller databases, thereby isolating application data by user, customer, or tenant.
62-
- SQL queries over a smaller working data set can be more efficient and performant while improving data isolation.
63-
64-
:::caution
65-
Note that the 10 GB limit of a D1 database cannot be further increased.
66-
:::
67-
68-
### How many simultaneous connections can a Worker open to D1?
69-
70-
You can open up to six connections (to D1) simultaneously for each invocation of your Worker.
71-
72-
For more information on a Worker's simultaneous connections, refer to [Simultaneous open connections](/workers/platform/limits/#simultaneous-open-connections).
57+
<Render file="faq-limits" product="d1"/>

src/content/docs/d1/platform/pricing.mdx

Lines changed: 1 addition & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -21,51 +21,4 @@ D1 bills based on:
2121

2222
Frequently asked questions related to D1 pricing:
2323

24-
### Will D1 always have a Free plan?
25-
26-
Yes, the [Workers Free plan](/workers/platform/pricing/#workers) will always include the ability to prototype and experiment with D1 for free.
27-
28-
### What happens if I exceed the daily limits on reads and writes, or the total storage limit, on the Free plan?
29-
30-
When your account hits the daily read and/or write limits, you will not be able to run queries against D1. D1 API will return errors to your client indicating that your daily limits have been exceeded. Once you have reached your included storage limit, you will need to delete unused databases or clean up stale data before you can insert new data, create or alter tables or create indexes and triggers.
31-
32-
Upgrading to the Workers Paid plan will remove these limits, typically within minutes.
33-
34-
### What happens if I exceed the monthly included reads, writes and/or storage on the paid tier?
35-
36-
You will be billed for the additional reads, writes and storage according to [D1's pricing metrics](#billing-metrics).
37-
38-
### How can I estimate my (eventual) bill?
39-
40-
Every query returns a `meta` object that contains a total count of the rows read (`rows_read`) and rows written (`rows_written`) by that query. For example, a query that performs a full table scan (for instance, `SELECT * FROM users`) from a table with 5000 rows would return a `rows_read` value of `5000`:
41-
42-
```json
43-
"meta": {
44-
"duration": 0.20472300052642825,
45-
"size_after": 45137920,
46-
"rows_read": 5000,
47-
"rows_written": 0
48-
}
49-
```
50-
51-
These are also included in the D1 [Cloudflare dashboard](https://dash.cloudflare.com) and the [analytics API](/d1/observability/metrics-analytics/), allowing you to attribute read and write volumes to specific databases, time periods, or both.
52-
53-
### Does D1 charge for data transfer / egress?
54-
55-
No.
56-
57-
### Does D1 charge additional for additional compute?
58-
59-
D1 itself does not charge for additional compute. Workers querying D1 and computing results: for example, serializing results into JSON and/or running queries, are billed per [Workers pricing](/workers/platform/pricing/#workers), in addition to your D1 specific usage.
60-
61-
### Do queries I run from the dashboard or Wrangler (the CLI) count as billable usage?
62-
63-
Yes, any queries you run against your database, including inserting (`INSERT`) existing data into a new database, table scans (`SELECT * FROM table`), or creating indexes count as either reads or writes.
64-
65-
### Can I use an index to reduce the number of rows read by a query?
66-
67-
Yes, you can use an index to reduce the number of rows read by a query. [Creating indexes](/d1/best-practices/use-indexes/) for your most queried tables and filtered columns reduces how much data is scanned and improves query performance at the same time. If you have a read-heavy workload (most common), this can be particularly advantageous. Writing to columns referenced in an index will add at least one (1) additional row written to account for updating the index, but this is typically offset by the reduction in rows read due to the benefits of an index.
68-
69-
### Does a freshly created database, and/or an empty table with no rows, contribute to my storage?
70-
71-
Yes, although minimal. An empty table consumes at least a few kilobytes, based on the number of columns (table width) in the table. An empty database consumes approximately 12 KB of storage.
24+
<Render file="faq-pricing" product="d1" />

src/content/docs/d1/platform/release-notes.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Release notes
44
release_notes_file_name:
55
- d1
66
sidebar:
7-
order: 4
7+
order: 5
88
---
99

1010
import { ProductReleaseNotes } from "~/components";

src/content/docs/d1/platform/storage-options.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ pcx_content_type: navigation
33
title: Choose a data or storage product
44
external_link: /workers/platform/storage-options/
55
sidebar:
6-
order: 3
6+
order: 4
77

88
---
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
title: FAQs
3+
pcx_content_type: faq
4+
sidebar:
5+
order: 10
6+
7+
---
8+
9+
import { Render } from "~/components";
10+
11+
## Pricing
12+
13+
<Render file="faq-pricing" product="d1"/>
14+
15+
## Limits
16+
17+
<Render file="faq-limits" product="d1"/>

src/content/docs/durable-objects/reference/faq.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Frequently Asked Questions
2+
title: FAQs
33
pcx_content_type: concept
44
sidebar:
55
order: 12
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
{}
3+
---
4+
5+
### How much work can a D1 database do?
6+
7+
D1 is designed for horizontal scale out across multiple, smaller (10 GB) databases, such as per-user, per-tenant or per-entity databases. D1 allows you to build applications with thousands of databases at no extra cost for isolating with multiple databases, as the pricing is based only on query and storage costs.
8+
9+
- Each D1 database can store up to 10 GB of data, and you can create up to thousands of separate D1 databases. This allows you to split a single monolithic database into multiple, smaller databases, thereby isolating application data by user, customer, or tenant.
10+
- SQL queries over a smaller working data set can be more efficient and performant while improving data isolation.
11+
12+
:::caution
13+
Note that the 10 GB limit of a D1 database cannot be further increased.
14+
:::
15+
16+
### How many simultaneous connections can a Worker open to D1?
17+
18+
You can open up to six connections (to D1) simultaneously for each invocation of your Worker.
19+
20+
For more information on a Worker's simultaneous connections, refer to [Simultaneous open connections](/workers/platform/limits/#simultaneous-open-connections).
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
{}
3+
---
4+
5+
### Will D1 always have a Free plan?
6+
7+
Yes, the [Workers Free plan](/workers/platform/pricing/#workers) will always include the ability to prototype and experiment with D1 for free.
8+
9+
### What happens if I exceed the daily limits on reads and writes, or the total storage limit, on the Free plan?
10+
11+
When your account hits the daily read and/or write limits, you will not be able to run queries against D1. D1 API will return errors to your client indicating that your daily limits have been exceeded. Once you have reached your included storage limit, you will need to delete unused databases or clean up stale data before you can insert new data, create or alter tables or create indexes and triggers.
12+
13+
Upgrading to the Workers Paid plan will remove these limits, typically within minutes.
14+
15+
### What happens if I exceed the monthly included reads, writes and/or storage on the paid tier?
16+
17+
You will be billed for the additional reads, writes and storage according to [D1's pricing metrics](#billing-metrics).
18+
19+
### How can I estimate my (eventual) bill?
20+
21+
Every query returns a `meta` object that contains a total count of the rows read (`rows_read`) and rows written (`rows_written`) by that query. For example, a query that performs a full table scan (for instance, `SELECT * FROM users`) from a table with 5000 rows would return a `rows_read` value of `5000`:
22+
23+
```json
24+
"meta": {
25+
"duration": 0.20472300052642825,
26+
"size_after": 45137920,
27+
"rows_read": 5000,
28+
"rows_written": 0
29+
}
30+
```
31+
32+
These are also included in the D1 [Cloudflare dashboard](https://dash.cloudflare.com) and the [analytics API](/d1/observability/metrics-analytics/), allowing you to attribute read and write volumes to specific databases, time periods, or both.
33+
34+
### Does D1 charge for data transfer / egress?
35+
36+
No.
37+
38+
### Does D1 charge additional for additional compute?
39+
40+
D1 itself does not charge for additional compute. Workers querying D1 and computing results: for example, serializing results into JSON and/or running queries, are billed per [Workers pricing](/workers/platform/pricing/#workers), in addition to your D1 specific usage.
41+
42+
### Do queries I run from the dashboard or Wrangler (the CLI) count as billable usage?
43+
44+
Yes, any queries you run against your database, including inserting (`INSERT`) existing data into a new database, table scans (`SELECT * FROM table`), or creating indexes count as either reads or writes.
45+
46+
### Can I use an index to reduce the number of rows read by a query?
47+
48+
Yes, you can use an index to reduce the number of rows read by a query. [Creating indexes](/d1/best-practices/use-indexes/) for your most queried tables and filtered columns reduces how much data is scanned and improves query performance at the same time. If you have a read-heavy workload (most common), this can be particularly advantageous. Writing to columns referenced in an index will add at least one (1) additional row written to account for updating the index, but this is typically offset by the reduction in rows read due to the benefits of an index.
49+
50+
### Does a freshly created database, and/or an empty table with no rows, contribute to my storage?
51+
52+
Yes, although minimal. An empty table consumes at least a few kilobytes, based on the number of columns (table width) in the table. An empty database consumes approximately 12 KB of storage.

0 commit comments

Comments
 (0)