Blue-Green Deployment

Overview

This page explains how to implement blue-green deployment in Bloomreach Cloud. It covers the process, benefits, limitations, and best practices for maintaining environment consistency.

Purpose

Blue-green deployment enables you to run two parallel production environments—Blue and Green. At any time, only one environment serves production traffic. You deploy new releases to the inactive environment, verify the deployment, and then switch production traffic to it. This approach reduces downtime and risk during releases.

Note: You can also use rolling updates for deploying backward-compatible releases without downtime.

Note: Blue-green deployment uses two of the four available environments in a Bloomreach Cloud stack. You will have two environments remaining for testing or acceptance purposes.

Advantages

Reduced Risk

You can verify a new release in the inactive environment before routing production traffic to it. If issues occur, the current production environment remains unaffected.

High Availability

Production traffic continues to flow through the active environment while you deploy and verify the new release in the inactive environment. Switching traffic is nearly instantaneous.

Simplified Rollback

If the new release causes issues after going live, you can immediately revert production traffic to the previous environment.

Drawbacks

Content Freeze Requirement

Any data written to the repository or databases during the deployment process will be lost. You must enforce a content freeze from before the backup of the current live environment until after switching production traffic to the new environment. During the content freeze:

  • Suspend all content creation and modification by CMS users and import processes.
  • Manually recover and migrate any website data (such as forms or relevance data) collected during the freeze.
  • Ensure all users are logged out when the content freeze begins.

Deployment Procedure

1. Deploy Initial Release in Green

  1. Create the Green environment.
  2. Deploy version 1.0.0 of Bloomreach Experience Manager in Green.
  3. Set Green as the active production environment. See mark an environment as production.
  4. Create the Blue environment.
  5. Deploy version 1.0.0 of Bloomreach Experience Manager in Blue.

2. Deploy Subsequent Release in Blue

  1. Announce the start of a content freeze.

  2. Back up the Green environment.

  3. Restore the backup in Blue.

  4. Deploy version 1.1.0 of Bloomreach Experience Manager in Blue.

  5. Verify that version 1.1.0 is running correctly in Blue.

    • Do not contaminate the databases during verification. Perform extensive testing in a separate acceptance environment before this step.
  6. Set Blue as the active production environment. See mark an environment as production. Ensure you select the Switch domain rules option.

  7. Announce the end of the content freeze.

  8. Monitor Blue for stability as it serves production traffic.

  9. After confirming stability, deploy version 1.1.0 in Green to synchronize both environments. This allows Green to serve as a failover, though its content may be outdated. Keeping both environments in sync also streamlines future deployments.

3. Deploy Subsequent Release in Green

  1. Announce the start of a content freeze.

  2. Back up the Blue environment.

  3. Restore the backup in Green.

  4. Deploy version 1.2.0 of Bloomreach Experience Manager in Green.

  5. Verify that version 1.2.0 is running correctly in Green.

    • Do not contaminate the databases during verification. Perform extensive testing in a separate acceptance environment before this step.
  6. Set Green as the active production environment. See mark an environment as production. Ensure you select the Switch domain rules option.

  7. Announce the end of the content freeze.

  8. Monitor Green for stability as it serves production traffic.

  9. After confirming stability, deploy version 1.2.0 in Blue to synchronize both environments.

Repeat the steps for Blue and Green as needed for future releases.

Environment Synchronization

When updating both environments to a new release, always deploy the new distribution to the inactive environment before restoring a backup from the active environment. This order prevents database corruption.

Follow the procedure above to ensure the inactive environment matches the active environment after each deployment.

Example

Assume both Blue and Green are running release 1.0.0 on Bloomreach Experience Manager 11. You upgrade Blue to release 2.0.0 on Bloomreach Experience Manager 12. To update Green:

  • Do not restore a backup of Blue into Green and then deploy 2.0.0. If Green is still running 1.0.0/11, restoring a 2.0.0/12 backup and then deploying 2.0.0 will corrupt the database.
  • Instead, first deploy distribution 2.0.0 to Green, then restore the backup from Blue.
Database 1.0.0Database 2.0.0
Distribution 1.0.0> Hint: OK> Warning:
deploy ↓
Distribution 2.0.0> Hint: OKrestore →> Hint: OK

Best Practices

Hint: Test new releases in a separate acceptance environment before deploying to Blue or Green. This allows for more thorough testing, including database-impacting tests, and reduces the time required for verification during blue-green deployment.

Hint: If you announce the content freeze in the morning, you can use the scheduled backup from the previous night to start the deployment.

Hint: Reusing (cycling) existing Blue/Green environments speeds up Elasticsearch index restoration, as only missing data from the previous active period needs to be added.

Hint: If you use the IP Filter plugin, configure the hostnames property for the production hostname, not the environment-specific hostname. After switching production traffic, verify that the site is accessible from outside your corporate network.

Share Feedback
Page: /deploy/bloomreach-cloud/reference-documentation/blue-green-deployment
Section: Deploy
Category *