> ## Documentation Index
> Fetch the complete documentation index at: https://a5eb32f-docs-2.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://a5eb32f-docs-2.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://a5eb32f-docs-2.manicule.dev/api/mcp.
> Every agent surface: https://a5eb32f-docs-2.manicule.dev/.well-known/llms-manifest.json

# Choose a Database for Your Project (/databases/overview)

<!-- agent-signals: reading_time_min: 2 · est_tokens: 760 · updated: 2026-11-25 -->
Related: [Connect a Worker to Cloudflare D1](/databases/cloudflare-d1.md), [Connect Your App to Neon Postgres](/databases/neon-postgres.md), [Connect Your App to Supabase](/databases/supabase-postgres.md), [Review and Apply Database Migrations](/databases/migrations.md), [Troubleshooting](/deployments/troubleshooting.md)

> Compare Cloudflare D1, Neon Postgres, and Supabase, and see what you need to connect each one to your project.

Use a database when your app needs to keep records beyond a browser preview. Start with the SQL engine and services your app needs, then configure its database connection. A database entry in Cloud Studio records your provider choice, but it doesn't create an instance with that provider.

## Compare database engines

| Engine                                    | Choose it when you need                                                                     | Client and schema tools                            |
| ----------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------- |
| [Cloudflare D1](/databases/cloudflare-d1) | SQLite at the edge for a lightweight app, a content site, or a read-heavy workload          | Drizzle ORM                                        |
| [Neon Postgres](/databases/neon-postgres) | Serverless PostgreSQL with relational schemas, branches for testing changes, or autoscaling | Drizzle ORM, Prisma, or `@neondatabase/serverless` |
| [Supabase](/databases/supabase-postgres)  | PostgreSQL alongside user authentication, file storage buckets, or realtime subscriptions   | `@supabase/supabase-js` or Drizzle ORM             |

Check where your queries will run before you settle on an engine. A Worker reads D1 through a database binding. A Neon client uses a Postgres connection string. If you use Supabase's app services, their client uses the project URL and API key instead of the Postgres connection string. Those values aren't interchangeable, even when they all belong to the same project.

## Connect the app to its database

<Steps>
<Step title="Create the database">Create the instance with your database provider and keep its connection details handy. A Studio entry marked `unprovisioned` isn't a working connection, even if it shows a provider and starter schema.</Step>

<Step title="Configure the application">Set up the binding or put the connection settings in the project's environment. For a Postgres client, that can mean setting `DATABASE_URL`. Check that the app has the client library or ORM configuration appropriate to the provider before trying a query.</Step>

<Step title="Prepare the schema">Describe the data model in Studio chat to have Bhai generate SQL migrations. Check the SQL dialect and the intended database before applying the change. Run a query against that database to check that the schema is ready for the application.</Step>
</Steps>

<Note>Cloud Studio's in-browser PGlite preview is a separate database target. A query that works there doesn't verify that your deployed application can reach its own database or that the deployed schema has the same tables.</Note>

## Next

* [Review and apply database migrations](/databases/migrations).
* [See where connected-service credentials are stored](/security/token-vault).
