Skip to content

Commit ce7ad18

Browse files
authored
add notes about tcp billing (#6957)
1 parent c957e46 commit ce7ad18

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

content/250-postgres/100-introduction/250-overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Prisma Postgres charges for:
2222
- number of operations
2323
- storage (in GiB)
2424

25-
An _operation_ is counted each time you perform a create, read, update, or delete, regardless of how simple or complex the underlying SQL is. Whether it's a single-row lookup or complex JOIN query, it still counts as one operation and costs the same. Read our blog post on [operations based billing](https://www.prisma.io/blog/operations-based-billing?utm_source=docs) for more details.
25+
An _operation_ is counted each time you perform a create, read, update, or delete, regardless of how simple or complex the underlying SQL is. Whether it's a single-row lookup or complex JOIN query, it still counts as one operation and costs the same. Read our blog post on [operations-based billing](https://www.prisma.io/blog/operations-based-billing?utm_source=docs) for more details.
2626

2727
By treating every operation equally, you don't have to worry about write-heavy workloads driving up your bill or high-bandwidth requests ballooning costs unexpectedly. You can [directly correlate your database costs to real product usage and user behavior](/postgres/more/faq#is-there-a-sample-workload-to-estimate-my-expected-charges), making forecasting and budgeting simple and predictable.
2828

content/250-postgres/1200-more/1000-faq.mdx

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@ Yes, you can use Prisma Postgres with any database library or tool via a [direct
2020

2121
If you previously signed up using GitHub and want to switch to email and password login, follow these steps:
2222

23-
#### 1. Verify Your GitHub Email Address
24-
- Check the primary email address associated with your GitHub account (e.g., from your GitHub profile or notification settings).
25-
26-
#### 2. Create a New Email/Password Account
27-
- Go to the email/password sign-up page.
28-
- Use the **same email address** linked to your GitHub account to create the new account.
29-
- Our system will automatically connect your new email/password account to your existing data.
30-
31-
#### 3. Test Your Login
32-
- Log out and try logging in with your email and the password you just created.
23+
1. Verify Your GitHub Email Address
24+
- Check the primary email address associated with your GitHub account (e.g., from your GitHub profile or notification settings).
25+
2. Create a New Email/Password Account
26+
- Go to the email/password sign-up page.
27+
- Use the _same email address_ linked to your GitHub account to create the new account.
28+
- Our system will automatically connect your new email/password account to your existing data.
29+
3. Test Your Login
30+
- Log out and try logging in with your email and the password you just created.
3331

3432
:::note
3533

@@ -50,21 +48,37 @@ VS Code should now recognize the `$extends` method.
5048

5149
## Pricing
5250

53-
Prisma Postgres bills based on operations and storage consumed. Visit the [pricing page](https://www.prisma.io/pricing) for details and our [blog post explaining operations-based billing](https://www.prisma.io/blog/operations-based-billing) for a detailed explanation on what an operation is and how this pricing model works.
51+
Prisma Postgres bills based on _operations_ and _storage_ consumed. Visit the [pricing page](https://www.prisma.io/pricing) for details and our [blog post explaining operations-based billing](https://www.prisma.io/blog/operations-based-billing) for a detailed explanation on what an operation is and how this pricing model works.
52+
53+
### What is an operation?
54+
55+
An operation is counted each time you interact with your database. Read, write, simple or complex. It all simply counts as one.
56+
57+
An operation can be:
58+
- a Prisma ORM query (when using Prisma ORM)
59+
- a SQL query (when using a [direct TCP connection](/postgres/database/direct-connections))
5460

5561
### Does query execution time affect pricing in Prisma Postgres?
5662

57-
No, cost for Prisma Postgres is based solely on the _number of operations_ (i.e. Prisma ORM queries), not the amount of compute required to execute them.
63+
No, cost for Prisma Postgres is based solely on the _number of operations_, not the amount of compute required to execute them.
5864

5965
Whether a query takes 10ms or 10sec to execute, its pricing impact remains the same.
6066

67+
### How does pricing differ between using Prisma ORM and direct TCP connections?
68+
69+
The fundamental principle of operations-based pricing remains the same for Prisma ORM and [direct TCP connection](/postgres/database/direct-connections). However, depending on whether you use Prisma ORM or direct SQL to interact with your database, an operation is something different:
70+
- when using Prisma ORM: a query sent with Prisma Client (e.g. `prisma.user.findMany()`)
71+
- when using another tool: a SQL query sent via the direct connection (e.g. `SELECT * from "User"`)
72+
73+
Note that a single Prisma ORM query may translate into multiple SQL queries which may make using Prisma ORM more economical than direct SQL.
74+
6175
### Do read and write queries cost the same?
6276

6377
Yes, read and write queries are counted equally as _operations_ and are billed the same way.
6478

6579
### Does a `SELECT 1` query count as a billable operation?
6680

67-
Yes, if submitted via Prisma ORM, a query like `SELECT 1` counts as an operation and will be billed accordingly (even if no actual data is accessed in the query).
81+
Yes, a query like `SELECT 1` counts as an operation and will be billed accordingly (even if no actual data is accessed in the query).
6882

6983
### How can I estimate the number of operations in Prisma ORM?
7084

content/250-postgres/300-database/650-direct-connections.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ DATABASE_URL="postgres://2f9881cc7eef46f094ac913df34c1fb441502fe66cbe28cc48998d4
4444

4545
SSL mode is required when connecting to Prisma Postgres via direct TCP, so you need to append `sslmode=require` to your TCP connection string.
4646

47+
## Billing
48+
49+
When using direct TCP to connect to a Prisma Postgres instance, every SQL query is counted as a [billable operation](/postgres/introduction/overview#usage-based-pricing). Learn more on our [pricing page](https://www.prisma.io/pricing).
50+
4751
## Temporary limitations
4852

4953
### Closing idle connections

0 commit comments

Comments
 (0)