Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Design: Microservices Rollback Strategies
Design focuses on rollback strategies for microservice deployments including deployment orchestration, data consistency, and monitoring. Does not cover CI/CD pipeline design or detailed microservice implementation.
Functional Requirements
FR1: Support safe rollback of microservice deployments in case of failures
FR2: Minimize downtime during rollback
FR3: Ensure data consistency and integrity after rollback
FR4: Allow rollback of single or multiple microservices independently
FR5: Provide monitoring and alerting for rollback triggers
Non-Functional Requirements
NFR1: Handle up to 100 microservices in the system
NFR2: Rollback latency should be under 5 minutes
NFR3: Availability target of 99.9% during rollback operations
NFR4: Support rollback in both stateless and stateful microservices
3. Consider this simplified code snippet for a canary deployment rollback trigger:
if error_rate > 0.05:
rollback_canary()
What happens when the error rate exceeds 5% during canary deployment?
medium
A. The system continues deployment without changes
B. The error rate is ignored and logged only
C. The rollback_canary function is called to revert changes
D. The deployment is paused but not rolled back
Solution
Step 1: Analyze the condition in code
The code checks if error_rate is greater than 0.05 (5%).
Step 2: Understand the action on condition true
If true, rollback_canary() is called to revert the canary deployment.
Final Answer:
The rollback_canary function is called to revert changes -> Option C
Quick Check:
Error rate > 5% triggers rollback [OK]
Hint: Error rate > threshold triggers rollback function [OK]
Common Mistakes:
Ignoring the rollback call in the code
Assuming deployment pauses without rollback
Confusing logging with rollback action
4. A microservice deployment uses database migration with rollback scripts. The rollback script fails due to a syntax error. What is the best immediate action?
medium
A. Ignore the failure and continue deployment
B. Restart the service without rollback
C. Delete the database and start fresh
D. Manually fix the rollback script and retry rollback
Solution
Step 1: Identify rollback script failure impact
A syntax error in rollback script prevents safe undo of migration changes.
Step 2: Choose safe recovery action
Fixing the script manually and retrying rollback ensures data integrity and system stability.
Final Answer:
Manually fix the rollback script and retry rollback -> Option D
Quick Check:
Fix rollback script error before retrying [OK]
Hint: Fix rollback script errors before retrying rollback [OK]
Common Mistakes:
Ignoring rollback failure and proceeding
Deleting database without backup
Restarting service without fixing rollback
5. You have a microservices system using canary deployments with automated rollback on failure. Suddenly, a rollback triggers repeatedly due to a false positive error spike caused by monitoring noise. What is the best architectural improvement to reduce unnecessary rollbacks?
hard
A. Disable rollback automation and rely on manual checks
B. Implement a cooldown period before allowing another rollback
C. Remove monitoring to avoid false alarms
D. Rollback immediately on any error spike without delay
Solution
Step 1: Understand problem cause
False positive error spikes cause repeated rollbacks due to noisy monitoring data.
Step 2: Identify architectural fix
Adding a cooldown period prevents rapid repeated rollbacks, allowing noise to settle before next rollback.
Final Answer:
Implement a cooldown period before allowing another rollback -> Option B
Quick Check:
Cooldown period reduces rollback noise impact [OK]
Hint: Cooldown period prevents rollback storms from noise [OK]