Deployment strategies refer to how your application is updated across one or more servers. The right strategy depends on factors like your Application's type, usage patterns, traffic levels and tolerance for downtime.
In this article we'll explore two deployment strategies that Serversinc supports out of the box:
- Stop and Recreate
- Rolling Deployments
Both strategies are designed for self-hosted applications running in Docker containers and managed via Serversinc's dashboard and API.
Stop and Recreate
Stop and Recreate refers to the full shutdown of your existing Container followed by the creation of a new one, typically with a newer version your application's code.
This strategy is ideal for smaller apps such as personal blogs, internal tools, or any system where a few seconds of downtime is acceptable.
How it works
- Serversinc instructs your server to stop the running container.
- Once stopped, the container is removed entirely.
- A new container is created, usually based on the updated Docker image.
- The new container is started automatically.
Pros
- Simple - A straightforward process that doesn't require any complex orchestration.
- Resource Efficient - Minimal extra resource usage needed as your Server only runs one Container at once.
- Non-production only - Ideal for small apps and internal tools that don't require 24/7 uptime.
Cons
- Your application is offline between stopping the old container and starting the new one, which can be disruptive to users.
- If the new container fails to start, the application remains down until a fix is deployed or the old version is manually restored.
Rolling Deploys
Rolling deployments allow you to release new versions gradually, replacing old containers with new ones incrementally and only after verifying their health.
This strategy is recommended for production systems, especially those with active users, as it enables zero-downtime deployment with minimal risk.
How it works
- Serversinc creates a new container with the latest version of your application.
- Tugboat, the agent running on your server, monitors the container's health and notifies Serversinc once it's ready.
- Serversinc then stops and removes the old container.
- The new container seamlessly takes over handling traffic.
By default, the new container uses the same network and labels, so tools like Traefik automatically reroute traffic without any disruption.
Pros
- Zero-downtime - Your application stays online during the entire process, allowing Users to continue to access the old version until the new one is ready.
- Safer Deployments - A reduced risk to deployment as health checks ensure the new container is working before making the switch from the old container.
- Resource Efficient - Rolling updates only require enough resources for an additional Container for a short period of time, making them slightly less efficient than "Stop and Recreate".
Cons
- Rolling back to the previous version in case of issues or bugs may take slightly longer to roll out to users.
- Some users may be served the old Container while others are handled by the new one, potentially causing state issues and confusion.
Choosing the Right Deployment Strategy
There’s no one-size-fits-all approach to deploying applications. As a general rule: if your app isn’t in production, Stop and Recreate is often all you need. But for production apps with active users, Rolling Deployments provide a safer, zero-downtime experience.
You can change the deployment strategy any time in your Application's settings, either through the dashboard or the API. We encourage you to play around with both and choose what best fits your workflow and your app’s needs.
Ready to deploy with confidence? Log in to the Serversinc dashboard or check out the API documentation to get started.