Docker and Continuous Delivery Deployment Types - DZone (2024)

  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. Docker and Continuous Delivery Deployment Types

See how Docker deployment methods make continuous delivery achievable, and what you need to know to get started with CD automation.

By

Docker and Continuous Delivery Deployment Types - DZone (1)

Stefan Thorpe

Docker and Continuous Delivery Deployment Types - DZone (2) CORE ·

Jan. 08, 18 · Analysis

Join the DZone community and get the full member experience.

Join For Free

In the companion piece to this blog post—A 5-Step Guide to Good Continuous Delivery—we looked at the best practices high-performing IT teams should be employing to achieve Continuous Delivery (CD) with Docker. CD is achievable using numerous deployment methods and Docker is just one tool to help realize the necessary customizable “workflow-based” integration/build process.

Now, we’re going to examine the four major deployment types and outline each of their advantages and disadvantages. These are:

  • Minimum In-Service deployment
  • Rolling application updates
  • Blue/Green deployment
  • A/B testing

These four deployment types fall into two sub-categories: application and infrastructure deployment.

Minimum In-Service Deployments

With this method, we specify the minimum number of instances in our applications that stay in-service while updating the remaining percentage—therefore, deploying to as large a number of targets as possible. This process is repeated until all servers have been updated with the new release.

Example: If we have 5 containers each running our current application A, then we set our policy to keep a minimum in-service number of 2. We take 3 servers offline to update them to our new version B. Once these are completed and back online, we can update the remaining 2.

Docker and Continuous Delivery Deployment Types - DZone (3)

Disadvantages

  • The process happens in multiple stages, so support is necessary in the form of orchestration and health checks outside of Swarm
  • Does not work well for infrastructure changes
  • Changes are being run on live servers—recovery time may be necessary if one fails

Advantages

  • There are few moving parts, which means increased testing capability; make application and code changes within the process
  • No downtime and no additional infrastructure cost
  • The process is often quicker than a rolling deployment (see below)

Rolling Deployments

Consider rolling deployments as an extension of minimum in-service. However, rather than define the number of containers that should remain online, we specify the maximum number of containers to update in tandem.

Example: We have the same 5 containers as before, but this time we initialize rolling updates by specifying the number of containers that may be updated simultaneously, e.g. 2. The process moves updates through 2 containers at a time until all the servers in the series are updated.

Note: Docker Swarm supports rolling updates out the box; the default is to update one container at a time. To modify this use the –update-parallelism setting

Docker and Continuous Delivery Deployment Types - DZone (4)

Disadvantages

  • Docker rolling updates deal with failure in two ways:
    • By pausing, allowing someone to jump in and rollback to fix
    • Or continuing regardless, meaning you may not discover a problem while the container is running
  • More complex than minimum in-service
  • Can be the least efficient in terms of deployment time; based on the time taken to update per stage
  • Again, we recommend orchestration and health checks outside of Swarm

Advantages

  • No downtime
  • Pausing is possible, permitting limited multi-version testing
  • Allows for automated testing—to assess deployment targets before continuing

Blue/Green Deployments

When following the Blue/Green (a.k.a. Red/Black) method, we replicate our “entire” infrastructure for a short time. The replicated infrastructure hosts the new application, while the old infrastructure continues to run until testing is complete and the new stack is adopted. The capabilities to achieve this have been around for a long time, but before the Cloud, it was an incredibly costly deployment method. Now, we can deploy stacks to a whole new environment—allowing for isolated evaluation—and thanks to the Cloud, at minimal costs. Once testing is complete, we switch our application over to the new version and shut down the legacy stack.

Docker and Continuous Delivery Deployment Types - DZone (5)

As the image depicts, Blue represents your current environment version, while the new variant you want to deploy is Green. Typically, this happens in the form of a DNS change, though you can deploy Blue/Green by modifying Auto Scaling Groups too.

Disadvantages

  • Requires advanced orchestration tooling
  • Some risk as the same database is necessary
  • Incurs some additional cost, though for a short time only
  • Unnatural user traffic will flood your servers—which is not the point for everything to break

Advantages

  • Reduced risk profile since infrastructure becomes immutable
  • Offers near zero-downtime
  • The switch is clean and controlled when using a DNS change
  • Process is fully automated and provides a larger validation window
  • It’s possible to test the entire environment’s health and performance before the switch

A/B Testing

A/B deployments are virtually identical to Blue/Green, but in this method, we send a small percentage of traffic to our new green environment. This method is capable of switching environments and changing infrastructure, but in a far more precise way than with Blue/Green deployment.

Docker and Continuous Delivery Deployment Types - DZone (6)

Disadvantages

  • In comparison to the aforementioned deployment methods, there are a lot of moving parts
  • Much more complex
  • Requires full automation of everything

Advantages

All the benefits of Blue/Green deployments, plus:

  • We can predictably scale capacity and pre-warm production
  • Use to test new features and make gradual assessments on performance, stability, and health
  • We gain customer validation while mitigating blast impact and widespread errors

Selecting your method of deployment comes down to what best suits your business and technical needs. If it makes sense for your application and user base, we highly recommend leveraging A/B testing where possible.

