Skip to main content

一般的

概述

¥Overview

使你能够管理和配置使用 Prisma 数据平台 (PDP) 产品的项目,并帮助你将其集成到你的应用中:

¥The enables you to manage and configure your projects that use Prisma Data Platform (PDP) products, and helps you integrate them into your application:

  • 加速:使用具有可扩展连接池的全局数据库缓存来加速查询。

    ¥Accelerate: Speeds up your queries with a global database cache with scalable connection pooling.

  • 优化:提供可帮助你加快数据库查询速度的建议。

    ¥Optimize: Provides you recommendations that can help you make your database queries faster.

  • Prisma Postgres:针对 Prisma ORM 优化的托管 PostgreSQL 数据库。

    ¥Prisma Postgres: A managed PostgreSQL database that is optimized for Prisma ORM.

概念

¥Concepts

控制台工作流基于四个主要概念:

¥The Console workflows are based on four main concepts:

  • 用户账户:为了使用 PDP 产品,你需要拥有一个 PDP 用户账户。用户通常会创建一个用户账户来管理其所有工作区、项目和环境。用户还可以受邀加入其他工作区,以便在该工作区中协作处理项目。

    ¥User account: In order to use PDP products, you need to have a PDP user account. A user will typically create one user account to manage all their workspaces, projects and environments. The user can also be invited to join other workspaces to collaborate on the projects in that workspace.

  • 工作区:一个用户账户可以属于多个工作区。一个工作区通常代表一个由多个个人组成的团队共同处理一个或多个项目。计费基于工作区级别,即月底工作区的发票包含与给定工作区中的项目相关的所有费用。

    ¥Workspaces: A user account can belong to multiple workspaces. A workspace typically represents a team of individuals working together on one or more projects. Billing is on a workspace level, i.e. the invoice for a workspace at the end of the month captures all costs associated with the projects in a given workspace.

  • 项目:一个项目属于一个工作区。它通常表示团队正在开发的应用或服务。

    ¥Projects: A project belongs to a workspace. It typically represents the application or service a team is working on.

  • 环境:一个环境属于一个项目。它通常映射到开发阶段,例如 DevelopmentStagingProduction。API 密钥在环境级别配置,产品也按环境进行配置(例如,Accelerate 使用的数据库连接字符串)。

    ¥Environments: An environment belongs to a project. It typically maps to a development stage, like Development, Staging or Production. API keys are provisioned on the environment level, and products are configured per environment as well (e.g. the database connection string used for Accelerate).

以下是这些概念之间关系的直观说明:

¥Here is a visual illustration of how these concepts relate to each other:

How the concepts of the Platform (user account, workspaces, projects, and environments) relate to each other

用户账户

¥User account

用户账户是与 PDP 产品进行任何交互的先决条件。你可以使用它来管理你的工作区(及其项目)。用户账户也可以受邀协作处理其他用户创建的工作区。

¥A user account is the prerequisite for any interactions with PDP products. You can use it to manage your workspaces (and their projects). A user account can be invited to collaborate on workspaces created by other users as well.

如果你需要删除用户账户,请转到 此处

¥If you need to delete your user account, go here.

工作区

¥Workspace

你可以创建多个工作区。工作区是用于托管项目的独立空间。一个工作区可以关联多个用户账户,以便多个用户可以协作处理工作区中的项目。

¥You can create several workspaces. A workspace is an isolated space to host projects. A workspace can have multiple user accounts associated with it so that multiple users can collaborate on the the projects in the workspace.

在每个工作区中,你可以:

¥In each workspace, you can:

  • 查看和管理该工作区中的所有项目(及其环境)。

    ¥view and manage all projects (and their environments) in that workspace.

  • 管理账单,例如选择 订阅计划、配置付款方式或查看发票历史记录。

    ¥manage billing, i.e. select a subscription plan, configure payment methods, or view the invoice history.

  • 查看你已启用的 PDP 产品在该工作区中所有项目的使用情况。

    ¥view the usage of your enabled PDP products across all projects in that workspace.

  • 邀请其他用户在工作区中协作。

    ¥invite other users to collaborate in the workspace.

  • 访问 以衡量查询性能并接收 AI 支持的建议。

    ¥access the to measure query performance and receive AI-powered recommendations.

优化

¥Optimize

你可以在 工作区中访问 Optimize。

¥You can access Optimize within your workspace.

访问 Optimize 仪表板

¥Accessing the Optimize dashboard

要在所需工作区中访问 Optimize 仪表板:

