Skip to content

Commit

Permalink
add PDP concepts overview (#5970)
Browse files Browse the repository at this point in the history
* remove top block component

* Optimised images with calibre/image-actions

* add concrete instructions for changing the connection pool size

* refactor platform console concepts

* Update content/300-accelerate/250-connection-pooling.mdx

* better overview of billing

* Update content/500-platform/10-about.mdx

Co-authored-by: Nurul Sundarani <[email protected]>

* Update content/300-accelerate/250-connection-pooling.mdx

Co-authored-by: Nurul Sundarani <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Nurul Sundarani <[email protected]>

* Update content/500-platform/50-support.mdx

Co-authored-by: Nurul Sundarani <[email protected]>

* Update content/300-accelerate/250-connection-pooling.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/300-accelerate/250-connection-pooling.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* incorporate feedback

* Optimised images with calibre/image-actions

* incorporate feedback

* incorporate feedback

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* incorporate feedback

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* incorporate feedback

* incorporate feedback

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Nurul Sundarani <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* update pricing plan to subscription plan

* Update content/500-platform/10-about.mdx

Co-authored-by: Petra Donka <[email protected]>

* Update content/500-platform/10-about.mdx

* incorporate feedback

* incorporate feedback

* incorporate feedback

* incorporate feedback

* update illustration

* update illustration

* Optimised images with calibre/image-actions

* fix build errors

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nurul Sundarani <[email protected]>
Co-authored-by: Petra Donka <[email protected]>
  • Loading branch information
4 people committed May 13, 2024
1 parent 1c628fa commit 6ead326
Show file tree
Hide file tree
Showing 14 changed files with 154 additions and 132 deletions.
22 changes: 10 additions & 12 deletions content/300-accelerate/250-connection-pooling.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ metaTitle: 'Accelerate: Connection Pooling'
metaDescription: "Learn about everything you need to know to use Accelerate's connection pooling."
---

<TopBlock>

A [connection pool](https://en.wikipedia.org/wiki/Connection_pool#:~:text=In%20software%20engineering%2C%20a%20connection,executing%20commands%20on%20a%20database.) is a storage of database connections that can be reused for future requests to the database. When a new connection is requested, it is retrieved from the pool if one is available. Once the connection is no longer needed, it is returned to the pool for reuse.

[Connection pooling](https://www.prisma.io/dataguide/database-tools/connection-pooling) is important as it allows you to reuse existing connections instead of creating new ones, which can be an expensive operation.
Expand All @@ -20,8 +18,6 @@ For more information about connection pooling in Prisma, see the documentation [

</Admonition>

</TopBlock>

### Default connection pool size

By default, Accelerate calculates a default connection pool size using the formula `num_physical_cpus * 2 + 1`.
Expand All @@ -36,21 +32,23 @@ This means that Accelerate will create a maximum of 5 connections to the databas

### Configuring the connection pool size

The connection pool size can be configured to a value other than the default via the _database connection string_.
The connection pool size can be configured via the _database connection string_ in your Platform project (_not_ the Accelerate connection string in your Prisma schema) via the `connection_limit` parameter. For example, set a connection pool size of `10` like this: `postgresql://USER:PASSWORD@HOST:PORT/DATABASE?connection_limit=10`.

![Update database connection string in Accelerate](/img/accelerate/accelerate-update-database-connection-string.png)
If nothing is configured, a default value will be used.

To adjust the connection pool size, you can add the `connection_limit` parameter to the database connection string. The value of `connection_limit` is the maximum number of connections that Accelerate will open against your database.
To change the size of the connection pool:
1. Open the [Console](https://console.prisma.io/).
1. Select the _project_ in which you're using Accelerate. You might need to select a different _workspace_ if you can't see your project.
1. Select the _environment_ where you want to configure Accelerate's connection pool size.
1. Update the connection string by appending the `connection_limit` argument.

![Update database connection string in Accelerate](/img/accelerate/accelerate-update-database-connection-string.png)

For example, here is how you can set a connection pool size of 10:

```env no-copy
postgresql://user:password@localhost:5432/db?connection_limit=10
```

### Configuring the connection pool timeout

The connection pool timeout is the duration, measured in seconds, during which the query engine must process a specific query; failing to do so within this timeframe results in an exception being thrown, and the system proceeds to the next query in the queue.
The connection pool timeout is the duration, measured in seconds, during which the query engine must process a specific query; failing to do so within this time frame results in an exception being thrown, and the system proceeds to the next query in the queue.

Similar to the connection pool size, you may also configure the connection pool timeout via the _database connection string_. To adjust this value, you may add the `pool_timeout` parameter to the database connection string.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ You can learn more about the PostgreSQL's `CREATE PUBLICATION`, supported versio

#### Submit your publication slot

You can submit the publication name in the [Platform console](https://console.prisma.io/), before enabling Prisma Pulse:
You can submit the publication name in the [Console](https://console.prisma.io/), before enabling Prisma Pulse:

1. To view your [publications](https://www.postgresql.org/docs/current/view-pg-publication-tables.html), execute:

```sql
SELECT * FROM pg_publication_tables;
```

2. Then you can submit the desired publication name in the Platform console:
2. Then you can submit the desired publication name in the Console:

![](/img/pulse/replication-slot-submission.png)

Expand Down
4 changes: 2 additions & 2 deletions content/400-pulse/250-database-setup/300-railway.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The template consists of three [services](https://docs.railway.app/reference/ser
2. On the **pulse-starter** service, locate and click the **Configure** button. Within the **Environment variables** section, you'll find an option to include the `PULSE_API_KEY` environment variable. Keep the `PULSE_API_KEY` field blank for the time being. Once you've set up the database and obtained the database URL from the [Prisma Data Platform](https://console.prisma.io/), you can then add the `PULSE_API_KEY` to the **pulse-starter** service. With the empty field for the Pulse API key, click **Save Config**.
3. Click on the **Deploy** button.
3. To set up the database and make it Pulse-ready, complete the steps outlined in the [previous section](#setup-with-template-prisma-pulse-db-only), starting from **step 2.** till **step 8.**, then follow the instructions below.
4. Go to the [Platform Console](https://console.prisma.io/) and select the project in which you want to activate Pulse. If you don't have a project yet, create a new project via the **New project** button.
4. Go to the [Console](https://console.prisma.io/) and select the project in which you want to activate Pulse. If you don't have a project yet, create a new project via the **New project** button.
5. Navigate to the project's environment in which Pulse should be activated. If you just created a new project, the only available environment is the **Production** environment.
6. Click **Enable Pulse** on the environment's page.
7. Paste the `DATABASE_URL` that you acquired before into the **Database connection string** field. Then, finish the process by clicking **Enable Pulse**.
Expand All @@ -78,7 +78,7 @@ The template consists of three [services](https://docs.railway.app/reference/ser
10. Back in the Railway UI, click on the **pulse-starter** service.
> **Note**: You'll likely find that the build failed for the **pulse-starter** service. This is because the Prisma Pulse API key wasn't provided. Do not worry, this is to be expected and not a problem for the next steps.
11. Click on the **Variables** tab.
12. Create your `PULSE_API_KEY` environment variable: Click the **New Variable** button, create the `PULSE_API_KEY` environment variable, and then paste the value of the `PULSE_API_KEY` that you obtained in the Platform Console. Then save the changes by clicking the **Add** button.
12. Create your `PULSE_API_KEY` environment variable: Click the **New Variable** button, create the `PULSE_API_KEY` environment variable, and then paste the value of the `PULSE_API_KEY` that you obtained in the Console. Then save the changes by clicking the **Add** button.
13. With the `PULSE_API_KEY` environment variable in place, you need to rebuild the **pulse-starter** service for the environment variable to take effect:
14. Click on the **Deployments** tab.
15. Click on the three-dots menu on the deployment that failed. Then click **Redeploy**.
Expand Down
2 changes: 1 addition & 1 deletion content/400-pulse/250-database-setup/400-neon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ After enabling logical replication on Neon, follow these steps:
You can also create a publication to subscribe to database events from *specific tables*. To learn more on managing publications refer to [this](/pulse/database-setup/general-database-instructions#manage-your-own-publication-slot) section.
</Admonition>

2. Before enabling Prisma Pulse, make sure to insert the publication name (e.g., `$PUBLICATION_NAME`) in the **Publication name** field in your project environment configuration for Pulse in the [Platform Console](https://pris.ly/pdp):
2. Before enabling Prisma Pulse, make sure to insert the publication name (e.g., `$PUBLICATION_NAME`) in the **Publication name** field in your project environment configuration for Pulse in the [Console](https://pris.ly/pdp):

![](/img/pulse/replication-slot-submission.png)

Expand Down
124 changes: 118 additions & 6 deletions content/500-platform/10-about.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,129 @@
---
title: 'About'
metaTitle: 'Platform Console: About'
metaDescription: 'Learn about the Platform Console to integrate the Prisma Data Platform products.'
metaTitle: 'Console: About'
metaDescription: 'Learn about the Console to integrate the Prisma Data Platform products.'
displayed_sidebar: platformSidebar
---

<TopBlock>
## Overview

Platform Console enables you to integrate the latest Prisma Data Platform products into your application
The [Console](http://console.prisma.io) enables you to manage and configure your projects that use Prisma Data Platform (PDP) products, and helps you integrate them into your application:

- [Accelerate](/accelerate/what-is-accelerate): Global database cache with scalable connection pooling
- [Pulse](/pulse/what-is-pulse): A managed Change Data Capture (CDC) service that enables real-time database subscriptions

[Go to Platform Console](https://console.prisma.io)

</TopBlock>
## Concepts

The Console workflows are based on four main concepts:

- [**User account**](#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**](#workspace): 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**](#project): A project belongs to a workspace. It typically represents the _application_ or _service_ a team is working on.
- [**Environments**](#environment): 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:

![](/img/platform/pdp-concepts.png)

### User account

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](/platform/support#deleting-your-pdp-account).

### 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](https://prisma.io/pricing?utm_source=prisma-docs&utm_medium=docs-site), configure payment methods, or view the invoice history.
- view the usage of your enabled PDP products across all projects in that workspace.
- invite other users to collaborate in the workspace.

### Project

In each workspace, you can create several projects. A project typically represents an application (a product or service). You typically have one [Prisma schema](/orm/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](https://prisma.io/pricing?utm_source=prisma-docs&utm_medium=docs-site) configured in that workspace.

### Environment

An environment is an isolated space to provision PDP products for a given project. Environments typically map to development stages, like `Development`, `Staging` or `Production`. When a new project is created, it will have a _default_ environment called `Production`.

In each environment, you can:

- enable, disable and configure PDP products (Pulse, Accelerate, ...).
- generate API keys.
- for **Accelerate**:
- set your database connection string.
- configure the _region_ where Accelerate's connection pool is running.
- change the connection pool size.
- enable static IP.
- for **Pulse**:
- set your database connection string (of a [Pulse-compatible database](/pulse/database-setup)).
- configure the _region_ where Pulse is running.
- configure database replication.

The number of environments you can create in a project depends on the [subscription plan](https://prisma.io/pricing?utm_source=prisma-docs&utm_medium=docs-site) configured in your workspace.

## Billing

The [subscription plan](https://prisma.io/pricing?utm_source=prisma-docs&utm_medium=docs-site) you select in your workspace determines how many projects and environments you can create in that workspace:

| | **Starter** | **Pro** | **Business** | **Enterprise** |
| ---------------- | :---------- | ----------- | ------------ | -------------- |
| **Projects** | 5 | 10 | 15 | Custom |
| **Environments** | 2 / project | 6 / project | 12 / project | Custom |

### 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:

- 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.
- 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](https://prisma.io/pricing?utm_source=prisma-docs&utm_medium=docs-site) for more details.

### Downgrading a subscription plan

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](#environment) of the newly selected plan.

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.

## Programmatic access via the Platform CLI

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.

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

Read more about the [Prisma CLI](/platform/platform-cli).

## API keys

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

APIs keys are _not_ product-specific, meaning you can use the same API key for both Accelerate and Pulse when used in the same environment.

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


20 changes: 0 additions & 20 deletions content/500-platform/20-concepts/10-workspaces.mdx

This file was deleted.

14 changes: 0 additions & 14 deletions content/500-platform/20-concepts/20-projects.mdx

This file was deleted.

40 changes: 0 additions & 40 deletions content/500-platform/20-concepts/30-environments.mdx

This file was deleted.

15 changes: 0 additions & 15 deletions content/500-platform/20-concepts/index.mdx

This file was deleted.

Loading

0 comments on commit 6ead326

Please sign in to comment.