Cloud Migration Strategy and Execution Questions
Planning and executing a move to the cloud: the migration strategies (rehost, replatform, refactor, repurchase, retire, retain), legacy assessment, dependency mapping, cutover planning, and rollback. Covers phased migration roadmaps, workload modernization, risk management during cutover, and validating success post-migration. The end-to-end migration lifecycle, not steady-state operations.
The team must maintain strict SLOs while migrating services to a new cloud provider. Design an operational plan that ensures SLOs are met during migration, including canary strategies, rollback triggers, monitoring guardrails, and stakeholder communication.
Sample Answer
Direct answer: Maintaining strict SLOs during a migration to a new cloud provider requires treating the migration itself as a controlled, gradual rollout (canary-style) with the same rollback discipline as any risky production change, plus explicit monitoring guardrails that compare the new provider's performance against the SLO baseline in real time, not just after the fact.
Structured elaboration. Canary strategies: shift a small percentage of traffic to the new provider first, monitoring SLO-relevant metrics (latency percentiles, error rate, availability) specifically for that canary slice compared to the control (remaining traffic on the original provider), before increasing the percentage; this is the primary tool for catching an SLO-impacting problem before it affects the full user base. Rollback triggers: define SLO-based automated or semi-automated rollback triggers up front (e.g., "if the canary slice's p99 latency exceeds baseline by more than X% for more than Y minutes, automatically shift traffic back"), rather than relying on a human noticing a dashboard during the migration window. Monitoring guardrails: instrument the SAME SLO metrics identically on both the old and new provider (a common gap is the new environment's monitoring being set up differently, making an apples-to-apples SLO comparison impossible exactly when it matters most), and monitor not just steady-state performance but also FAILURE-MODE behavior (does the new provider's infrastructure fail the same way under load, e.g., does autoscaling respond at a similar speed). Stakeholder communication: since SLOs are often tied to external commitments (SLAs with customers, internal reliability commitments), stakeholders who own those commitments should be briefed on the migration's canary plan and rollback criteria BEFORE it starts, and kept informed of canary results at each stage, not just notified after a problem occurs.
Worked example. Start the canary at 1% of traffic on the new provider, holding for a period long enough to observe SLO-relevant metrics across a representative traffic pattern (e.g., a full business-hours cycle, since load-dependent SLO risks may not show up in a quiet overnight window); if SLO metrics hold within an agreed tolerance band of the baseline (concretely: p99 latency within 15% of the pre-migration baseline, and error rate within 1.2x of baseline), increase to 5%, then 25%, then 50%, then 100%, with the same hold-and-validate discipline at each step, and an automated rollback trigger active throughout that would immediately shift the canary percentage back to 0% if SLO metrics breach the pre-agreed threshold: concretely, if the canary slice's p99 latency exceeds the pre-migration baseline by more than 15% for more than 5 consecutive minutes, OR its error rate exceeds 1% for more than 2 consecutive minutes, whichever fires first.
Trade-offs & pitfalls. Increasing the canary percentage on a fixed calendar schedule (e.g., "double it every day regardless") rather than gating each increase on the SLO metrics actually holding is a common way this kind of migration LOOKS controlled but isn't: the canary process only protects the SLO if each step is genuinely gated on evidence, not on a predetermined timeline.
Scenario: Post-migration, an application shows a 25% increase in average response latency. Describe a structured troubleshooting approach to find the root cause, including what telemetry to collect, how to isolate new cloud-specific factors, and short-term mitigations to reduce user impact.
Sample Answer
Direct answer: A 25% post-migration latency increase needs a structured, elimination-based troubleshooting approach: first confirm the regression is real and consistent (not a measurement artifact), then isolate WHERE in the request path the added latency is occurring, then determine whether the cause is genuinely cloud-specific (network topology, a different managed-service's performance characteristics) versus a migration-unrelated coincidence.
Structured elaboration. What telemetry to collect: distributed tracing spans covering the full request path (to see which specific hop or component accounts for the added latency, rather than just an aggregate end-to-end number), infrastructure-level metrics for the new environment (CPU/memory/network saturation, since a resource constraint that didn't exist on-prem could be the direct cause), and a side-by-side comparison against the PRE-migration baseline for the same traffic pattern (confirming this is genuinely a regression and not, say, a seasonal traffic increase that happened to coincide with the migration). How to isolate new cloud-specific factors: compare latency broken down BY COMPONENT (is the added latency in the application tier, the database, a network hop, a managed service that replaced a self-hosted one) rather than treating it as one undifferentiated number; cloud-specific candidates to check specifically include cross-availability-zone network hops that didn't exist in the on-prem topology, a managed database service's different performance characteristics under the same query patterns (e.g., a managed service may have different connection-pooling or cold-start behavior), and DNS/service-discovery resolution differences. Short-term mitigations to reduce user impact: if a specific bottleneck is identified but not yet fully understood/fixed, targeted mitigations might include caching to reduce load on a slow component, adjusting connection-pool or timeout settings that may not have been re-tuned for the new environment's characteristics, or, if the increase is severe enough, a partial rollback of the specific affected component while the root cause is investigated more thoroughly, rather than accepting the regression indefinitely while investigation continues.
Worked example. Distributed tracing reveals the added latency is concentrated in database query time, not in application logic or network transit. Comparing the new managed database's configuration against the old self-hosted one finds the connection pool size was left at a default that's smaller than what the on-prem setup had been tuned to, causing connection queueing under the same traffic load. Short-term mitigation: increase the connection pool size to match the previously-tuned on-prem value, immediately reducing the queueing-driven latency; longer-term, re-run the same performance-tuning exercise the on-prem database originally went through, since a straight migration doesn't automatically carry forward tuning that was done empirically over time on the old system.
Trade-offs & pitfalls. Assuming the regression must be "just how the cloud is" (accepting a performance hit as an inherent cost of migration) without actually tracing to a specific, addressable cause is a common way a fixable configuration gap (like the untuned connection pool above) goes unaddressed indefinitely; most post-migration latency regressions have a specific, findable cause, not a vague "cloud is different" explanation.
You must migrate a transactional on-premises database to the cloud with near-zero downtime. Outline a cutover and rollback plan covering pre-migration validation, CDC or replication setup, synchronization verification, final cutover sequence, testing/verification after cutover, and explicit rollback triggers and steps. Mention tools or services you might use.
Sample Answer
Direct answer: Structure the cutover as: pre-migration validation, then continuous change-data-capture (CDC) replication to build and maintain a synchronized target, then a short cutover window (stop writes, drain lag, verify, repoint), with explicit, pre-agreed rollback triggers rather than an ad hoc judgment call during the window.
Structured elaboration. Pre-migration validation: confirm the target database is provisioned and tuned correctly (indexes, connection limits, parameter groups matching or exceeding source), run a full initial data load and a first-pass checksum/row-count comparison BEFORE relying on it for anything, and validate the CDC pipeline itself on non-critical tables first. CDC or replication setup: enable log-based replication from source to target, let it run long enough to validate it keeps up under real production write volume (not just during a quiet testing window), monitor replication lag continuously. Synchronization verification: periodic (e.g., hourly) row-count and checksum comparisons on a sample of tables throughout the replication period, not just once at the end, so a silently-diverging replication stream is caught early rather than discovered at cutover. Final cutover sequence: (1) announce the maintenance window to stakeholders, (2) put the application into a brief write-pause or read-only mode, (3) wait for replication lag to reach zero, (4) run a final full parity check (row counts and checksums across all migrated tables, not a sample), (5) repoint the application's connection string to the target, (6) remove the write-pause. Testing/verification after cutover: run the application's smoke tests against the new database, monitor error rates and query latency for an elevated period post-cutover, and keep the source database available (read-only) for a defined bake period in case rollback is needed. Explicit rollback triggers: define BEFORE the cutover window, not during it: e.g., "if the final parity check finds any discrepancy," "if replication lag doesn't reach zero within 15 minutes of write-pause," or "if post-cutover error rate exceeds 2x baseline within the first 30 minutes" all trigger an immediate rollback to the source, no live debate required in the moment.
Worked example. For a database expected to have a 10-minute maintenance window: minutes 0-5 write-pause and lag-drain (the phase does not advance until lag reaches zero; if lag has NOT reached zero by minute 5, that is itself the rollback trigger, and the plan aborts here rather than proceeding into parity checking against a target that never finished catching up), minutes 5-8 final parity check across all tables (only entered once lag-drain succeeded within its 5-minute budget), minutes 8-9 repoint application and run smoke tests, minutes 9-10 remove write-pause and begin elevated post-cutover monitoring. If the rollback trigger fires at minute 5, the in-progress parity-check phase never starts: writes resume against the still-authoritative source immediately, and the target is discarded rather than repaired, since nothing has been repointed to it yet. Tools: a managed CDC/migration service for replication, a lightweight parity-check script (checksums per table, compared source vs. target) run both periodically during replication and as the final gate.
Trade-offs & pitfalls. Defining rollback triggers DURING the cutover window under time pressure, rather than agreeing them beforehand, is the most common way a fixable problem turns into an extended, improvised outage: a pre-agreed "if X, then rollback, no discussion" rule removes the temptation to push through a warning sign because the team is already committed to the window.
A database migration to cloud failed during cutover and you need to perform a rollback while minimizing data loss and user impact. Describe a rollback strategy that accounts for: delta between cutover attempt and rollback, ongoing writes during rollback, necessary restoration steps, communications to users, and tests to validate that rollback succeeded and systems are consistent.
Sample Answer
Direct answer: A rollback after a failed cutover has to account for the DELTA of writes that landed on the new system before the failure was caught, not just "restore the old system and repoint": failing to reconcile that delta is the most common way a rollback itself causes data loss.
Structured elaboration. Delta between cutover attempt and rollback: from the moment traffic was repointed to the new database until the rollback decision, any writes that succeeded against the new system exist ONLY there; simply repointing back to the old (now stale) system silently discards them unless they're captured and reconciled. Ongoing writes during rollback: if the rollback itself takes any non-zero time, the application needs to either be paused (safest, but extends the outage) or explicitly handle writes landing on a system that's mid-rollback, which is risky enough that pausing writes is usually the right trade despite the extra downtime. Necessary restoration steps: (1) pause writes immediately upon deciding to roll back, (2) extract every write that landed on the new (failed) system since cutover (from the new system's transaction log or change-data-capture (CDC) stream, not from application logs, which are an unreliable secondary source), (3) replay those writes onto the old system in the correct order, handling any conflicts (e.g., a row updated on both systems independently, which shouldn't happen if writes were properly paused during cutover but needs a defined resolution rule if it does), (4) verify the old system now reflects every write that was ever accepted anywhere, (5) repoint the application back to the old system, (6) resume writes. Communications to users: acknowledge the issue and expected resolution time as soon as the rollback decision is made, not after it completes, since a longer-than-usual outage without communication erodes trust faster than the outage itself; a follow-up communication after resolution should be honest about whether any data or functionality was affected. Tests to validate rollback succeeded: row-count and checksum parity between what the new system had at the moment of failure and what the old system has post-replay (confirming no writes were lost in the replay), plus application-level smoke tests against the old system to confirm normal operation resumed cleanly.
Worked example. Say cutover happened at 2:00 PM, and a critical bug was discovered at 2:20 PM. Every write accepted by the new database between 2:00 and 2:20 (order IDs, inventory updates, etc.) must be extracted from the new system's transaction log and replayed onto the old system before repointing back, in the order they originally committed, so that the 20 minutes of activity isn't simply lost. If replay can't complete cleanly (e.g., a write on the new system conflicts with a change that had ALSO happened on the old system, which would indicate the write-pause during original cutover didn't fully take effect), that's escalated as a data-integrity incident, not resolved by an automated best-guess.
Trade-offs & pitfalls. The most damaging shortcut is announcing a rollback is complete once traffic is repointed, without confirming the delta-replay actually succeeded and was verified: a rollback that silently drops 20 minutes of orders is arguably worse than the original problem that triggered it, since it converts a visible outage into an invisible data-loss incident.
Create an automated runbook (describe steps, alerts, and sample scripts) to handle a failed cutover where API latency spikes and error rate exceed thresholds. Include automatic mitigations (traffic shift, circuit breaker), operator escalation steps, required logs/metrics to collect for RCA, and communications templates for stakeholders and customers.
Sample Answer
Direct answer: An automated runbook for a failed cutover with API latency spikes and elevated error rates should lead with automatic traffic mitigation (shift traffic away from the failing path, engage a circuit breaker) BEFORE any human is paged, since the fastest reduction in user impact comes from automated action, with the human escalation focused on diagnosis and the go/no-go decision on full rollback versus a targeted fix.
Structured elaboration. Automatic mitigations: traffic shift (if the cutover was gradual/canary, immediately shift the affected traffic slice back to the known-good path; if it was a full cutover, this may mean triggering the broader rollback path) and a circuit breaker (automatically stop calling a downstream dependency that's returning errors or timing out, failing fast rather than letting latency compound as requests queue up waiting on a struggling dependency), both triggered automatically on the alert condition (e.g., error rate or p99 latency crossing a pre-defined threshold) rather than waiting for a human to notice and act. Operator escalation steps: once automatic mitigation has reduced immediate user impact, page an on-call operator with a structured alert (what threshold was breached, what automatic mitigation already fired, current system state) so the human's first action is diagnosis, not firefighting an unmitigated spike. Required logs/metrics to collect for RCA: request-level tracing spans covering the cutover window (to pinpoint exactly which requests/dependencies were affected), the specific error responses/status codes returned (not just an aggregate error-rate number), infrastructure-level metrics (CPU/memory/connection-pool saturation) for the new environment specifically, and a timeline correlating the automatic mitigation actions against the metric trends, all captured automatically by the runbook rather than requiring the operator to manually gather them under pressure. Communications templates for stakeholders and customers: pre-written templates for an initial "we're aware and investigating" notice, an update once mitigation has reduced impact, and a resolution/root-cause notice, so the on-call operator isn't drafting stakeholder communications from scratch during an active incident, which both wastes time and risks a poorly-worded update going out under stress.
Worked example. Sample automated steps: (1) alert fires on p99 latency > 2x baseline OR error rate > 5% sustained for 2 minutes; (2) automated action shifts the affected traffic percentage back to the pre-cutover path (or, for a canary, halts any further traffic-percentage increase and reverts the current increment); (3) circuit breaker automatically opens against any downstream dependency showing a correlated error spike; (4) on-call operator paged with a pre-populated incident summary (threshold breached, automatic actions taken, current traffic split, links to the relevant trace/log dashboards); (5) operator confirms mitigation held (error rate/latency returning toward baseline) and decides whether a full rollback of the cutover is needed or whether the automatic partial mitigation is sufficient while a targeted fix is developed; (6) pre-written stakeholder communication templates are used at each stage (initial notice, mitigation update, resolution).
Sample scripts. The runbook's automatic mitigation step needs to be an actual callable script, not just a described intention. Two representative examples:
Traffic-shift script (invoked by the alert, calls the load balancer's API to revert the canary/cutover traffic split):
#!/usr/bin/env bash
# shift_traffic_back.sh - reverts weighted routing to the pre-cutover target group
set -euo pipefail
OLD_TARGET_GROUP_ARN="$1"
NEW_TARGET_GROUP_ARN="$2"
LISTENER_ARN="$3"
aws elbv2 modify-listener \
--listener-arn "$LISTENER_ARN" \
--default-actions Type=forward,ForwardConfig="{TargetGroups=[{TargetGroupArn=$OLD_TARGET_GROUP_ARN,Weight=100},{TargetGroupArn=$NEW_TARGET_GROUP_ARN,Weight=0}]}"
echo "traffic reverted to $OLD_TARGET_GROUP_ARN at $(date -u +%FT%TZ)"
Circuit-breaker check (run on a short interval; flips a feature flag that the application reads before calling the downstream dependency, so the app stops calling it without a deploy):
def circuit_breaker_tick(metrics_client, flag_client, error_rate_threshold=0.05, window_s=120):
"""Poll the downstream dependency's recent error rate; open the breaker (disable calls)
if it's unhealthy, close it again once it recovers."""
error_rate = metrics_client.get_error_rate(window_seconds=window_s)
breaker_open = flag_client.get('downstream_dependency_circuit_open', default=False)
if error_rate > error_rate_threshold and not breaker_open:
flag_client.set('downstream_dependency_circuit_open', True)
return 'opened'
if error_rate <= error_rate_threshold and breaker_open:
flag_client.set('downstream_dependency_circuit_open', False)
return 'closed'
return 'unchanged'
Alert rule definition (the trigger condition for both scripts above; expressed as a Prometheus-style alerting rule):
groups:
- name: cutover-health
rules:
- alert: CutoverLatencyOrErrorSpike
expr: (histogram_quantile(0.99, http_request_duration_seconds_bucket) > (2 * baseline_p99_latency))
or (rate(http_requests_total{status=~"5.."}[2m]) / rate(http_requests_total[2m]) > 0.05)
for: 2m
labels:
severity: page
annotations:
summary: "Cutover health breach: p99 latency or error rate over threshold for 2m"
runbook: "shift_traffic_back.sh + circuit_breaker_tick, then page on-call"
These are illustrative implementations meant to show the SHAPE of a real script (idempotent, parameterized, logged), not a verified execution trace; the specific API calls would be swapped for whatever load balancer, feature-flag service, and alerting stack the team actually runs.
Communications templates, differentiated by audience. Stakeholders (internal, e.g., engineering leadership and the business owner of the migrated system) get more technical detail and a timeline they can act on: "Cutover for [system] triggered automatic mitigation at [time] due to [threshold breached]. Current impact: [traffic %/error rate]. ETA to full resolution: [estimate]. Rollback decision expected by [time]." Customers get a simpler, impact-focused notice with no internal detail: "We're aware of an issue affecting [feature/service] and are actively working on it. We'll update this notice within [X] minutes." Using the same wording for both audiences either overwhelms customers with irrelevant internal detail or under-informs the internal stakeholders who need to make the rollback call.
Trade-offs & pitfalls. A runbook that pages a human FIRST and waits for manual traffic-shifting action is meaningfully slower than one that automates the first mitigation step; the minutes saved by automatic action, before any human even acknowledges the page, often make the difference between a brief, contained blip and a customer-visible outage.
Unlock Full Question Bank
Get access to all 8 Cloud Migration Strategy and Execution interview questions and detailed answers.
Sign in to ContinueJoin thousands of developers preparing for their dream job.