Skip to Content
Cloud Engineering Academy
12. High Availability & Disaster Recovery

Active-active vs active-passive: consistency, conflicts and single-writer ledgers

Understand what changes when two Regions both accept writes: replication lag, conflict resolution, last-writer-wins, strong consistency, and why most banking ledgers stay single-writer with a hot or warm second Region.

advancedโฑ 1 h 40 min๐ŸŸข FreeSAA-C03SAP-C03DOP-C02

Assumes: .NET 10 LTS ยท AWS CLI v2 ยท Region us-east-1 (second Region us-west-2, design-only). Verified against official sources on 2026-11-18.

Learning objectives

By the end of this lesson you can:

  • Define active-passive, active-active, read local / write global, write local and write partitioned, and say which problem each solves.
  • Explain how last-writer-wins loses a concurrent debit, using a runnable model, and why that is unacceptable for a balance.
  • Describe the two consistency modes of DynamoDB global tables (eventual and strong) and the limits that come with strong consistency.
  • Explain Aurora Global Database as a single-writer design, including write forwarding, switchover and failover.
  • Explain why a single-writer, partitioned-by-account design meets most banking needs, and what it costs in latency and complexity.
  • Choose an active-active pattern per data type: reference data, sessions, events, balances, idempotency records.

Prerequisites

Why this matters in banking

Harbourline's engineers are asked: "can we run the payments ledger in two Regions at once so that a Regional failure costs us nothing?" It sounds reasonable. Consider the smallest possible case.

A customer has 100 pounds. At the same instant, one payment arrives in the London Region and another in the Dublin Region. Each Region checks the balance (100), approves its own payment (60 and 70) and writes the new balance (40 and 30). Replication then runs. If the system resolves conflicts by "latest write wins", both Regions end up with a balance of 30. The bank has approved 130 pounds of payments, but only 70 pounds have left the account. Sixty pounds of customer money have effectively been created. If instead both postings are kept, the balance is minus 30 and the customer is overdrawn without any decision to allow it.

Neither outcome is a bug in AWS. It is the consequence of letting two places decide the same thing at the same time. That is the central problem of active-active, and it is why the honest answer to the question is usually: active-active for the things that tolerate conflicts, and a single writer per account for balances.

The idea in plain language

Active-passive: one Region (the active one) accepts all writes and serves traffic. A second (passive) Region has a copy of the data and is ready to take over. When it takes over, it becomes the new active. Pilot light, warm standby and hot standby are active-passive.

Active-active: more than one Region serves live traffic. Reads are served locally for latency. The hard part is writes.

AWS's guidance names three ways to handle writes in an active-active design:

PatternIdeaFitsCost
Write globalAll writes go to one Region (the primary); other Regions read locally. If the primary fails, another is promotedRelational ledgers; Aurora Global DatabaseWriters far from the primary pay latency; failover needed for writes
Write localEach Region accepts writes for the same data and replication reconciles themData that tolerates conflicts: profiles, preferences, shopping-cart-like data; DynamoDB global tablesConcurrent updates to the same item need a conflict rule
Write partitionedEach item has one home Region chosen by a key (for example account ID); that Region alone writes itPer-customer or per-account dataRequests for an account must be routed to its home Region; losing a Region means re-homing its accounts

Write global and write partitioned both keep one writer per piece of data at a time. That is the property a ledger needs. Write local gives up that property and must replace it with something cleverer.

Analogy: two tellers in two cities each have a copy of a customer's passbook. If both are allowed to update the passbook, they must later reconcile conflicting entries, and some rule must decide what happens to the customer's money. If instead each customer has one home branch that updates the passbook while the other branch only reads a copy, there is nothing to reconcile, and the cost is that a customer far from the home branch waits longer, and if the home branch closes you must move the passbook.

Why conflicts are inevitable

Replication between Regions takes time (for AWS cross-Region replication, typically around a second or less for DynamoDB global tables and Aurora Global Database, according to AWS; โš  VERIFY current wording). During that window two Regions can both accept a write to the same item. The system needs a conflict resolution rule. The common ones:

