Skip to content

Commit 6e57045

Browse files
authored
Quick PCX Review part 1
1 parent 007487b commit 6e57045

File tree

10 files changed

+30
-25
lines changed

10 files changed

+30
-25
lines changed

src/content/docs/hyperdrive/configuration/how-hyperdrive-works.mdx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ Hyperdrive solves these challenges by managing the number of global connections
1515

1616
## How Hyperdrive makes databases fast globally
1717

18-
Hyperdrive accelerates database queries by performing the connection setup for new database connections near your Workers, pools existing connections near your database, and caches query results.
18+
Hyperdrive accelerates database queries by:
19+
20+
- Performing the connection setup for new database connections near your Workers
21+
- Pooling existing connections near your database
22+
- Caching query results
23+
1924
This ensures you have optimal performance when connecting to your database from Workers (whether your queries are cached or not).
2025

2126
![Hyperdrive connection](~/assets/images/hyperdrive/configuration/hyperdrive-comparison.svg)

src/content/docs/hyperdrive/configuration/local-development.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ sidebar:
77

88
import { WranglerConfig } from "~/components";
99

10-
Hyperdrive can be used when developing and testing your Workers locally by connecting to a local database instance running on your machine directly or a remote database instance. Local development uses [Wrangler](/workers/wrangler/install-and-update/), the command-line interface for Workers, to manage local development sessions and state.
10+
Hyperdrive can be used when developing and testing your Workers locally by connecting to a local database instance running on your machine directly, or a remote database instance. Local development uses [Wrangler](/workers/wrangler/install-and-update/), the command-line interface for Workers, to manage local development sessions and state.
1111

1212
:::note[Note]
1313

14-
You can connect to a local development for local development using the local connection string configurations for Wrangler as detailed below. This allows you to connect to a local database instance running on your machine directly.
14+
You can connect to a local database for local development using the local connection string configurations for Wrangler, as detailed below. This allows you to connect to a local database instance running on your machine directly.
1515

16-
You can also connect to a remote development for local development using the `npx wrangler dev --remote` command, which will use the remote database configured for your Hyperdrive configuration.
16+
You can also connect to a remote database for remote development using the `npx wrangler dev --remote` command, which will use the remote database configured for your Hyperdrive configuration.
1717

1818
:::
1919

src/content/docs/hyperdrive/examples/connect-to-mysql/aws-rds-aurora.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ For regular RDS instances (non-Aurora), you will need to fetch the endpoint and
4343
2. Select the database you want Hyperdrive to connect to.
4444
3. Under the **Connectivity & security** header, note down the **Endpoint** and the **Port**.
4545

46-
The endpoint will resemble `YOUR_DATABASE_NAME.cpuo5rlli58m.AWS_REGION.rds.amazonaws.com` and the port will default to `5432`.
46+
The endpoint will resemble `YOUR_DATABASE_NAME.cpuo5rlli58m.AWS_REGION.rds.amazonaws.com`, and the port will default to `5432`.
4747

4848
:::note[Support for MySQL-compatible providers]
4949

@@ -83,7 +83,7 @@ GRANT hyperdrive to hyperdrive_user;
8383

8484
Refer to AWS' [documentation on user roles in PostgreSQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Appendix.PostgreSQL.CommonDBATasks.Roles.html) for more details.
8585

86-
With a database user, password, database endpoint (hostname and port) and database name (default: `postgres`), you can now set up Hyperdrive.
86+
With a database user, password, database endpoint (hostname and port), and database name (default: `postgres`), you can now set up Hyperdrive.
8787

8888
## 3. Create a database configuration
8989

src/content/docs/hyperdrive/examples/connect-to-mysql/google-cloud-sql.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ To create a user for Hyperdrive to connect as:
3333

3434
1. Select **Users** in the sidebar.
3535
2. Select **Add User Account** > select **Built-in authentication**.
36-
3. Provide a name (for example, `hyperdrive-user`) > select **Generate** to generate a password.
36+
3. Provide a name (for example, `hyperdrive-user`), then select **Generate** to generate a password.
3737
4. Copy this password to your clipboard before selecting **Add** to create the user.
3838

3939
With the username, password, public IP address and (optional) database name (default: `mysql`), you can now create a Hyperdrive database configuration.