If you’re keen to automate this entire process, then we’d like to invite you to check out Caylent, our SaaS platform that makes it easy to deploy apps, such as WordPress, inside your own cloud. Our DevOps Container Management System automates the entire process covered here and a whole lot more.

Best of all, it is free to begin! Click here to sign up today.

Docker (software) Continuous Integration/Deployment Delivery (commerce) application A/B testing Infrastructure

Published at DZone with permission of Stefan Thorpe, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Zero to Hero on Kubernetes With Devtron

  • Deploy an Application for Azure Container Registry

  • Popular Tools Supporting YAML Data Format

  • AppOps with Kubernetes and Devtron - The Perfect Fit

Docker and Continuous Delivery Deployment Types - DZone (2024)

FAQs

What is the difference between continuous delivery and continuous deployment answer? ›

Continuous deployment goes one step further than continuous delivery. With this practice, every change that passes all stages of your production pipeline is released to your customers. There's no human intervention, and only a failed test will prevent a new change to be deployed to production.

Is Docker used for deployment? ›

It provides a viable, cost-effective alternative to hypervisor-based virtual machines, so you can use more of your server capacity to achieve your business goals. Docker is perfect for high density environments and for small and medium deployments where you need to do more with fewer resources.

What is an example of continuous delivery? ›

Answer: Updating software automatically on a mobile phone. Updating the software automatically on a mobile phone let the developers can tackle different situations before delivering anything to the customers.

What is difference between CI and CD? ›

CI can be considered as the first stage in producing and delivering code, and CD as the second. CI focuses on preparing code for release (build/test), whereas CD involves the actual release of code (release/deploy).

What is continuous delivery and deployment? ›

Continuous Delivery vs.

The difference between continuous delivery and continuous deployment is the presence of a manual approval to update to production. With continuous deployment, production happens automatically without explicit approval. Continuous delivery automates the entire software release process.

What is continuous deployment vs deployment? ›

Continuous delivery automates deployment of a release to an environment for staging or testing. Continuous deployment automatically deploys every release through your pipeline (including testing) and to production. While they are different, continuous deployment is an extension of the continuous delivery concept.

How does Docker deployment work? ›

If you deploy a Docker container, each container has everything needed to run the app and can be easily spun up or down for testing. This is how container deployment saves resources like storage, memory and processing power and speeds up the CI/CD pipeline.

How to create a deployment in Docker? ›

Docker deployment steps
  1. Configuring a network load balancer with the On-Premises Connector.
  2. Configuring a cloud load balancer with the On-Premises Connector. Create a target group for default routing to the Hybrid Data Pipeline service API. Create a target group for notifications. ...
  3. Browser configuration.

How do you deploy a Docker container? ›

To deploy the new container image to be available for operations, the container image should be uploaded into the repository. The requisite CLI for the container platform, for example, 'docker commit' can be used to load the new container image into the repository, on the Docker Container Platform.

What is the main goal of continuous delivery? ›

The main goal of Continuous Delivery is to make software releases low-risk and painless events that can be executed on demand. With techniques like blue-green deployments, it is easy to achieve zero-downtime deployments that are undetectable to users.

How does continuous deployment work? ›

Continuous deployment is a strategy in software development where code changes to an application are released automatically into the production environment. The automation is driven by a series of predefined tests. Once new updates pass those tests, the system pushes the updates directly to the software's users.

What are the steps of continuous delivery? ›

A continuous delivery pipeline consists of five main phases—build/develop, commit, test, stage, and deploy.

What is DevOps lifecycle? ›

The DevOps lifecycle is a continuous software development process that employs DevOps best practices to plan, build, integrate, deploy, monitor, operate, and offer continuous feedback throughout the software's lifecycle. It is often represented by a continuous loop diagram as seen below – DevOps Lifecycle Diagram.

Does CI CD require coding? ›

CI/CD is crucial because it automates the software development process, from coding through deployment. This automation means teams can release new features and fixes faster and more frequently, enhancing the product's responsiveness to user needs.

Can you have CI without CD? ›

The terms 'continuous integration' and 'continuous delivery' are used so often together that it's easy to forget how they differ.

What is the difference between continuous delivery and continuous deployment Quora? ›

Continuous Delivery => Software can be deployed to customers at any time with the "push of a button" (i.e. by running a deployment script). Continuous Deployment => Software is automatically deployed to customers once it passes through the continuous integration system.

What is the difference between continuous delivery and DevOps? ›

CI/CD refers to a set of development practices that enable the rapid and reliable delivery of code changes, while DevOps is a collection of ideas, practices, processes, and technologies that allow development and operations teams to work together to streamline product development.

Which comes first continuous delivery or continuous deployment? ›

Continuous Deployment is an extension of Continuous Delivery, where code changes that pass all the automated tests and validations in the staging environment are automatically deployed to the production environment without manual intervention.

What is the difference between continuous delivery and incremental delivery? ›

Continuous Delivery helps your team move faster by making each change small and manageable. Incremental Delivery helps your team move faster by increasing your opportunities to learn and adjust. Progressive Delivery helps your team move faster by reducing the risk of each change by controlling the audience exposed.

Top Articles
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 5313

Rating: 4 / 5 (41 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.