¥To access the Optimize dashboard in your desired workspace:

  1. 点击左侧导航栏中的“优化”选项卡。

    ¥Click the Optimize tab on the left navigation.

  2. 点击“生成 API 密钥”按钮。

    ¥Click the Generate API key button.

生成 Optimize API 密钥

¥Generating an Optimize API key

要获取 Optimize API 密钥:

¥To obtain the Optimize API key:

  1. 进入你想要使用 Optimize 的工作区。

    ¥Navigate to the workspace where you want to use Optimize.

  2. 确保 Optimize 已启动。如果没有找到,请点击“生成 API 密钥”按钮。

    ¥Ensure that Optimize is launched. If it isn't, click the Generate API key button.

  3. 在 Optimize 中,点击导航栏右上角的个人资料名称。

    ¥In Optimize, click your profile name in the top right corner of the navbar.

  4. 选择设置。

    ¥Select Settings.

  5. 点击“创建 API 密钥”。

    ¥Click Create API key.

  6. 在“名称”字段中输入 API 密钥的名称,然后点击“创建”。

    ¥Enter a name for the API key in the Name field, then click Create.

  7. 复制 API 密钥并安全存储。这将通过 "OPTIMIZE_API_KEY" 在你项目的 .env 文件 中使用。最后,点击 "我已将其安全存储" 按钮。

    ¥Copy the API key and store it securely. This will be used in your project's .env file via the "OPTIMIZE_API_KEY". Finally, click the "I've stored it securely" button.

你现在拥有了 Optimize API 密钥。

¥You now have your Optimize API key.

项目

¥Project

在每个工作区中,你可以创建多个项目。一个项目通常代表一个应用(产品或服务)。通常每个项目都有一个 Prisma 架构

¥In each workspace, you can create several projects. A project typically represents an application (a product or service). You typically have one Prisma schema per project.

在每个项目中,你可以:

¥In each project, you can:

  • 查看和管理该项目中的所有环境。

    ¥view and manage all environments in that project.

你可以在工作区中创建的项目数量取决于该工作区中配置的 订阅计划

¥The number of project you can create in a workspace depends on the subscription plan configured in that workspace.

环境

¥Environment

环境是一个独立的空间,用于为特定项目配置 PDP 产品。环境通常对应于开发阶段,例如 DevelopmentStagingProduction。每个新项目都以名为 Production 的默认环境开始。默认环境确保项目始终至少有一个活动环境。除非将另一个环境指定为默认环境,否则无法删除它。

¥An environment is an isolated space used to provision PDP products for a specific project. Environments typically correspond to development stages, such as Development, Staging, or Production. Every new project begins with a default environment named Production. The default environment ensures that the project always has at least one active environment. It cannot be deleted unless another environment is designated as the default.

在每个环境中,你可以:

¥In each environment, you can:

  • 启用、禁用和配置 PDP 产品(优化、加速等)。

    ¥enable, disable and configure PDP products (Optimize, Accelerate, ...).

  • 生成 API 密钥。

    ¥generate API keys.

  • 对于 Accelerate:

    ¥for Accelerate:

    • 设置数据库连接字符串。

      ¥set your database connection string.

    • 配置 Accelerate 连接池运行的区域。

      ¥configure the region where Accelerate's connection pool is running.

    • 更改连接池大小。

      ¥change the connection pool size.

    • 配置查询时长和查询响应大小限制。

      ¥configure query duration and query response size limits.

    • 启用静态 IP。

      ¥enable static IP.

你可以在项目中创建的环境数量取决于你工作区中配置的 订阅计划

¥The number of environments you can create in a project depends on the subscription plan configured in your workspace.

数据库连接管理

¥Database connection management

项目环境左侧面板中的“数据库”选项卡允许你配置和管理与远程数据库的连接。在此选项卡中,“连接”部分显示一个包含以下列的表格:

¥The Database tab in the left panel of a project environment lets you configure and manage connections to your remote database. Within this tab, the Connections section displays a table with the following columns:

列名描述
提示提供正在使用的数据库的 URL 结构。
静态 IP指示数据库和相关产品是否启用了静态 IP。
产品列出使用数据库 URL 启用的产品。
行动允许你禁用所有活动产品并移除连接。

计费

¥Billing

你在工作区中选择的 订阅计划 决定了你可以在该工作区中创建的项目和环境数量:

¥The subscription plan you select in your workspace determines how many projects and environments you can create in that workspace:

