Skip to main content

Prisma Postgres 概述

Prisma Postgres 是一个托管的 PostgreSQL 数据库服务,可让你轻松创建新数据库,通过 Prisma ORM 与其交互,并构建从小型低成本开始但可扩展到数百万用户的应用。

¥Prisma Postgres is a managed PostgreSQL database service that easily lets you create a new database, interact with it through Prisma ORM, and build applications that start small and cheap but can scale to millions of users.

它支持以下工作流程:

¥It supports the following workflows:

计费

¥Billing

基于使用量的定价

¥Usage-based pricing

Prisma Postgres 收费标准:

¥Prisma Postgres charges for:

  • 操作数

    ¥number of operations

  • 存储空间(以 GiB 为单位)

    ¥storage (in GiB)

每次执行创建、读取、更新或删除操作时,都会计为一次操作,无论底层 SQL 语句的简单或复杂程度如何。无论是单行查找还是复杂的 JOIN 查询,它仍然算作一项操作,且费用相同。阅读我们关于 基于操作的计费 的博客文章了解更多详情。

¥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 for more details.

通过平等对待每项操作,你不必担心写入繁重的工作负载导致账单增加,也不必担心高带宽请求导致成本意外膨胀。你可以使用 将数据库成本与实际产品使用情况和用户行为直接关联,使预测和预算变得简单且可预测。

¥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, making forecasting and budgeting simple and predictable.

了解更多关于我们的 定价页面 的信息。

¥Learn more on our pricing page.

支出限制

¥Spend limits

Prisma Postgres 允许你设置限制,以确保你不会收到意外账单。当你达到设定限制的 75% 时,你会收到警报;如果达到 100%,你的数据库将暂停。这可确保你永远不会收到意外账单,并且你始终可以完全控制你的支出。Pro 及更高版本提供支出限制。请注意,支出限额必须高于所选方案的基本费用。例如,如果你使用的是 Pro 套餐,你的支出限额应超过基础套餐的 49 美元。

¥Prisma Postgres allows you to set limits to ensure you never get a surprise bill. You'll receive alerts when you reach 75% of your set limit, and if you reach 100%, your database will be paused. This ensures you'll never have an unexpected bill, and you can always be in complete control of your spending. Spend limits are available on the Pro plan and higher. Please note that the spend limit must be set higher than the base cost of the selected plan. For example, if you're on the Pro plan, your spend limit should exceed the base plan cost of $49.

更改订阅时重启数据库

¥Restarting your database when changing your subscription

当你的订阅从 Starter 更改为 Pro/Business 或从 Pro/Business 更改为 Start 时,你的数据库实例将被重新启动。这可能会导致约 1 秒的停机时间。

¥When changing your subscription from Starter to Pro/Business or from Pro/Business to Start, your database instance is being restarted. This may cause a downtime of ~1second.

注意

这是临时的。将来,升级或降级计划时不会有任何停机时间。

¥This is temporary. In the future, there won't be any downtime when up- or downgrading a plan.

与 Prisma Accelerate 打包

¥Bundling with Prisma Accelerate

Prisma Postgres 与 Prisma 加速 打包销售。

¥Prisma Postgres comes bundled with Prisma Accelerate.

使用 Prisma Accelerate 的客户端扩展(必需)

¥Using the Client extension for Prisma Accelerate (required)

由于所有到 Prisma Postgres 的流量都通过 Accelerate 的连接池路由,因此你的项目必须安装 @prisma/extension-accelerate npm 包。然后,需要将扩展​​应用于你用于与数据库交互的 PrismaClient 实例:

¥Because all traffic to Prisma Postgres is routed through Accelerate's connection pool, your project must have the @prisma/extension-accelerate npm package installed. The extension then needs to be applied to the PrismaClient instance you use to interact with your database:

import { PrismaClient } from '@prisma/client'
import { withAccelerate } from '@prisma/extension-accelerate'

const prisma = new PrismaClient()
.$extends(withAccelerate())

技术细节

¥Technical details

PostgreSQL 版本

¥PostgreSQL version

Prisma Postgres 基于 PostgreSQL v17。

¥Prisma Postgres is based PostgreSQL v17.

架构

¥Architecture

Prisma Postgres 采用独特的架构,提供无与伦比的效率、安全性和易用性。它部署在使用单核内核(例如:"超专业操作系统")的裸机服务器上。

¥Prisma Postgres uses a unique architecture to deliver unmatched efficiency, safety and ease of use. It is deployed on bare metal servers using unikernels (think: "hyper-specialized operating systems").

阅读本文了解更多关于架构的信息:Prisma Postgres®:使用 Unikernels 和 MicroVM 构建现代 PostgreSQL 服务

¥Learn more about the architecture in this article: Prisma Postgres®: Building a Modern PostgreSQL Service Using Unikernels & MicroVMs.