RuleHow it worksGood forDangerous for
Last writer wins (LWW)The write with the latest timestamp survives; the other is discardedSettings, preferences, "last seen", cachesAnything additive or invariant-bound: balances, counters, inventory
Merge (CRDT-style)Combine both writes without loss, for example a union of immutable eventsEvent logs, append-only ledgers, sets, countersRules like "balance must not go below zero", which no single replica can check alone
Application-level reconciliationDetect conflicts and run business logic (compensating transactions, manual review)Rare, high-value conflictsHigh volume (too many to review)
Avoid conflictsRoute so that two Regions never write the same item (partitioning)Per-account dataCross-account operations (transfers) need coordination

Strong consistency across Regions

You can also remove conflicts by making the write synchronous: a write is acknowledged only after other Regions have it. DynamoDB global tables offer this as multi-Region strong consistency (MRSC). It brings a recovery point objective of zero and reads that always see the latest write, at the price of higher write latency (cross-Region round trips) and several feature limits. It is the closest AWS gets to "active-active without lost updates" for DynamoDB, and it is still a fit only for specific data and Regions.

What problem the AWS service solves

DynamoDB global tables replicate a table across Regions so that applications can read and write in each. Key points from the current documentation:

  • A global table has one replica per Region; each replica has the same name, key schema and items. The availability SLA is higher than for a single-Region table (the documentation states 99.999 percent versus 99.99 percent).
  • Default mode: multi-Region eventual consistency (MREC). Writes replicate asynchronously, typically within a second or less. Concurrent writes to the same item are resolved by last writer wins, per item, using the latest internal timestamp. Strongly consistent reads return the latest version only if it was written in the same Region; they may return stale data otherwise. Conditional writes evaluate against the local version. Transactions are atomic only inside the Region where they run. RPO equals the replication delay.
  • Optional mode: multi-Region strong consistency (MRSC). Writes are replicated synchronously to at least one other Region before success. The table must be deployed in exactly three Regions: three replicas, or two replicas plus a witness. Strongly consistent reads on any replica return the latest data; conditional writes evaluate against the latest version. A write that collides with an in-flight update in another Region fails with ReplicatedWriteConflictException and can be retried. RPO is zero. Limits include: no TTL, no local secondary indexes, no transactions, availability only in listed Regions, and higher latency. The consistency mode cannot be changed after creation, and an existing table must be empty to convert โš  VERIFY these details and the Region list in the current documentation before designing.
  • Replication consumes write capacity on the replicas; plan for it.