src/content/docs/hyperdrive/examples/connect-to-mysql/index.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ sidebar:
1111

1212
import { TabItem, Tabs, Render, WranglerConfig } from "~/components";
1313

14-
Hyperdrive supports MySQL and MySQL-compatible databases, [popular drivers](#supported-drivers) and Object Relational Mapper (ORM) libraries that use those drivers.
14+
Hyperdrive supports MySQL and MySQL-compatible databases, [popular drivers](#supported-drivers), and Object Relational Mapper (ORM) libraries that use those drivers.
1515

1616
## Create a Hyperdrive
1717

@@ -21,9 +21,9 @@ New to Hyperdrive? Refer to the [Get started guide](/hyperdrive/get-started/) to
2121

2222
:::
2323

24-
To create a Hyperdrive that connects to an existing MySQL database, use the [wrangler](/workers/wrangler/install-and-update/) CLI or the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers/hyperdrive).
24+
To create a Hyperdrive that connects to an existing MySQL database, use the [Wrangler](/workers/wrangler/install-and-update/) CLI or the [Cloudflare dashboard](https://dash.cloudflare.com/?to=/:account/workers/hyperdrive).
2525

26-
When using wrangler, replace the placeholder value provided to `--connection-string` with the connection string for your database:
26+
When using Wrangler, replace the placeholder value provided to `--connection-string` with the connection string for your database:
2727

2828
```sh
2929
# wrangler v3.11 and above required

src/content/docs/hyperdrive/get-started.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ This will create a new `hyperdrive-tutorial` directory. Your new `hyperdrive-tut
8484

8585
## 3. Connect Hyperdrive to a database
8686

87-
Hyperdrive works by connecting to your database, pooling database connections globally and speeding up your database access through Cloudflare's network.
87+
Hyperdrive works by connecting to your database, pooling database connections globally, and speeding up your database access through Cloudflare's network.
8888

89-
It will provide a secure connection string that is only accessible from your Worker, that you can use to connect to your database through Hyperdrive.
89+
It will provide a secure connection string that is only accessible from your Worker which you can use to connect to your database through Hyperdrive.
9090
This means that you can use the Hyperdrive connection string with your existing drivers or ORM libraries without needing significant changes to your code.
9191

9292
To create your first Hyperdrive database configuration, change into the directory you just created for your Workers project:
@@ -112,7 +112,7 @@ Hyperdrive accepts the combination of these parameters in the common connection
112112
113113
```
114114

115-
Most database providers will provide a connection string you can directly copy-and-paste directly into Hyperdrive.
115+
Most database providers will provide a connection string you can copy-and-paste directly into Hyperdrive.
116116

117117
To create a Hyperdrive connection, run the `wrangler` command, replacing the placeholder values passed to the `--connection-string` flag with the values of your existing database:
118118

@@ -128,7 +128,7 @@ npx wrangler hyperdrive create <YOUR_CONFIG_NAME> --connection-string="postgres:
128128
129129
```
130130

131-
Most database providers will provide a connection string you can directly copy-and-paste directly into Hyperdrive.
131+
Most database providers will provide a connection string you can copy-and-paste directly into Hyperdrive.
132132

133133
To create a Hyperdrive connection, run the `wrangler` command, replacing the placeholder values passed to the `--connection-string` flag with the values of your existing database:
134134

src/content/docs/hyperdrive/reference/supported-databases-and-features.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ sidebar:
77

88
## Database support
99

10-
Details on which database engines and/or specific database providers are supported are detailed in the following table.
10+
The following table shows which database engines and/or specific database providers are supported.
1111

1212
| Database Engine | Supported | Known supported versions | Details |
1313
| --------------- | ------------------------ | ------------------------ | ---------------------------------------------------------------------------------------- |

src/content/docs/workers/databases/connecting-to-databases.mdx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,7 @@ Cloudflare Workers can connect to and query your data in both SQL and NoSQL data
1515

1616
### D1 SQL database
1717

18-
D1 is Cloudflare's own SQL-based, serverless database. It is optimized for global access from Workers, and can
19-
scale out with multiple, smaller (10GB) databases, such as per-user, per-tenant or per-entity databases. Similar to some serverless databases,
20-
D1 pricing is based on query and storage costs.
18+
D1 is Cloudflare's own SQL-based, serverless database. It is optimized for global access from Workers, and can scale out with multiple, smaller (10GB) databases, such as per-user, per-tenant or per-entity databases. Similar to some serverless databases, D1 pricing is based on query and storage costs.
2119

2220
| Database | Library or Driver | Connection Method |
2321
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------- |
@@ -48,6 +46,7 @@ Since a connection must be re-established on every Worker invocation, this adds
4846
### Serverless databases
4947

5048
Serverless databases provide HTTP-based proxies and drivers, also known as serverless drivers. These address the lack of connection reuse between Worker invocation similarly to [Hyperdrive](/hyperdrive/) for traditional SQL databases.
49+
5150
By providing a way to query your database with HTTP, these serverless databases and drivers eliminate several roundtrips needed to establish a secure connection.
5251

5352
| Database | Integration | Library or Driver | Connection Method |
@@ -63,8 +62,7 @@ By providing a way to query your database with HTTP, these serverless databases
6362

6463
:::note[Easier setup with database integrations]
6564

66-
[Database Integrations](/workers/databases/native-integrations/) simplify the authentication for serverless database drivers
67-
by managing credentials on your behalf and includes support for PlanetScale, Neon and Supabase.
65+
[Database Integrations](/workers/databases/native-integrations/) simplify the authentication for serverless database drivers by managing credentials on your behalf and includes support for PlanetScale, Neon and Supabase.
6866

6967
If you do not see an integration listed or have an integration to add, complete and submit the [Cloudflare Developer Platform Integration form](https://forms.gle/iaUqLWE8aezSEhgd6).
7068

src/content/docs/workers/tutorials/mysql/index.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ In this tutorial, you will learn how to create a Cloudflare Workers application
1818

1919
:::note[Note]
2020

21-
We recommend using [Hyperdrive](/hyperdrive/) to connect to your MySQL database. Hyperdrive provides optimal performance
22-
and will ensure secure connectivity between your Worker and your MySQL database.
21+
We recommend using [Hyperdrive](/hyperdrive/) to connect to your MySQL database. Hyperdrive provides optimal performance and will ensure secure connectivity between your Worker and your MySQL database.
2322

2423
When connecting directly to your MySQL database (without Hyperdrive), the MySQL drivers rely on unsupported Node.js APIs to create secure connections, which prevents connections.
2524
:::
@@ -63,7 +62,7 @@ Now, move into the newly created directory:
6362
cd mysql-tutorial
6463
```
6564

66-
### Enable Node.js compatibility
65+
## 2. Enable Node.js compatibility
6766

6867
[Node.js compatibility](/workers/runtime-apis/nodejs/) is required for database drivers, including mysql2, and needs to be configured for your Workers project.
6968

src/content/partials/hyperdrive/create-hyperdrive-config-mysql.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,12 @@ Hyperdrive accepts the combination of these parameters in the common connection
1717
mysql://USERNAME:PASSWORD@HOSTNAME_OR_IP_ADDRESS:PORT/database_name
1818
```
1919

20-
Most database providers will provide a connection string you can directly copy-and-paste directly into Hyperdrive.
20+
Most database providers will provide a connection string you can copy-and-paste directly into Hyperdrive.
2121

22-
To create a Hyperdrive configuration with the [Wrangler CLI](/workers/wrangler/install-and-update/), open your terminal and run the following command. Replace \<NAME_OF_HYPERDRIVE_CONFIG> with a name for your Hyperdrive configuration and paste the connection string provided from your database host, or replace `user`, `password`, `HOSTNAME_OR_IP_ADDRESS`, `port`, and `database_name` placeholders with those specific to your database:
22+
To create a Hyperdrive configuration with the [Wrangler CLI](/workers/wrangler/install-and-update/), open your terminal and run the following command.
23+
24+
- Replace \<NAME_OF_HYPERDRIVE_CONFIG> with a name for your Hyperdrive configuration and paste the connection string provided from your database host, or,
25+
- Replace `user`, `password`, `HOSTNAME_OR_IP_ADDRESS`, `port`, and `database_name` placeholders with those specific to your database:
2326

2427
```sh
2528
npx wrangler hyperdrive create <NAME_OF_HYPERDRIVE_CONFIG> --connection-string="mysql://user:password@HOSTNAME_OR_IP_ADDRESS:PORT/database_name"

0 commit comments

Comments
 (0)