A deployment puts software into an environment. A release makes that software available to users.
That distinction is important. A team can deploy a new Java service version to production infrastructure without immediately sending all production traffic to it. Once deployment and release are separated, safer rollout strategies become possible.
Blue-green deployment, rolling release, canary release, A/B testing, and traffic shadowing all rely on the same basic idea: multiple versions can exist in production while traffic routing decides who uses each version.
The Problem
A simple release process replaces the old version with the new one in one step.
Stop old version
|
v
Install new version
|
v
Start new version
|
v
All users use new version
This is easy to understand, but it is risky.
If the new version has a serious bug, every user is affected. If rollback is manual, recovery is slow. If the database or external systems changed, the rollback may be even harder.
A safer release process reduces the blast radius.
Deploy new version
|
v
Route-limited traffic
|
v
Observe behavior
|
v
Increase or rollback
Modern cloud, IaaS, PaaS, and software-defined networking make these patterns easier because teams can create instances and change routing programmatically.
Blue-Green Deployment
Blue-green deployment runs two production environments side by side.
One environment serves users. The other contains the candidate release.
Users
|
v
Blue environment: current production
Green environment: candidate release
After the candidate version is deployed and tested in a real production-like environment, traffic is switched to it.
Before release:
traffic -> blue
After release:
traffic -> green
Rollback is simple in concept: route traffic back to the previous environment.
Blue-green deployment is useful when rollback confidence matters. The old environment remains available while the new one is tested.
The challenge is that both environments may include databases and external systems. If the new version changes shared data, rollback can become more complex. The release design must include data compatibility, migration strategy, and external dependency behavior.
Rolling Release
A rolling release updates instances gradually.
Instead of switching a whole environment at once, the platform starts a new instance with the new version, begins sending traffic to it, and then removes the old instance. The process continues until all instances run the new version.
Initial:
old old old old
Step 1:
new old old old
Step 2:
new new old old
Final:
new new new new
Rolling releases are useful for reducing downtime. They work especially well when the application runs on multiple identical instances, such as virtual machines or containers.
The tradeoff is rollback complexity. During the rollout, old and new versions coexist. That can create issues if they use different database schemas, incompatible API behavior, or different assumptions about external systems.
A rolling release is a technical way to reduce interruptions. It does not automatically provide the same rollback safety as blue-green.
Canary Release
A canary release gradually exposes the new version to a small percentage of users.
Phase 1:
90% traffic -> old version
10% traffic -> new version
Phase 2:
50% traffic -> old version
50% traffic -> new version
Phase 3:
1% traffic -> old version
99% traffic -> new version
The purpose is early detection. If a serious issue appears with the first small group, the team can stop the rollout before most users are affected.
The name comes from canaries used by miners to detect gas leaks early. In software, the canary group detects production problems early.
Canary release is useful when:
- The system can route traffic by percentage.
- Observability is good enough to detect regressions.
- Rollback can happen quickly.
- The new version can coexist with the old version.
- The team knows which metrics determine success.
Without good monitoring, canary release loses much of its value because the team may not notice the issue until traffic has already expanded.
A/B Testing
A/B testing also routes users to multiple versions, but the purpose is different.
A canary release asks, "Is the new version safe?"
A/B testing asks, which version performs better for the business?
Version A:
current purchase flow
Version B:
alternative purchase flow
Traffic can be split randomly, by percentage, or by criteria such as geographical location or user age when that data is available.
A/B testing is common for small user interface or flow changes. For example, an online shop might compare different button placements, colors, or purchase steps.
The less effective version is usually discarded.
The key warning is that A/B testing is a business experiment, not only a deployment trick. The team must decide what metric is being measured before the test starts.
Traffic Shadowing
Traffic shadowing sends real production traffic to the old version and a copy of that traffic to the new version.
User request
|
+--> old version returns response to user
|
+--> new version receives copied request for observation
Users still receive responses from the old version. The new version observes real traffic but does not control the user outcome.
This can be useful for major releases and load testing because the new version is exposed to realistic traffic patterns.
Traffic shadowing must be handled carefully. If the new version sends emails, writes records, triggers payments, or calls external systems, copied traffic can create duplicate side effects. The design must prevent user-visible actions from being performed twice.
Comparing Release Strategies
| Strategy | Main goal | Watch out for |
|---|---|---|
| Blue-green | Fast switch and rollback | Data and external system compatibility |
| Rolling | Reduce downtime | Old and new versions coexist |
| Canary | Limit user impact during rollout | Needs strong monitoring |
| A/B testing | Compare business behavior | Needs clear experiment metrics |
| Shadowing | Observe new version with real traffic | Must prevent duplicate side effects |
A team may use more than one strategy. For example, a new version could be deployed blue-green, released as a canary, and later used for an A/B experiment. The important part is knowing the goal of each technique.
Maintenance Is Part of Release Planning
Software maintenance is not an afterthought. Many systems spend more time in maintenance than in active initial development.
Maintenance work commonly falls into two broad buckets:
Bug fixes:
Correct defects or unexpected bad behavior.
Requests for Enhancement:
Add use cases not originally planned.
Maintenance can also be classified by purpose.
Corrective maintenance:
React to reported problems.
Adaptive maintenance:
Keep software working in changing environments.
Perfective maintenance:
Improve performance, resource usage, maintainability, or user experience.
Preventive maintenance:
Fix known issues before they become user-visible problems.
Perfective and preventive maintenance are easy to neglect because nothing may break immediately when they are skipped. Over time, skipping them increases technical debt.
Release Impact of Maintenance
Maintenance can still require releases, configuration changes, or API changes.
That means it can affect availability, SLAs, users, and downstream developers.
A small bug fix might be safe. A change that modifies public API behavior may force users to adapt. A configuration change may require a maintenance window. Some legal or operational agreements may restrict when maintenance can happen or allow it only for severe issues.
Maintenance should be planned and financed from the start of the project. A product that is not maintained can accumulate security issues, customer dissatisfaction, poor performance, and market decline.
Practical Release Workflow
- Deploy the new version without immediately exposing all users.
- Choose the release technique based on risk.
- Verify that old and new versions can coexist if needed.
- Define rollback behavior before rollout starts.
- Define success metrics before canary or A/B traffic starts.
- Prevent duplicate side effects during traffic shadowing.
- Monitor user-facing behavior and system metrics.
- Increase traffic gradually when using canary release.
- Keep the previous version available until rollback is no longer needed.
- Record which version was released and when.
Practical Maintenance Workflow
- Classify work as bug fix or enhancement.
- Classify maintenance type as corrective, adaptive, perfective, or preventive.
- Estimate impact and effort.
- Check SLA and maintenance window constraints.
- Decide whether retro compatibility is required.
- Add or update tests for the changed behavior.
- Release through the normal pipeline.
- Monitor after release.
- Track technical debt created or removed.
- Review whether similar issues can be prevented.
Common Mistakes
The first mistake is treating deployment and release as the same thing. Separating them gives the team safer options.
The second mistake is using a canary release without monitoring. A canary only helps if the team can detect failure early.
The third mistake is using traffic shadowing without controlling side effects. Copied traffic should not send duplicate notifications or perform duplicate writes.
The fourth mistake is assuming rolling release is always safe. Coexisting versions can break if they expect different data or APIs.
The fifth mistake is underfunding maintenance. Unmaintained systems accumulate technical debt and risk.
Checklist
- Deployment and release are separate steps.
- The chosen release strategy matches the risk.
- Traffic routing rules are explicit.
- Rollback behavior is defined.
- Old and new versions can coexist safely.
- Database and external system compatibility are considered.
- Canary metrics are defined before rollout.
- A/B testing has business success criteria.
- Shadow traffic cannot create duplicate side effects.
- Maintenance work is planned and funded.
- Technical debt is tracked.
- API compatibility is reviewed before maintenance releases.
Conclusion
Safe releasing is about controlling exposure.
Blue-green deployment gives fast switching. Rolling release reduces downtime. Canary release limits early impact. A/B testing compares alternatives with real users. Traffic shadowing observes new behavior without changing user results.
Use these techniques together with disciplined maintenance planning. A Java application is not successful only when it first reaches production. It is successful when it can keep changing safely after production.