首页 > How to do rollback when deploying an enterprise application

How to do rollback when deploying an enterprise application

What's the best practice to do a rollback to an already deployed enterprise application on Linux?
Consider this situation, We have an application server(let's say it django served by gunicorn), a data server(mysql), and a task server(celery). And I already deployed them to different servers. Source code is managed by gitlab. When doing update, some error occurred and a rollback is needed.
There are mainly two ways to go:

  1. first use migrate command in django to rollback status of data server; second on application server and task server, backup the source code before update, and cpthe backup back when rollback.

  2. shutdown all server and make snapshot of server before update. and revert to snapshot when we need rollback.

Of course method 2 is much more safer. But is costly.

Since the situation is developing application for enterprise, I am not very sure Docker is an acceptable solution.

What worries me is the rollback of data server, since the table structure may change, and there are real data in it. And if we use docker, I am not quite sure what to do with the data server, does a image for it is needed?

【热门文章】
【热门文章】