Friday 5 p.m.: "zero-downtime" deploy on Clever Cloud. Healthcheck returns 200 on / even when the API is down; PostgreSQL migration locks the users table; Redis sessions are lost on restart. Result: five minutes of 502 — "acceptable" per the developer, unacceptable for the SLA contract.
Clever Cloud is a PaaS built to deploy often — provided you treat deploy as an architecture project, not magic git push. The platform can cleanly remove an instance from the router; it does not fix a lying healthcheck or blocking migration.
Three zero-downtime pillars
| Pillar | Clever Cloud action | Typical mistake |
|---|---|---|
| Healthcheck | Deep /health route — DB, cache | 200 on static page |
| N/N+1 compatibility | Backward-compatible API one release | Breaking change + single deploy |
| Migrations | Expand/contract, not sync ALTER | Table lock in prod |
Configure healthcheck in dashboard or via Clever Tools; align timeout and grace period with real app boot time — JVM, OPcache, connection pool.
Recommended deploy sequence
Start with pre-deploy phase: expand migration — nullable columns, new tables. Deploy new version; unhealthy instances stay out of rotation. Run smoke test on critical endpoints via Clever preview URL if available. Switch traffic progressively or via DNS in blue-green. Finish with contract migration after draining old instances.
For PHP, Node, or Java, include warmup — OPcache, JVM — in deep healthcheck.
Sessions, cache, and files
Sessions must live in Clever Redis add-on or stateless JWT — not local instance memory. Local uploads are incompatible with horizontal scaling: use external object storage. Cache invalidation must be versioned before traffic switch.
Without these three points, horizontal scaling simulates zero downtime but loses user state — empty carts, logouts, missing files.
The peak: push without deep health = roulette
That is the gap between demo and production on a Friday evening.
Decide and move forward without blind spots
Version a deep healthcheck in the repo, write an expand/contract migration runbook, test weekly deploy on Clever staging environment, and document blue-green or canary strategy with session handling. See Clever Cloud page and compare tool if hesitating between PaaS and VPS for your load.
Frequently asked questions
Does Clever Cloud guarantee zero downtime?
No — it depends on healthcheck, migrations, and N/N+1 compatibility between versions.
What role does healthcheck play?
It routes traffic if OK. Misconfigured, it creates false security or blocks deploys.
How to handle database migrations?
Expand/contract: schema compatible with two versions, then cleanup. Avoid blocking ALTER at switch.
Blue-green on Clever Cloud?
Two environments, DNS/router switch, documented session drain and cache invalidation.
Before promising zero downtime, make a deploy fail in staging on purpose — the healthcheck will tell the truth or not.
