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.
What changes between Cloudflare and while
| What matters | Cloudflare | while |
|---|---|---|
| Who it’s for | Apps that respond as close as possible to each visitor, on Cloudflare’s global network1 | People who build their apps with an AI agent, solo or as a team |
| Your AI agent | An MCP server that opens the whole Cloudflare API, more than 2,500 actions2 | Connected over MCP, with OAuth: it deploys, creates the database, reads the logs and fixes things |
| What protects production | Your agent can do anything its token allows, deletions included2 | Sensitive actions, like deleting a production database, wait for a person |
| The database | D1, SQLite that goes back to any minute over 30 days on a paid plan, 7 on the free one3, or a PostgreSQL database from PlanetScale10 | PostgreSQL in while, backed up every day, with point-in-time recovery |
| Who opens your app | Cloudflare Access, with company SSO, free for up to 50 people4 | Everyone, a password, or the company account with the Pro plan |
| In France | The code runs as close as possible to the visitor, anywhere in the world5 | Yes, with Nextmap, a French company |
| To get started | Free to start, then $5 per month6 | A 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
- Cloudflare Workers, documentation, accessed November 2, 2026
- Cloudflare, the API MCP server, accessed November 2, 2026
- Cloudflare D1, Time Travel, accessed November 2, 2026
- Cloudflare Access, pricing, accessed November 2, 2026
- Cloudflare Workers, where the code runs, accessed November 2, 2026
- Cloudflare Workers, pricing, accessed November 2, 2026
- Cloudflare, the network, accessed November 2, 2026
- Cloudflare D1, where the data lives, accessed November 2, 2026
- Cloudflare Workers, product page, accessed November 2, 2026
- Cloudflare and PlanetScale, PostgreSQL for Workers, accessed November 2, 2026