入门专业版商业企业
项目560180自定义
环境2 / 项目6 / 项目12 / 项目自定义
数据库1060180自定义

按工作区计费

¥Per-workspace billing

计费基于每个工作区设置:

¥Billing is set up on a per-workspace basis:

  • 每个工作区选择一个订阅方案。这意味着,一个用户账户可以属于多个工作区,每个工作区使用不同的计划。

    ¥A subscription plan is selected per workspace. That means, a user account can belong to multiple workspaces where each workspace uses a different plan.

  • 每个工作区都会选择一个付款方式。这意味着,一个用户账户可以属于多个工作区,每个工作区都有不同的付款方式。

    ¥A payment method is selected per workspace. That means, a user account can belong to multiple workspaces where each workspace has a different payment method.

在结算期结束时,你选择的付款方式将被收取该工作区中所有项目(及其环境)产生的产品费用。

¥At the end of a billing period, your selected payment method will be charged with the incurred costs of products across all projects (and their environments) in that workspace.

你可以在工作区的“账单”部分配置所有账单详情。

¥You can configure all billing details in the Billing section of your workspace.

按比例计费

¥Prorated billing

所有基础套餐价格均按比例计算,这意味着你只需在特定套餐的订阅期内付费。此外,你还需要支付订阅期间产生的任何使用费用。

¥All base plan prices are prorated, which means you're only billed for the duration of your subscription to a specific plan. In addition, you're also billed for any usage costs you've incurred during your subscription.

例如:

¥For example:

  • 如果你在某个月的 15 日订阅我们的 Pro 计划,你将仅被收取该月剩余天数的基本计划价格。

    ¥if you subscribe to our Pro plan on the 15th day of a month, you'll only be charged the base plan price for the days left in that month.

  • 如果你在 30 天月份的 10 天后降级订阅计划(例如,从 Business 降级为 Pro),你将被收取 10 天 Business 计划基本价格和 20 天 Pro 计划基本价格。

    ¥if you downgrade your subscription plan (e.g. from Business to Pro) after 10 days of a 30-day month, you'll be charged for 10 days of the base price of the Business plan and 20 days for the base price of the Pro plan.

访问我们的 定价页面 了解更多详情。

¥Visit our pricing page for more details.

降级订阅方案

¥Downgrading a subscription plan

如果你降级订阅计划,你可能需要删除部分项目和/或其环境,以符合新选择计划的 limits

¥If you downgrade a subscription plan, you may need to delete some of your projects and/or their environments in order to adhere to the limits of the newly selected plan.

例如,如果你的工作区采用的是商业版,并且当前有 14 个项目(共 15 个),你需要删除至少 4 个项目才能达到专业版的项目数量限制。此外,你需要确保其余项目的每个项目的环境数量不超过 6 个,以符合 Pro 计划的环境数量限制。

¥For example, if your workspace is on a Business plan and currently has 14 (out of 15) projects, you will need to delete at least 4 projects to adhere to the project limit of the Pro plan. Additionally, you need to make sure that the remaining projects don't have more than 6 environments per project to adhere to the environment limit of the Pro plan.

你还需要禁用专业版或商业版独有的功能,例如静态 IP。完成这些调整后,包括禁用静态 IP,你可以继续降级订阅计划。

¥You also need to disable features that are exclusive to Pro or Business plans, such as Static IPs. Once these adjustments are made, including disabling Static IPs, you can proceed to downgrade your subscription plan.

通过平台 CLI 进行编程访问

¥Programmatic access via the Platform CLI

除了控制台的 Web 界面外,Prisma CLI 还提供了另一种与你的 PDP 账户交互和管理 PDP 产品的方式。

¥In addition to the web interface of the Console, the Prisma CLI provides another way to interact with your PDP account and manage PDP products.

如果你需要通过编程访问(例如,将其集成到 CI 工作流中),这可能很有用。

¥This can be useful if you need programmatic access, e.g. for integrating it into CI workflows.

了解更多关于 Prisma CLI 的信息。

¥Read more about the Prisma CLI.

API 密钥

¥API keys

需要 API 密钥来验证从 Prisma 客户端到 Prisma Accelerate 和 Prisma Optimize 等产品的请求。

¥An API key is required to authenticate requests from your Prisma Client to products such as Prisma Accelerate and Prisma Optimize.

你可以为每个环境生成多个 API 密钥,并通过环境中的“API 密钥”部分管理这些密钥。

¥You may generate multiple API keys per environment and manage those via the API Keys section in an environment.