Skip to content

Cloudflare vs while: which one to choose when your AI agent deploys?

Cloudflare runs your code as close as possible to each visitor, on its global network. On while, your app runs in France, with its PostgreSQL database, and your AI agent deploys it over MCP without breaking anything.

By Grégoire Mougeolle, co-founder of Nextmap. Facts checked on November 2, 2026. How this comparison is made.

View as Markdown

What changes between Cloudflare and while

What mattersCloudflarewhile
Who it’s forApps that respond as close as possible to each visitor, on Cloudflare’s global network1People who build their apps with an AI agent, solo or as a team
Your AI agentAn MCP server that opens the whole Cloudflare API, more than 2,500 actions2Connected over MCP, with OAuth: it deploys, creates the database, reads the logs and fixes things
What protects productionYour agent can do anything its token allows, deletions included2Sensitive actions, like deleting a production database, wait for a person
The databaseD1, SQLite that goes back to any minute over 30 days on a paid plan, 7 on the free one3, or a PostgreSQL database from PlanetScale10PostgreSQL in while, backed up every day, with point-in-time recovery
Who opens your appCloudflare Access, with company SSO, free for up to 50 people4Everyone, a password, or the company account with the Pro plan
In FranceThe code runs as close as possible to the visitor, anywhere in the world5Yes, with Nextmap, a French company
To get startedFree to start, then $5 per month6A trial without an account. Then €0 to get started, and €13.75 per month for an app and its database

Try while on your app, without an account. Copy the instructions

Cloudflare, your code in 348 cities

Cloudflare runs your code in 348 cities, with no cold start, and serves your static files for free and without limit7,9,6. Its D1 database goes back to any minute of the last 30 days on a paid plan, with nothing to turn on3.

With while, your AI agent does the rest

  • No server to maintain. No system to update, no disk to watch, no certificate to renew: your agent deploys, and while takes care of the rest.
  • Your databases are backed up for you. Every day, with point-in-time recovery, and a production backup tested every day.
  • Nothing serious happens without you. Deleting a production database waits for your approval, before it runs, and every action is recorded in a signed activity log.
  • Your keys stay secret. Your app uses them, your agent never sees them.
  • Your colleagues sign in with the company account. Google Workspace or Microsoft 365, on the Pro plan, with no sign-in page to code.

Moving from Cloudflare to while

Take over your app

You, to your agent: Move our Cloudflare app to while.

Your agent takes over your code, adapts it if it depends on Workers, writes while.yaml and deploys the app.

Move your database to PostgreSQL

You, to your agent: Move our D1 tables into a while PostgreSQL database.

Your agent declares a PostgreSQL database, backed up every day, copies your tables into it and connects your app to it.

Carry over your variables

You, to your agent: Carry over our environment variables.

Your agent carries your settings over to while. You enter your secret keys yourself: it never sees them.

Which one to choose

  • Choose Cloudflare if your app must respond as close as possible to each visitor, anywhere in the world.
  • Choose while if your app must run in France, with its PostgreSQL database, and your AI agent must not break anything without you.

Next steps

Sources

  1. Cloudflare Workers, documentation, accessed November 2, 2026
  2. Cloudflare, the API MCP server, accessed November 2, 2026
  3. Cloudflare D1, Time Travel, accessed November 2, 2026
  4. Cloudflare Access, pricing, accessed November 2, 2026
  5. Cloudflare Workers, where the code runs, accessed November 2, 2026
  6. Cloudflare Workers, pricing, accessed November 2, 2026
  7. Cloudflare, the network, accessed November 2, 2026
  8. Cloudflare D1, where the data lives, accessed November 2, 2026
  9. Cloudflare Workers, product page, accessed November 2, 2026
  10. Cloudflare and PlanetScale, PostgreSQL for Workers, accessed November 2, 2026

Questions

Does Cloudflare keep my data in France?

By default, your code runs as close as possible to each visitor5, and a D1 database can stay in the European Union8. On while, everything runs in France.

Can my PostgreSQL database move to Cloudflare?

Cloudflare doesn’t manage one itself: its database is D1, which is SQLite, and PostgreSQL comes from PlanetScale. On while, PostgreSQL is right there, backed up every day.

Can my agent move from Cloudflare to while?

Yes. It takes your code, adapts it if it depends on Workers, and deploys your app and its PostgreSQL database.

Connect your agent, it takes care of the rest

To paste into your agent

Read while.sh/agents, then deploy my app with while.

Copy the instructions

No account needed to try: your app is live right away. To keep it, sign in.

A project for your company? Talk to the team: hello@while.sh