Aurora Global Database is a single-writer design: one primary Region accepts writes; up to five secondary Regions hold read-only copies updated by storage-level replication with typical latency under a second (AWS's description). On a Regional problem you can promote a secondary to take read/write in less than one minute, according to AWS's DR whitepaper. Write forwarding lets a secondary accept SQL write statements and forward them to the primary: the application sees local endpoints, but the writes still happen in one place. Two operations matter: switchover (planned, no data loss, roles swap) and failover (unplanned, you accept the data not yet replicated). โš  VERIFY the current wording and limits in the Aurora Global Database guide.

Amazon Aurora DSQL is a different product with a multi-Region active-active, strongly consistent design for PostgreSQL-compatible workloads (generally available since 2025, as noted in the databases module). Its trade-offs (optimistic concurrency, feature coverage) deserve their own evaluation โš  VERIFY features, Regions and pricing before considering it for a ledger.

Messaging and events (SQS queues, SNS, EventBridge global endpoints, Kafka MirrorMaker, and so on) can replicate or route across Regions; at-least-once delivery means consumers must be idempotent.

Honest limits:

  • Active-active is not free resilience. It adds consistency design, operational complexity, test surface and cost, and every extra moving part can fail.
  • Asynchronous replication means a non-zero RPO for a Regional failure unless you pay for synchronous modes.
  • Failure correlation remains. A bad deployment, a shared bug or corrupted data reaches both Regions.
  • Cross-Region transactions are not a thing you get for free. Operations that touch several accounts across home Regions (a transfer) need a protocol (saga, outbox, idempotent messages).

Microsoft / Azure comparison

You know (Microsoft/Azure)AWS equivalentWhat's different
Cosmos DB multi-region writes with conflict resolution policy (LWW or custom)DynamoDB global tables MREC (LWW only)No custom resolution procedure; model conflict-free data or use MRSC
Cosmos DB strong consistency across regions (restricted)DynamoDB global tables MRSCExactly three Regions, witness option, feature limits
SQL geo-replication / auto-failover groups (single writer)Aurora Global Database (single writer, switchover/failover)Storage-level replication; managed secondary promotion
Azure SQL read-scale secondaryAurora secondary Region readers, write forwardingWrite forwarding sends writes to the primary Region
Service Bus geo-disaster recovery pairingSQS/SNS/EventBridge patterns; you design cross-RegionNo single "pairing" feature for all messaging
Front Door with active-active originsRoute 53 latency/weighted policies, Global AcceleratorRouting is separate from data
Distributed transactions (MSDTC)Sagas, outbox, idempotencyCross-Region two-phase commit is not offered; design for eventual outcomes

Architecture

Three ways to place writes across two Regions:

The lost-update problem, step by step:

Security-boundary view: both Regions are production. They need the same IAM boundaries, KMS keys per Region (or multi-Region keys), the same logging and the same data-residency approval. A write-partitioned design also needs strong routing integrity: if a request is routed to the wrong Region, it must be rejected, not applied. Authenticate the router and sign the routing decision.

Step-by-step implementation

This is a design and modelling lesson. You implement the models first, then decide.

Classify each data type by how conflicts should be handled

Make a table: reference data (product list, branch list), customer profile, session state, idempotency keys, events and notifications, balances and postings. Beside each, write what happens if two Regions change it at once and who would notice.

Run the conflict models

In the lab library, LastWriterWinsReplica models a DynamoDB-global-tables-style table, LedgerReplica models an append-only ledger, and HomeRegionRouter models write-partitioned routing. Run ReplicationModelTests and read each test's name as a sentence about banking.

Decide per data type

Use this rule of thumb: if two simultaneous writes can be merged without losing information and without breaking a business rule, write local is fine. If a business rule spans the data (balance not below zero), keep one writer.

Choose the ledger design

For the ledger, choose write global (Aurora Global Database) or write partitioned (home Region per account). Decide the failover behaviour: what happens to accounts homed in a failed Region (re-home to the other Region after promotion, with a documented RPO).

Design the cross-account flows

Transfers between accounts with different home Regions are a saga: debit at the source home Region, publish an event, credit at the destination home Region, with idempotency keys and a compensating step for failure. Write the state diagram.

Write the failure-mode table and test it

For each failure (Region loss, partition, replication lag spike, bad deployment), say what each Region does. Test the lag alarm and the re-homing process in a drill.

AWS Console instructions

  • DynamoDB global tables: Console โ†’ DynamoDB โ†’ Tables โ†’ your table โ†’ Global tables tab โ†’ Create replica. When creating a table intended for MRSC, the consistency-mode choice appears at creation time (it cannot be changed later) โš  VERIFY the current console flow.
  • Replication latency: Console โ†’ CloudWatch โ†’ Metrics โ†’ DynamoDB โ†’ ReplicationLatency (published for MREC global tables, per source and destination Region pair; MRSC tables do not publish it).
  • Aurora Global Database: Console โ†’ RDS โ†’ Databases โ†’ Add AWS Region on a cluster to create a global database; Actions โ†’ Switch over or fail over global database for planned and unplanned operations โš  VERIFY labels.

AWS CLI

PROFILE=learn-sandbox

# DynamoDB: describe a global table's replicas and consistency mode (illustrative table name; no table is created in this lesson).
aws dynamodb describe-table --table-name hl-idempotency --profile $PROFILE --region us-east-1 \
  --query "Table.{Replicas:Replicas[].RegionName,Mode:MultiRegionConsistency,Status:TableStatus}"

# Add a replica to an existing (empty or MREC) table in another Region (creates cost; do not run casually).
aws dynamodb update-table --table-name hl-idempotency --profile $PROFILE --region us-east-1 \
  --replica-updates 'Create={RegionName=us-west-2}'

# Aurora Global Database: see the members and which Region is the writer.
aws rds describe-global-clusters --profile $PROFILE --region us-east-1 \
  --query "GlobalClusters[].{Id:GlobalClusterIdentifier,Members:GlobalClusterMembers[].{Arn:DBClusterArn,Writer:IsWriter}}"

# Planned switchover (no data loss) and unplanned failover (accepts loss of un-replicated data). Names are examples.
aws rds switchover-global-cluster --global-cluster-identifier hl-ledger-global \
  --target-db-cluster-identifier arn:aws:rds:us-west-2:111122223333:cluster:hl-ledger-dr --profile $PROFILE --region us-east-1
aws rds failover-global-cluster --global-cluster-identifier hl-ledger-global \
  --target-db-cluster-identifier arn:aws:rds:us-west-2:111122223333:cluster:hl-ledger-dr --profile $PROFILE --region us-east-1

โš  VERIFY every command name and argument against your CLI version; global tables and global cluster commands change as features are added. These commands touch multi-Region resources: use them only in a sandbox, and only with a clean-up plan.

Infrastructure as Code

The patterns are mostly data design, with a small infrastructure footprint. A DynamoDB table with replicas looks like this (illustrative, not part of the compiled lab):

// DynamoDB table with a replica in another Region (MREC). Needs a stack that has an explicit environment.
var table = new TableV2(this, "Idempotency", new TablePropsV2
{
    PartitionKey = new Attribute { Name = "pk", Type = AttributeType.STRING },
    Billing = Billing.OnDemand(),
    PointInTimeRecoverySpecification = new PointInTimeRecoverySpecification { PointInTimeRecoveryEnabled = true },
    DeletionProtection = true,
    Replicas = [new ReplicaTableProps { Region = "us-west-2" }],
    // Strong multi-Region consistency requires a different shape (three Regions or a witness); check the construct's
    // current properties before using it โš  VERIFY.
});

Idempotency records are a good fit for write-local replication: each record is written once under a unique key, and a duplicate write of the same key with the same value is harmless. Balances are not.

Complete code

The models are small on purpose, so that you can see the conflict. They are in labs/m12-resilient-account-api/src/Harbourline.Resilience/ReplicationModels.cs and covered by ReplicationModelTests.

ReplicationModels.cs
namespace Harbourline.Resilience;

public sealed record Versioned(decimal Value, long Timestamp, string Region);

// A toy multi-active key-value replica using "last writer wins", the DynamoDB global tables (MREC) conflict rule.
public sealed class LastWriterWinsReplica(string region)
{
    private readonly Dictionary<string, Versioned> _items = [];

    public string Region => region;

    public void Put(string key, decimal value, long timestamp) => _items[key] = new Versioned(value, timestamp, region);

    public decimal? Get(string key) => _items.TryGetValue(key, out var v) ? v.Value : null;

    public void MergeFrom(LastWriterWinsReplica other)
    {
        foreach (var (key, incoming) in other._items)
        {
            if (!_items.TryGetValue(key, out var current) || Wins(incoming, current))
            {
                _items[key] = incoming;
            }
        }
    }

    private static bool Wins(Versioned incoming, Versioned current) =>
        incoming.Timestamp > current.Timestamp
        || (incoming.Timestamp == current.Timestamp && string.CompareOrdinal(incoming.Region, current.Region) > 0);
}

// A toy append-only ledger: merge is a set union, so replicas converge and no posting is lost.
public sealed class LedgerReplica(string region)
{
    private readonly Dictionary<Guid, decimal> _postings = [];

    public decimal Balance => _postings.Values.Sum();

    public int PostingCount => _postings.Count;

    public void Post(Guid id, decimal amount) => _postings[id] = amount;

    // Enforces the overdraft rule against THIS replica's view only.
    public bool TryDebit(Guid id, decimal amount)
    {
        if (amount <= 0m) throw new ArgumentOutOfRangeException(nameof(amount));
        if (Balance - amount < 0m) return false;
        _postings[id] = -amount;
        return true;
    }

    public void MergeFrom(LedgerReplica other)
    {
        foreach (var (id, amount) in other._postings)
        {
            _postings.TryAdd(id, amount); // same posting id = same posting: idempotent
        }
    }
}

public static class HomeRegionRouter
{
    public static string HomeRegion(string accountId, IReadOnlyList<string> regions)
    {
        // FNV-1a: deterministic across processes and machines (string.GetHashCode() is randomised per process).
        var hash = 2166136261u;
        foreach (var c in accountId) hash = (hash ^ c) * 16777619u;
        return regions[(int)(hash % (uint)regions.Count)];
    }
}

The central test, reading like the story at the top of the lesson:

ReplicationModelTests.cs (excerpt)
[Fact]
public void Last_writer_wins_loses_a_concurrent_debit()
{
    var london = new LastWriterWinsReplica("eu-west-2");
    var dublin = new LastWriterWinsReplica("eu-west-1");

    london.Put("ACC-1", 100m, timestamp: 1);
    dublin.MergeFrom(london);                       // both start at 100

    london.Put("ACC-1", 100m - 60m, timestamp: 10); // rent: 40 left
    dublin.Put("ACC-1", 100m - 70m, timestamp: 11); // card payment: 30 left

    london.MergeFrom(dublin);
    dublin.MergeFrom(london);

    Assert.Equal(30m, london.Get("ACC-1"));         // both replicas agree on 30:
    Assert.Equal(30m, dublin.Get("ACC-1"));         // the 60 debit has vanished
}

[Fact]
public void An_append_only_ledger_never_loses_a_posting_but_can_overdraw()
{
    var london = new LedgerReplica("eu-west-2");
    var dublin = new LedgerReplica("eu-west-1");

    london.Post(Guid.CreateVersion7(), 100m);
    dublin.MergeFrom(london);

    Assert.True(london.TryDebit(Guid.CreateVersion7(), 60m)); // each Region approves from its own view
    Assert.True(dublin.TryDebit(Guid.CreateVersion7(), 70m));

    london.MergeFrom(dublin);
    dublin.MergeFrom(london);

    Assert.Equal(-30m, london.Balance);                       // nothing lost, but overdrawn
}

[Fact]
public void A_single_writer_refuses_the_second_debit()
{
    var home = new LedgerReplica("eu-west-2");
    home.Post(Guid.CreateVersion7(), 100m);

    Assert.True(home.TryDebit(Guid.CreateVersion7(), 60m));
    Assert.False(home.TryDebit(Guid.CreateVersion7(), 70m));  // sees 40, refuses: the invariant holds
}

Code explained line by line

  1. Versioned(Value, Timestamp, Region) is what a last-writer-wins store keeps per item: the value and when and where it was written.
  2. LastWriterWinsReplica.MergeFrom models replication: for each item from the other replica, keep whichever has the later timestamp. The tie-break by Region name makes the rule deterministic so two replicas that exchange everything always end up identical (convergence).
  3. In Last_writer_wins_loses_a_concurrent_debit, each Region reads 100 and writes the result of its own debit (40 and 30). LWW compares only timestamps, not the intent ("subtract 60"). The later write replaces the earlier one entirely, so the 60-pound debit disappears.
  4. LedgerReplica stores postings (facts) with unique IDs, not a balance. MergeFrom is a union, which is commutative, associative and idempotent: in any order, any number of times, replicas converge and no fact is lost.
  5. TryDebit checks Balance - amount < 0 against the replica's own postings. That is correct locally and wrong globally: each Region sees 100, both approve, and after the merge the balance is minus 30.
  6. In the single-writer test, one replica sees all debits in sequence, so the second sees 40 and refuses. The invariant holds because there is only one place to check it.
  7. HomeRegionRouter.HomeRegion makes the single writer per account: a stable FNV-1a hash picks one of the Regions, so account ACC-0000000001 always has the same home. string.GetHashCode() is avoided because .NET randomises it per process, which would send the same account to different Regions on different servers.

Security considerations

  • Conflict handling is an integrity control. Choosing last writer wins for money is a design defect with security consequences: an attacker or a bug that can trigger concurrent writes can make value disappear or appear. Record the choice and the rationale in the threat model (Threat modelling with STRIDE).
  • Routing integrity (write partitioned). A request that reaches the wrong Region must be refused. Include the intended home Region in a signed request or check the account's home server-side.
  • Idempotency everywhere. Replication, retries and failover all produce duplicate deliveries; every money-moving write needs an idempotency key and a de-duplication store (a good use of a global table).
  • Same controls in both Regions. Encryption, IAM, logging, WAF and monitoring must be applied to every Region, with drift detection.
  • Audit trail across Regions. Evidence of who did what must survive a Regional failure: ship audit logs to a protected account that is not in the failing Region.

โš  Learning shortcut โ€” not for production

The replica models use a single process, wall-clock-free timestamps and decimal values to make the conflicts visible. They do not model network partitions, clock skew, partial replication, retries or failure, all of which real systems must handle. Production decisions about multi-Region data need a design review, a failure-mode analysis and a rehearsed failover. Regulatory expectations about data location, resilience and third-party concentration are for Harbourline's legal, compliance and operational-resilience teams to decide.

Banking use case

Harbourline's data placement decisions for its two-Region design (illustrative):

DataPatternWhy
Product catalogue, branch list, FX rate snapshotsWrite local (DynamoDB global table, eventual)A conflicting write is rare and harmless; last value wins
Idempotency recordsWrite localEach key is written once; duplicates are identical
Customer notification preferencesWrite localLast change wins; a lost update is a minor inconvenience
User sessionsRegional (not replicated)Re-authentication after a Regional failure is acceptable
Account balances and postings (ledger)Write partitioned by account, backed by Aurora Global Database per partition, or single Region active with warm standbyA balance invariant needs one writer
Card authorisationWrite partitioned by card range with pre-authorisation limits held in each RegionSeconds-level RTO, with limits sized so a Region can act independently
Transfers between accounts in different home RegionsSaga with outbox and idempotent messagesNo cross-Region distributed transaction

For the Accounts API in this module's project the decision is simpler: single writer, Aurora Global Database, warm standby, because the stated RTO of 30 minutes does not require active-active.

Common mistakes

  • Using last writer wins for balances, counters or inventory. It discards one of two concurrent updates.
  • Assuming "multi-Region strongly consistent reads" cover conflicts. In eventual mode, strongly consistent reads only guarantee freshness within the Region that wrote.
  • Believing transactions replicate atomically. In global tables (eventual mode) a transaction is atomic only in its Region; other Regions may see part of it.
  • Active-active without a data-corruption plan. Both Regions replicate the corruption.
  • Ignoring replication lag. Reads in the other Region can be seconds stale. Show "as of" where it matters.
  • Choosing active-active because it sounds safer. More moving parts can reduce availability, and the RTO of minutes from warm standby may be enough.
  • Forgetting capacity. Each Region must absorb the other's traffic on failure; "two half-size Regions" is not active-active.

Troubleshooting

SymptomLikely causeFix
Balances differ between Regions for a few secondsNormal asynchronous replicationShow "as of", read the balance from the home Region for decisions
A balance is wrong after concurrent updatesLast writer wins on a derived valueStore postings, derive the balance, or use a single writer
ReplicatedWriteConflictException (MRSC tables)Concurrent writes to the same item in two RegionsRetry with backoff; reduce write contention on hot items
Writes throttled on replica tablesReplication consumes write capacityUse on-demand or raise provisioned write capacity
ReplicationLatency alarm firingNetwork or throttling issue between RegionsTreat the replica as stale; redirect traffic away; investigate
Duplicate payments after failoverRetries and replays without idempotencyAdd idempotency keys and a de-duplication table
Accounts "stuck" after a Region failsHome Region unavailable and no re-homing processDocument and rehearse re-homing with the agreed RPO

Cost and cleanup

This lesson costs nothing: the models run locally and no AWS resources are created. If you later experiment with real multi-Region services, global tables and Aurora Global Database bill for replicated writes, storage in each Region and cross-Region data transfer (โš  VERIFY current pricing); delete replicas and secondary clusters the same day.

# Nothing was created in this lesson. If you tried the CLI examples in a sandbox, remove replicas and global clusters:
aws dynamodb update-table --table-name hl-idempotency --replica-updates 'Delete={RegionName=us-west-2}' \
  --profile learn-sandbox --region us-east-1
aws resourcegroupstaggingapi get-resources --tag-filters Key=Project,Values=cea-lab \
  --profile learn-sandbox --region us-west-2 --query "ResourceTagMappingList[].ResourceARN"

Exercises

  • ๐ŸŸข Guided: Run ReplicationModelTests. For each of the three conflict tests write one sentence in banking terms: what the customer sees, and what the bank loses or risks.
  • ๐ŸŸก Challenge: Extend LedgerReplica with a reservation step: before approving a debit, a Region must reserve funds on a shared counter that only the home Region can change. Describe (in code comments or a short design note) what the Region does when the home Region is unreachable, and the trade-off between availability and overdraft risk.
  • ๐Ÿ”ด Live problem: "Product wants customers to pay from either Region with the lowest latency and zero downtime on a Region failure." Draft a one-page response: what can be active-active, what cannot, what a limit-based pre-authorisation scheme would look like, and what RTO and RPO you can honestly promise.

Assignment

Write docs/data-placement-decisions.md for Harbourline: a table of at least eight data types with the chosen replication pattern, the conflict rule, the failure behaviour and the evidence (test or drill) that supports the choice. Include a short section explaining why the ledger is single-writer.

Solutions

Knowledge check

Interview questions

  • "Can you run a payments ledger active-active across Regions?" Only with care. Partition by account so each account has one home Region, or use a synchronously replicated design accepting the latency. Last-writer-wins replication of balances loses updates. Offer a single-writer design with fast failover when the RTO allows it.
  • "How do you move money between accounts homed in different Regions?" A saga with idempotent steps: debit at the source home Region, publish via an outbox, credit at the destination, and a compensating step if the credit fails.
  • "When is DynamoDB global tables a good choice?" For data that tolerates last-writer-wins or that is written once and read many times: idempotency keys, reference data, preferences, session-like data. For MRSC when you need zero RPO and can accept three-Region, no-transaction limits.
  • "What is the cost of active-active?" Consistency design, higher run cost, more testing, a larger failure surface, and capacity in each Region to absorb the other's load.

Certification practice

Completion checklist

  • I can explain write global, write local and write partitioned
  • I can show how last writer wins loses a concurrent debit, using the lab test
  • I can say what DynamoDB global tables eventual and strong modes trade off
  • I wrote a data placement table for at least eight data types
  • I confirmed I created no multi-Region resources, or deleted any I did create

Key takeaways

  • Active-active is easy for reads and hard for writes: two Regions accepting the same write need a conflict rule.
  • Last writer wins is fine for preferences and wrong for balances; append-only merges never lose facts but cannot enforce cross-Region invariants.
  • Single writer per account (write global or write partitioned) is how most banking ledgers keep invariants, with warm standby or fast re-homing for resilience.
  • DynamoDB global tables fit conflict-tolerant data; strong consistency mode gives zero RPO with real limits.
  • Choose the pattern per data type and test it.

Further reading

Independent learning resource โ€” not affiliated with, endorsed or sponsored by Amazon Web Services. AWS and related marks are trademarks of Amazon.com, Inc. or its affiliates. All banking data in examples is fictional. Sample architectures are for learning and are not automatically compliant with GDPR, PCI DSS or any banking regulation.

On this page