You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/connection-pooling.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,15 +8,15 @@ description: Scale your serverless functions
8
8
>
9
9
> There's more to document here. In the meantime, you can check our [community forum](https://community.redwoodjs.com/search?q=connection%20pooling) for answers.
10
10
>
11
-
> Want to contribute? Redwood welcomes contributions and loves helping people become contributors.
11
+
> Want to contribute? CedarJS welcomes contributions and loves helping people become contributors.
12
12
> You can edit this doc [here](https://github.com/cedarjs/cedarjs.com/blob/main/docs/connectionPooling.md).
13
-
> If you have any questions, just ask for help! We're active on the [forums](https://community.redwoodjs.com/c/contributing/9) and on [discord](https://discord.com/channels/679514959968993311/747258086569541703).
13
+
> If you have any questions, just ask for help! We're active on our [discord](https://cedarjs.com/discord).
14
14
15
-
Production Redwood apps should enable connection pooling in order to properly scale with your Serverless functions.
15
+
Production Cedar apps should enable connection pooling in order to properly scale with your Serverless functions.
16
16
17
17
## Prisma Postgres
18
18
19
-
[Prisma Postgres](https://www.prisma.io/docs/postgres/introduction/overview?utm_source=redwoodjs_docs&utm_medium=docs) is a managed PostgreSQL database service that includes:
19
+
[Prisma Postgres](https://www.prisma.io/docs/postgres/introduction/overview?utm_source=cedarjs_docs&utm_medium=docs) is a managed PostgreSQL database service that includes:
20
20
21
21
-**Built-in connection pooling**: No need to configure external pooling services
22
22
-**Global caching**: Query-level caching with TTL and Stale-While-Revalidate strategies
@@ -25,11 +25,11 @@ Production Redwood apps should enable connection pooling in order to properly sc
25
25
26
26
Prisma Postgres supports schema migrations and queries via Prisma ORM, and automatically handles connection pooling and caching.
27
27
28
-
To get started with Prisma Postgres, visit the [Prisma Postgres documentation](https://www.prisma.io/docs/postgres/introduction/overview?utm_source=redwoodjs_docs&utm_medium=docs).
28
+
To get started with Prisma Postgres, visit the [Prisma Postgres documentation](https://www.prisma.io/docs/postgres/introduction/overview?utm_source=cedarjs_docs&utm_medium=docs).
29
29
30
30
### Local Prisma Postgres
31
31
32
-
For local development, you can use [local Prisma Postgres](https://www.prisma.io/docs/postgres/database/local-development?utm_source=redwoodjs_docs&utm_medium=docs) which runs a PostgreSQL-compatible database locally. This eliminates the need to install and manage PostgreSQL locally while maintaining full compatibility with production PostgreSQL databases.
32
+
For local development, you can use [local Prisma Postgres](https://www.prisma.io/docs/postgres/database/local-development?utm_source=cedarjs_docs&utm_medium=docs) which runs a PostgreSQL-compatible database locally. This eliminates the need to install and manage PostgreSQL locally while maintaining full compatibility with production PostgreSQL databases.
33
33
34
34
:::note
35
35
@@ -64,7 +64,7 @@ Keep the server running while performing migrations and using the database for l
64
64
65
65
### Temporary Prisma Postgres database
66
66
67
-
For quick testing or prototyping, [Prisma Postgres](https://www.prisma.io/postgres) offers temporary production-ready databases that also requires no setup or accounts. Use [`npx create-db`](https://www.prisma.io/docs/postgres/introduction/npx-create-db?utm_source=redwoodjs_docs&utm_medium=docs) to create a database that's automatically deleted after 24 hours:
67
+
For quick testing or prototyping, [Prisma Postgres](https://www.prisma.io/postgres) offers temporary production-ready databases that also requires no setup or accounts. Use [`npx create-db`](https://www.prisma.io/docs/postgres/introduction/npx-create-db?utm_source=cedarjs_docs&utm_medium=docs) to create a database that's automatically deleted after 24 hours:
Copy file name to clipboardExpand all lines: docs/versioned_docs/version-0.11/connection-pooling.md
+71-7Lines changed: 71 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,19 +8,83 @@ description: Scale your serverless functions
8
8
>
9
9
> There's more to document here. In the meantime, you can check our [community forum](https://community.redwoodjs.com/search?q=connection%20pooling) for answers.
10
10
>
11
-
> Want to contribute? Redwood welcomes contributions and loves helping people become contributors.
11
+
> Want to contribute? CedarJS welcomes contributions and loves helping people become contributors.
12
12
> You can edit this doc [here](https://github.com/cedarjs/cedarjs.com/blob/main/docs/connectionPooling.md).
13
-
> If you have any questions, just ask for help! We're active on the [forums](https://community.redwoodjs.com/c/contributing/9) and on [discord](https://discord.com/channels/679514959968993311/747258086569541703).
13
+
> If you have any questions, just ask for help! We're active on our [discord](https://cedarjs.com/discord).
14
14
15
-
Production Redwood apps should enable connection pooling in order to properly scale with your Serverless functions.
15
+
Production Cedar apps should enable connection pooling in order to properly scale with your Serverless functions.
16
16
17
-
## Prisma Data Proxy
17
+
## Prisma Postgres
18
18
19
-
The [Prisma Data Proxy](https://www.prisma.io/docs/data-platform/data-proxy) provides database connection management and pooling for Redwood apps using Prisma. It supports MySQL and Postgres databases in either the U.S. or EU regions.
19
+
[Prisma Postgres](https://www.prisma.io/docs/postgres/introduction/overview?utm_source=cedarjs_docs&utm_medium=docs) is a managed PostgreSQL database service that includes:
20
20
21
-
To set up a Prisma Data Proxy, sign up for the [Prisma Data Platform](https://www.prisma.io/data-platform) for free. In your onboarding workflow, plug in the connection URL for your database and choose your region. This will generate a connection string for your app. Then follow the instructions in [Prisma's documentation](https://www.prisma.io/docs/concepts/data-platform/data-proxy).
21
+
-**Built-in connection pooling**: No need to configure external pooling services
22
+
-**Global caching**: Query-level caching with TTL and Stale-While-Revalidate strategies
23
+
-**Serverless optimization**: Designed specifically for serverless and edge applications
24
+
-**Easy setup**: Get started in minutes with minimal configuration
22
25
23
-
> Note that the example uses npm. Rather than using npm, you can access the Prisma CLI using `yarn redwood prisma` inside a Redwood app.
26
+
Prisma Postgres supports schema migrations and queries via Prisma ORM, and automatically handles connection pooling and caching.
27
+
28
+
To get started with Prisma Postgres, visit the [Prisma Postgres documentation](https://www.prisma.io/docs/postgres/introduction/overview?utm_source=cedarjs_docs&utm_medium=docs).
29
+
30
+
### Local Prisma Postgres
31
+
32
+
For local development, you can use [local Prisma Postgres](https://www.prisma.io/docs/postgres/database/local-development?utm_source=cedarjs_docs&utm_medium=docs) which runs a PostgreSQL-compatible database locally. This eliminates the need to install and manage PostgreSQL locally while maintaining full compatibility with production PostgreSQL databases.
33
+
34
+
:::note
35
+
36
+
To use Local Prisma Postgres, you do not need to create an account or install PostgreSQL locally.
37
+
38
+
:::
39
+
40
+
First, update your Prisma schema to use PostgreSQL as the provider:
41
+
42
+
```graphql title="api/db/schema.prisma"
43
+
datasourcedb {
44
+
provider = "postgresql"
45
+
url = env("DATABASE_URL")
46
+
}
47
+
```
48
+
49
+
Start the local Prisma Postgres server:
50
+
51
+
```bash
52
+
npx prisma dev
53
+
```
54
+
55
+
The server will start and display connection options. Press `t` to get the TCP connection URL for standard PostgreSQL connections, or press `h` if you're planning to use Prisma Postgres in production (which requires the [Prisma Client extension](https://www.prisma.io/docs/postgres/introduction/overview#using-the-client-extension-for-prisma-accelerate-required)).
56
+
57
+
If you're using any other provider for PostgreSQL, use the TCP connection URL in your `.env` file:
58
+
59
+
```env
60
+
DATABASE_URL="postgresql://localhost:54322/main"
61
+
```
62
+
63
+
Keep the server running while performing migrations and using the database for local development.
64
+
65
+
### Temporary Prisma Postgres database
66
+
67
+
For quick testing or prototyping, [Prisma Postgres](https://www.prisma.io/postgres) offers temporary production-ready databases that also requires no setup or accounts. Use [`npx create-db`](https://www.prisma.io/docs/postgres/introduction/npx-create-db?utm_source=cedarjs_docs&utm_medium=docs) to create a database that's automatically deleted after 24 hours:
68
+
69
+
```bash
70
+
npx create-db@latest
71
+
```
72
+
73
+
This provides both Prisma ORM-optimized and standard PostgreSQL connection strings. You can also claim the database to make it permanent if needed.
74
+
75
+
## Prisma ORM & Prisma Accelerate
76
+
77
+
If you're already using another database provider (like Supabase, Heroku, Digital Ocean, or AWS RDS), you can add connection pooling and caching to your existing setup using [Prisma Accelerate](https://www.prisma.io/docs/accelerate).
78
+
79
+
Prisma Accelerate is a fully managed global connection pool and caching layer that works with your existing database. It provides:
80
+
81
+
-**Connection pooling**: Efficiently manages database connections across 15+ global regions
82
+
-**Global caching**: Hosted in 300+ locations for fast user experiences
83
+
-**Query-level caching**: Configure caching strategies directly in your Prisma ORM code
84
+
-**Serverless scaling**: Handles traffic spikes without infrastructure concerns
85
+
-**Database compatibility**: Works with publicly accessible databases or those behind IP allowlists
86
+
87
+
To enable Prisma Accelerate with your existing database, visit the [Prisma Accelerate documentation](https://www.prisma.io/docs/accelerate).
0 commit comments