Skip to content

Commit

Permalink
apply feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ruheni committed Nov 3, 2023
1 parent 64b0f26 commit 878bc60
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions content/300-guides/050-database/890-neon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,40 @@ toc: true

<TopBlock>

This guide explains how to connect Prisma using Neon's connection pooling feature, and resolve [connection timeout](#connection-timeouts) issues.
This guide explains how to:

- Connect Prisma using Neon's connection pooling feature
- Resolve connection timeout issues
- Use Neon's serverless driver with Prisma

</TopBlock>

## What is Neon?

<img
src="https://avatars.githubusercontent.com/u/77690634?s=200&v=4"
style="margin:auto; width: 25%; padding-left: 20px; float:right; "
alt="Turso's logo"
/>

[Neon](https://neon.tech/) is a fully managed serverless PostgreSQL with a generous free tier. Neon separates storage and compute, and offers modern developer features such as serverless, branching, bottomless storage, and more. Neon is open source and written in Rust.

Learn more about Neon [here](https://neon.tech/docs).

## Commonalities with other database providers

Many aspects of using Prisma with Neon are just like using Prisma with any other relational database. You can still:
Many aspects of using Prisma with Neon are just like using Prisma with any other PostgreSQL database. You can:

- model your database with the [Prisma Schema Language](/concepts/components/prisma-schema)
- use Prisma's existing [`postgresql` database connector](/concepts/database-connectors/postgresql) in your schema, along with the [connection string Neon provides you](https://neon.tech/docs/connect/connect-from-any-app)
- use Prisma's [`postgresql` database connector](/concepts/database-connectors/postgresql) in your schema, along with the [connection string Neon provides you](https://neon.tech/docs/connect/connect-from-any-app)
- use [Introspection](/concepts/components/introspection) for existing projects if you already have a database schema on Neon
- use [`prisma migrate dev`](/concepts/components/prisma-migrate/migrate-development-productoin) to track schema migrations in your Neon database
- use [`prisma db push`](/concepts/components/prisma-migrate/db-push) to push changes in your schema to Neon
- use [Prisma Client](/concepts/components/prisma-client) in your application to communicate with the database hosted by Neon

## Differences to consider

While Neon is 100% compatible with PostgreSQL, there are a few differences you should be aware of the following when deciding to use Neon with Prisma:
There are a few differences between Neon and PostgreSQL you should be aware of the following when deciding to use Neon with Prisma:

- **Neon's serverless model** — By default, Neon scales a [compute](https://neon.tech/docs/introduction/compute-lifecycle) to zero after 5 minutes of inactivity. During this state, a compute instance is in _idle_ state. A characteristic of this feature is the concept of a "cold start". Activating a compute from an idle state takes from 500ms to a few seconds. Depending on how long it takes to connect to your database, your application may timeout. To learn more, see: [Connection latency and timeouts](https://neon.tech/docs/guides/prisma#connection-timeouts).
- **Neon's connection pooler** — Neon offers connection pooling using PgBouncer, enabling up to 10,000 concurrent connections. To learn more, see: [Connection pooling](https://neon.tech/docs/connect/connection-pooling).
Expand Down

0 comments on commit 878bc60

Please sign in to comment.