RealComposer
Edge Runtime & DataOfficial Neon Postgres docs

Neon Postgres Safe & Unsafe Practices

Direct Answer

Neon connection strings contain credentials and are server-only. Use pooled connection URLs or the serverless driver from edge and serverless code, give each application a least-privilege role, and use branches to keep development off production data.

Credentials & Where They Belong

Server only
DATABASE_URL connection string

Includes role name and password.

Server only
Neon API key

Manages projects, branches, and roles.

Safe Practices

  • Use pooled connections from serverless runtimes

    The -pooler hostname or HTTP driver avoids exhausting connections under bursty traffic.

  • Create least-privilege roles per service

    Grant only the schema and table permissions each app needs.

  • Develop on branches

    Branches isolate schema changes and tests from production data.

Unsafe Practices

  • Exposing the connection string to clients

    Anyone with it can connect directly with that role permissions.

  • Using the owner role for application traffic

    A SQL injection then grants full control of the database.

The RealComposer Pattern

RealComposer stores pipeline configs and encrypted vault entries in Neon, connecting from Workers with server-only credentials and parameterized queries.

START BUILDING FREE

Frequently Asked Questions

Q:Should I use the pooled Neon URL from Workers?

Yes for most serverless traffic, or use the Neon serverless driver over HTTP for one-shot queries.

Related Concepts