INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: SQL Server failover and recovery

What to verify after an RDS for SQL Server failover

A database failover still leaves the application to reconnect and reconcile writes with unknown outcomes. Trace a Multi-AZ DB instance example to decide when the application has recovered.

What you will learn

Distinguish database failover, application reconnection, and reconciliation of business results. Choose which record to check before a retry.

Prerequisite

This uses a fictional Multi-AZ DB instance deployment of RDS for SQL Server.

Reconnect through the same endpoint after existing connections break

For RDS for SQL Server Multi-AZ, the same endpoint points to the new primary after a failover. An application can still have stale connections in its pool or cached address information. Include reconnection and reconciliation in the recovery plan.

A failover interrupts a fictional write
A failover interrupts a fictional write1: Write requested — Send the write — Connection lost. 2: Connection lost — Reconnect after the failover — Reconnect. 3: Reconnect — Check the stored business outcome — Reconcile123Write requestedConnection lostReconnectReconcileA failover interrupts a fictional write1: Write requested — Send the write — Connection lost. 2: Connection lost — Reconnect after the failover — Reconnect. 3: Reconnect — Check the stored business outcome — Reconcile123Write requestedConnection lostReconnectReconcile
  1. Write requested → Connection lostSend the write
  2. Connection lost → ReconnectReconnect after the failover
  3. Reconnect → ReconcileCheck the stored business outcome
Write requested
Assign request ID W-17
Connection lost
No response reached the client
Reconnect
Use the same configured endpoint
Reconcile
Look up the committed record for W-17

Separate the evidence available at each stage

Fictional attempt to save one image-intake record
EvidenceWhat it establishesNext check
RDS failover eventThe database service recorded a failoverCorrelate it with the application reconnection time.
A read succeeds after reconnectingThe new connection can serve that readLook up the outcome for W-17.
A committed row exists for W-17The business outcome for that request existsCheck whether the application can return the same result.

Correlate DNS behavior and old connections on the same timeline. The database failover can finish before all clients resume their business operations.

Reconcile uncertain writes by request ID

Measure connection recovery and job recovery separately. After reconnecting, look up the durable outcome for the same request ID. If it is absent, verify the database, lookup conditions, and any in-flight work before deciding to retry.

Use separate recovery timestamps. Failover duration depends on database activity and recovery conditions. This example supplies no production duration estimate or scheduled switch.

Choose the next application-side check

Choose an option to see the result and explanation.

The connection broke during failover. Which target should the application use?
Read the answer and reason

Answer: Open a new connection using the configured endpoint · Reconnect using the configured DB endpoint.

You reconnected and do not know whether W-17 committed. What next?
Read the answer and reason

Answer: Look up the committed record and outcome for W-17 · Check durable records for that request ID.

RDS reports the failover complete. What would establish application recovery?
Read the answer and reason

Answer: Required reads and operations succeed and users receive expected responses · Verify reconnection and the business outcomes.

Check, then explain in your own words

  1. Correlate RDS events with application connection failures.
  2. Check the reconnected database and the result lookup target.
  3. Use request outcomes to decide whether to retry and when to declare recovery.
Check your understanding: You lost the connection before receiving a write response. What should you check before retrying?

Look up the same request ID on the intended database and check for a committed business result.

The connection can close after the database has already committed the work.

Sources and conditions checked

The official references used in this lesson are collected here with their scope, conditions and corresponding sections. Independent expert review and live AWS comparison have not been performed.