BlueGreen Deployment
The goal is to have zero-down time for deployment of the new version of the service. BlueGreen Deployment (BGD) is a technique having two instances (blue and green) of the same deployed service, and changing routing from one to another.
If newly enabled service (green) has bugs, you can rollback, change routing to the previous version of this service (blue).
There are multiple options of routing, which I'm omitting on purpose. What is more important to highlight is database state. You have two options how to make BGD and both have caveats.
Database per instance
This option can be used in the microservices when each service has its own database. In case you are using this option, you need to send POST requests to both services to maintain consistent state of databases.
One database per bot services
With this approach you need to maintain differences in the database schema (if there are any).
Canary Release
It's a similar Continuous Delivery technique as BlueGreen Deployment. The difference is that you must enroll new service for a fraction of your users first. Then increase the traffic to your new service until you have solid confidence in the new version of the service and you can route 100% traffic to a new service version.
Feature Toggles
Technique to enable/disable features in the code. This gives more control and configuration options of what you can turn off and on. With this flexibility comes the complexity to manage toggles and testing the code with multiple branches.
Feature toggle types
- Release Toggle - undone feature
- Experiments - used for A/B testing and other experiments
- Operations Toggle - for performance critical features, can disable performance intensive features and leave the critical less impacted a user load.
- Permission Toggle - toggle features by user permissions
Feature toggle components
- Toggle points - points in the code, which create branching
- Toggle context - additional/dynamic context for feature toggle router
- Toggle configuration - configures how to enable toggles. Static configuration in code, or environment variables, or dynamic parameters.
- Toggle router - makes decision based on context and configuration
Microservices, 2nd edition by Sam Newman
Marting Fowler BlueGreen Deployment
Pete Hodgson Feature Toggles