---
title: "Cloudflare vs while: the French alternative for your AI agent"
url: https://while.sh/en/comparisons/while-vs-cloudflare/
author: "Grégoire Mougeolle, co-founder of Nextmap"
updated: 2026-11-02
---

# 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.

## 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 network (source 1) | 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 actions (source 2) | 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 included (source 2) | 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 one (source 3), or a PostgreSQL database from PlanetScale (source 10) | 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 people (source 4) | 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 world (source 5) | Yes, with Nextmap, a French company |
| To get started | Free to start, then $5 per month (source 6) | A trial without an account. Then €0 to get started, and €13.75 per month for an app and its database |

## 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 limit (sources 7, 9 and 6). Its D1 database goes back to any minute of the last 30 days on a paid plan, with nothing to turn on (source 3).

## 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

- [Deploy a static site](/en/guides/deploy-static-site/)
- [Deploy a Node.js API and its PostgreSQL database](/en/guides/deploy-node-api-postgresql/)

## Sources

1. [Cloudflare Workers, documentation](https://developers.cloudflare.com/workers/), 2026-11-02
2. [Cloudflare, the API MCP server](https://github.com/cloudflare/mcp), 2026-11-02
3. [Cloudflare D1, Time Travel](https://developers.cloudflare.com/d1/reference/time-travel/), 2026-11-02
4. [Cloudflare Access, pricing](https://www.cloudflare.com/sase/products/access/), 2026-11-02
5. [Cloudflare Workers, where the code runs](https://developers.cloudflare.com/workers/configuration/placement/), 2026-11-02
6. [Cloudflare Workers, pricing](https://developers.cloudflare.com/workers/platform/pricing/), 2026-11-02
7. [Cloudflare, the network](https://www.cloudflare.com/network/), 2026-11-02
8. [Cloudflare D1, where the data lives](https://developers.cloudflare.com/d1/configuration/data-location/), 2026-11-02
9. [Cloudflare Workers, product page](https://www.cloudflare.com/products/workers/), 2026-11-02
10. [Cloudflare and PlanetScale, PostgreSQL for Workers](https://blog.cloudflare.com/deploy-planetscale-postgres-with-workers/), 2026-11-02

## Questions

### Does Cloudflare keep my data in France?

By default, your code runs as close as possible to each visitor (source 5), and a D1 database can stay in the European Union (source 8). 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.
