Microservices CI/CD and Deployment Strategies 2 — Questions and Answers
Question 1: In a blue-green deployment, what is the role of the 'green' environment before the cutover?
- The idle environment running the new version, validated before traffic switches (Correct answer)
- The live environment serving all production traffic
- A backup database replica only
- A staging environment that never receives real traffic
Correct answer: The idle environment running the new version, validated before traffic switches
Green hosts the new version and is validated while blue still serves traffic, then the router switches traffic to green.
Question 2: What is the primary benefit of a canary release in a microservices system?
- Exposing the new version to a small subset of users to limit blast radius (Correct answer)
- Deploying to every instance simultaneously for speed
- Eliminating the need for monitoring
- Avoiding any need to roll back
Correct answer: Exposing the new version to a small subset of users to limit blast radius
Canary releases route a small percentage of traffic to the new version so problems affect few users before full rollout.
Question 3: Which practice best supports zero-downtime database schema changes during CI/CD?
- Backward-compatible, expand-and-contract migrations (Correct answer)
- Dropping old columns immediately on deploy
- Locking the entire table during peak hours
- Renaming columns in a single irreversible step
Correct answer: Backward-compatible, expand-and-contract migrations
Expand-and-contract adds new schema elements compatibly first, then removes old ones after code no longer uses them.
Question 4: What does 'shift-left testing' mean in a CI/CD pipeline?
- Running tests earlier in the development lifecycle (Correct answer)
- Moving deployment to the left server cluster
- Delaying tests until production
- Testing only after release
Correct answer: Running tests earlier in the development lifecycle
Shift-left moves testing earlier so defects are caught sooner and cheaper.
Question 5: Why are immutable container images preferred in deployment pipelines?
- They guarantee the same artifact runs across all environments (Correct answer)
- They allow editing files live in production
- They reduce the need for version tags
- They automatically scale horizontally
Correct answer: They guarantee the same artifact runs across all environments
Immutable images ensure the exact artifact tested is the one deployed, eliminating environment drift.
Question 6: In a rolling deployment, what risk arises when old and new versions run simultaneously?
- API or schema incompatibility between versions (Correct answer)
- Complete service outage by design
- Inability to scale at all
- Loss of all logging
Correct answer: API or schema incompatibility between versions
During a rolling update both versions serve traffic, so they must be compatible or requests may fail.
Question 7: What is the main purpose of a deployment 'gate' in a pipeline?
- To require automated or manual approval criteria before promotion (Correct answer)
- To compress build artifacts
- To rotate secrets automatically
- To merge feature branches
Correct answer: To require automated or manual approval criteria before promotion
Gates enforce checks (tests, approvals, metrics) that must pass before a release advances to the next stage.
In a blue-green deployment, what is the role of the 'green' environment before the cutover?