DocsBest practices
Deploying without downtime
Health checks, branches and safe releases.
Best practices 4 min read
DIGITALYCloud only switches to a new version once it passes its health check. Help it decide correctly and your users will never see an interruption.
Add a real health endpoint
A good health check confirms your app can do its job, not just that the process is alive.
js
app.get('/health', async (_, res) => {
try {
await db.query('select 1');
res.status(200).send('ok');
} catch {
res.status(503).send('database unavailable');
}
});Use a branch workflow
- Develop on a feature branch, merge to
mainonly when it works locally. - Create a second service connected to a
stagingbranch to test changes on real infrastructure. - Avoid deploying on Friday evening — if something breaks, you want to be around.
Database changes
Make changes in two steps: first add new columns or tables that the old version ignores, deploy, then remove what is no longer used in a later release. This keeps a rollback possible at every step.
Was this article helpful?