Core banking integration
Connect cloud-native services to a legacy core banking system over hybrid networking and MQ-style messaging, using an anti-corruption gateway, stand-in reads, a circuit breaker and safe handling of unknown outcomes.
Assumes: .NET 10 LTS (file-based apps) · AWS SDK for .NET v4 · Amazon.CDK.Lib 2.277.0 · Terraform AWS provider v6 · Region us-east-1. Verified against official sources on 2026-11-18.
Learning objectives
By the end of this lesson you can:
- Explain why the core banking system stays the system of record and why cloud services must treat it as a fragile, slower dependency.
- Design hybrid connectivity (Direct Connect with VPN backup, Transit Gateway, DNS) for traffic between AWS and an on-premises core.
- Choose between synchronous calls, queued commands and change-data-capture, and say what each costs in consistency.
- Build an anti-corruption gateway with timeouts, a circuit breaker and clearly labelled stale reads, and run it in C#.
- Handle the unknown outcome problem: the call timed out, but did the core post the transaction?
- Describe how Amazon MQ, SQS and bridging fit with IBM MQ-style messaging and mainframe coexistence.
Prerequisites
- Core banking and mainframe integration (API-level view)
- Hybrid connectivity and VPC peering and Transit Gateway
- Outbox pattern with EF Core and Idempotency in .NET
- CDC from SQL Server with DMS
- Resilience patterns in .NET
- Tools: .NET 10 SDK or Docker for the gateway demo
Why this matters in banking
Almost every bank's accounts and postings live in a core banking platform that is decades old, reliable in its own terms, and not designed for the request rates, retry behaviours or availability of a mobile app. It may have:
- a nightly batch window during which online posting is restricted or unavailable;
- a hard throughput ceiling set by licensing or hardware;
- interfaces such as MQ queues, fixed-width messages, COBOL copybooks or a thin SOAP layer;
- change processes measured in quarters.
Now a new customer app, written for AWS, wants to show a balance on every screen open and post a transfer in under a second. If the app calls the core directly on every screen, an ordinary Monday morning peak becomes an outage of the core. If the app retries a posting after a timeout without a plan, a customer is debited twice. This lesson is about designing that boundary so the bank keeps both its core and its customers.
Educational content, not vendor or regulatory advice
Core systems, mainframe contracts and migration strategies differ widely, and many vendors publish their own integration rules. Operational-resilience obligations that cover the core, and any regulator expectations on outsourcing or mainframe change, need review by your architecture, risk and compliance teams ⚠ VERIFY. Nothing here asserts compliance.
The idea in plain language
Put a gateway between new services and the core. The gateway speaks the core's language on one side and a clean domain language on the other. It also protects the core: it limits calls, times them out, and stops calling when the core is unhealthy.
Three interaction styles, chosen per use case:
| Style | Use for | Consistency | Failure behaviour |
|---|---|---|---|
| Synchronous call through the gateway | Posting a payment that must succeed or fail now | Strong at the core | Timeout means unknown outcome; must reconcile |
| Queued command (SQS or MQ) | Non-urgent postings, batch-like work | Eventual; command acknowledged, posted later | Queue absorbs the outage; age alarms warn |
| Read replica via CDC | Balances, statements, search | Eventually consistent; label the as-of time | Reads continue when the core is down |
The principle: writes go to the core; reads come from a replica where freshness allows. A customer checking a balance can tolerate "as of 10:02"; a debit cannot.
Analogy: a bank branch counter and a back office. Customers talk to a teller (gateway). The teller keeps a recent printout of balances for quick answers, but any money movement goes through the vault procedures (core). If the vault is closed for end-of-day counting, the teller still answers balance questions from the printout, marked with its time, and takes instructions that are executed in the morning.
The unknown outcome
A synchronous call to the core times out. Three worlds are possible: the core never got it, the core posted it and the reply was lost, or the core is still working on it. The caller cannot tell. The safe design is:
- Every posting carries a business reference (our idempotency key).
- On timeout, mark the payment
UNKNOWNand do not retry blindly. - Query the core by reference (an enquiry call or the next statement file) to learn the truth.
- Retry only if the enquiry shows it was not posted, or rely on the core's own duplicate detection by reference.
What problem the AWS services solve
| Need | AWS option | Limits and sharp edges |
|---|---|---|
| Private network to the data centre | AWS Direct Connect, with Site-to-Site VPN as a backup | Direct Connect lead time can be weeks; a single connection is a single point of failure; use two connections in different locations for resilience ⚠ VERIFY recommended topology |
| Many VPCs and sites | Transit Gateway | Route-table design and overlapping CIDRs are the usual problems |
| On-premises name resolution | Route 53 Resolver outbound endpoints | Per-endpoint hourly cost; forwarding rules are per domain |
| Queueing | SQS (standard or FIFO) | FIFO has ordering and deduplication within a message group, with lower throughput limits ⚠ VERIFY quotas |
| Broker compatible with JMS, AMQP and MQTT | Amazon MQ for ActiveMQ or RabbitMQ | These are the two supported engines; IBM MQ is not an Amazon MQ engine ⚠ VERIFY, so IBM MQ stays on premises or runs self-managed, and a bridge connects it |
| Replicate changes | AWS DMS CDC, or events published by an outbox | CDC copies table rows, which may not match business events; map them |
| Mainframe workloads | AWS Mainframe Modernization and partner tools | Coexistence is the common first step; check service availability and fit ⚠ VERIFY |
Microsoft / Azure comparison
| You know (Microsoft/Azure) | AWS equivalent | What's different |
|---|---|---|
| ExpressRoute with VPN failover | Direct Connect with Site-to-Site VPN failover | Same shape; BGP and virtual interfaces are central concepts |
| Azure Virtual WAN hub | Transit Gateway | Route tables and attachments instead of hubs |
| Azure Service Bus | SQS, Amazon MQ | SQS is simplest; Amazon MQ exists for protocol compatibility |
| BizTalk adapters for MQ and mainframe | Gateway service in .NET plus an IBM MQ client library | You own the adapter code, running on Fargate or EC2 |
| Azure Data Factory CDC | AWS DMS and Kinesis or S3 | DMS tasks replicate; you still model events |
| Polly policies | Polly v8 via Microsoft.Extensions.Http.Resilience | Same library on AWS; the breaker and timeout decisions are identical |
Architecture
Security-boundary view
Only the gateway can route to the core network ranges. Application teams never get direct network access to the core, which keeps one team accountable for the load placed on it.
The 15-section design
Sections 1 to 3: requirements
| Section | Content |
|---|---|
| 1 Business | Launch a new mobile banking back end that reads balances and posts transfers against the existing core without increasing core load beyond an agreed ceiling, and without changing the core in this release |
| 2 Functional | F1 Balance and recent transactions. F2 Post an internal transfer. F3 Show clear status during core outage. F4 Reconcile gateway state with core. F5 Respect core cut-off windows. F6 Provide an operations view of queue depth and breaker state |
| 3 Non-functional | Read availability 99.95% (served from replica). Balance freshness within 5 seconds under normal conditions; display "as of" time. Post p99 under 1.5 s with 2 s timeout. Core ceiling: no more than 150 requests per second from the new channel ⚠ agree with core owner. Core outage tolerance: reads continue, writes queue up to 4 hours. RPO 0 for acknowledged postings. RTO for gateway 15 minutes |
Section 5: service selection
| Choice | Why | Rejected alternative | Trade-off |
|---|---|---|---|
| Gateway service on Fargate | Keeps protocol and mapping logic in one owned place | Each app calls the core | One more service to run; consistent protection of the core |
| Replica of balances via CDC or events | Offloads reads and survives core outage | Read through to core | Staleness; must label as-of time |
| SQS FIFO for queued postings | Ordering per account via message group, dedup by key | Amazon MQ | Less protocol compatibility; simpler operations |
| Direct Connect plus VPN backup | Predictable latency and resilience | VPN only | Cost and lead time; VPN has variable latency |
| Idempotent enquiry on timeout | Resolves unknown outcomes safely | Retry blindly | Needs the core to offer an enquiry by reference |
Sections 6 and 7: network and security
- Network. Direct Connect to a Transit Gateway through a transit virtual interface; two connections in separate locations; VPN as a tertiary path ⚠ VERIFY design with your network team. Use non-overlapping CIDRs; where the core's ranges overlap yours, use NAT or PrivateLink-style patterns rather than renumbering the core. See CIDR planning.
- Identity. Service-to-service authentication to the core according to its capabilities: mTLS, MQ channel authentication, or a technical user stored in Secrets Manager with rotation.
- Segregation. Gateway role is the only role with network and credentials to the core. Posting worker and API tasks use separate task roles.
- Data protection. Replica holds customer-linked data; encrypt with KMS, minimise fields, and apply retention (UK GDPR and data residency ⚠ VERIFY).
Sections 8 to 10: API, data and flow
- API (gateway, internal).
GET /accounts/{id}/balancereturns{ amount, currency, asOf, isStale }.POST /postingswithIdempotency-Keyreturns202for queued or201for posted, with statusPOSTED,QUEUED,UNKNOWNorREJECTED. - Database.
postingstable (keyidempotencyKey) holds status and core reference.balancesreplica table (keyaccountId) holds amount, currency,asOf. - Data flow (post). App to gateway; gateway conditional-puts the posting row; sync call or queue; worker calls core with business reference; on success writes core reference; on timeout marks
UNKNOWNand enquires.
Section 11: failure scenarios
| Failure | Detection | Automatic response | Impact | Manual step |
|---|---|---|---|---|
| Core slow | Timeout at 2 s | Return QUEUED or UNKNOWN; open breaker after 3 failures | Pending status | None |
| Core down | Breaker open | Reads from replica flagged stale; writes queued | Reads work; writes delayed | Operations watch queue age |
| Nightly batch window | Calendar and core status | Switch to queued mode; hold | Postings delayed until window ends | None |
| Timeout after core received the request | UNKNOWN | Enquire by reference before any retry | None if resolved | Reconciliation if still unclear |
| Direct Connect link fails | BGP session down | Traffic fails over to second connection or VPN | Possible latency rise | Raise carrier ticket |
| MQ bridge stalls | Queue age alarm | Alert, restart consumer | Replica staleness grows | Investigate bridge |
| Poison command | Repeated processing failure | Move to DLQ after retries | One posting held | Operations review (DLQ redrive) |
| Duplicate command | Idempotency key exists | Return existing result | None | None |
Sections 12 to 15
- Scalability. The core is the bottleneck, so scaling means shedding and pacing, not adding instances. Cache or replicate reads, pace the posting worker to the agreed rate, and use backpressure. At 10x growth the plan is more replicas, not more core calls.
- Cost. Direct Connect port hours and data transfer, Transit Gateway attachment and data processing, Fargate tasks, SQS requests and the replica store. Estimate per attachment-hour and per GB ⚠ VERIFY prices. Hybrid networking is typically the largest fixed item.
- Implementation. Phase 1 connectivity in test with a core simulator. Phase 2 gateway with read replica. Phase 3 queued postings with pacing. Phase 4 unknown-outcome handling and reconciliation. Phase 5 batch-window and failure game days with the core team.
- Compliance touchpoints.
| Area | Where it touches | Reviewing team | Evidence |
|---|---|---|---|
| Operational resilience | Core outage tolerance, important business services | Operational resilience lead | Scenario test results ⚠ VERIFY |
| Outsourcing and third-party (core vendor) | Dependence on vendor interfaces | Third-party risk | Vendor SLA, exit plan |
| Books and records | Posting integrity, reconciliation | Finance control | Reconciliation reports |
| Data protection | Replica contents and retention | Data protection officer | Data map |
| Change management | Core change windows | Change advisory board | Release calendar alignment |
Step-by-step implementation
Agree the load ceiling with the core owner
Get a written maximum request rate, allowed hours and a contact for incidents. Everything in the gateway (rate limit, pacing, breaker) derives from that number.
Build connectivity in layers
Start with the VPN to prove routing and DNS, then add Direct Connect. Test failover by shutting down one path in a maintenance window.
Write the gateway interface in domain language
GetBalanceAsync, PostTransferAsync. Never expose core field names or message layouts outside the gateway (anti-corruption layer).
Add timeout, breaker and stale-read fallback
Use the gateway code in this lesson as the starting point; in a service, use Microsoft.Extensions.Http.Resilience or Polly for the same policies.
Make postings idempotent and enquire on unknown
Store the posting before calling the core. On timeout set UNKNOWN, enquire by business reference, then decide.
Replicate reads and label freshness
Use CDC or events to maintain a balance replica. Always return the asOf timestamp so the UI can show it.
Rehearse the batch window and an outage
Run a game day: block the core, confirm reads continue, writes queue, queue age alarms fire, and the drain after recovery is paced.
AWS Console instructions
- Console → VPC → Site-to-Site VPN connections shows tunnel state for the backup path; Direct Connect → Connections / Virtual interfaces shows port and BGP state.
- Console → VPC → Transit gateways → Transit gateway route tables → Routes to confirm that on-premises prefixes are propagated to the right attachments.
- Console → SQS → your FIFO queue → Monitoring to watch Approximate age of oldest message; this is the key health signal for queued postings.
- Console → Amazon MQ → Brokers (if used) to inspect broker state, then Configuration for the engine version.
AWS CLI
# Check the state of VPN tunnels (read-only).
aws ec2 describe-vpn-connections --profile learn-sandbox --region us-east-1 \
--query "VpnConnections[].{Id:VpnConnectionId,State:State,Tunnels:VgwTelemetry[].Status}"
# List Direct Connect connections (read-only; empty in a sandbox without one).
aws directconnect describe-connections --profile learn-sandbox --region us-east-1
# Create the FIFO queue for core postings (the dead-letter queue is created the same way).
aws sqs create-queue --queue-name hl-m14-core-postings.fifo \
--attributes FifoQueue=true,ContentBasedDeduplication=true,MessageRetentionPeriod=345600 \
--tags Project=cea-lab,Lab=m14-l12,Environment=learn,Owner=learner \
--profile learn-sandbox --region us-east-1
# Watch how old the oldest queued posting is (seconds).
aws cloudwatch get-metric-statistics --namespace AWS/SQS --metric-name ApproximateAgeOfOldestMessage \
--dimensions Name=QueueName,Value=hl-m14-core-postings.fifo \
--start-time 2026-11-18T09:00:00Z --end-time 2026-11-18T10:00:00Z --period 300 --statistics Maximum \
--profile learn-sandbox --region us-east-1Direct Connect and VPN resources are design-only here: a Direct Connect port needs a physical provider, and a VPN connection bills hourly ⚠ VERIFY.
Infrastructure as Code
using Amazon.CDK;
using Amazon.CDK.AWS.CloudWatch;
using Amazon.CDK.AWS.SQS;
using Constructs;
namespace Harbourline.Architecture.CoreIntegration;
public class CorePostingQueueStack : Stack
{
public CorePostingQueueStack(Construct scope, string id, IStackProps? props = null) : base(scope, id, props)
{
var dlq = new Queue(this, "PostingsDlq", new QueueProps
{
QueueName = "hl-m14-core-postings-dlq.fifo",
Fifo = true,
Encryption = QueueEncryption.SQS_MANAGED,
EnforceSSL = true,
RetentionPeriod = Duration.Days(14),
});
var queue = new Queue(this, "Postings", new QueueProps
{
QueueName = "hl-m14-core-postings.fifo",
Fifo = true,
ContentBasedDeduplication = true,
Encryption = QueueEncryption.SQS_MANAGED,
EnforceSSL = true,
VisibilityTimeout = Duration.Seconds(60),
RetentionPeriod = Duration.Days(4),
DeadLetterQueue = new DeadLetterQueue { MaxReceiveCount = 5, Queue = dlq },
});
// The key health signal: how long has the oldest queued posting been waiting?
queue.MetricApproximateAgeOfOldestMessage(new MetricOptions { Period = Duration.Minutes(1) })
.CreateAlarm(this, "PostingsTooOld", new CreateAlarmOptions
{
AlarmDescription = "Core postings are backing up: check core health and breaker state",
Threshold = 300,
EvaluationPeriods = 5,
ComparisonOperator = ComparisonOperator.GREATER_THAN_THRESHOLD,
TreatMissingData = TreatMissingData.NOT_BREACHING,
});
Amazon.CDK.Tags.Of(this).Add("Project", "cea-lab");
Amazon.CDK.Tags.Of(this).Add("Lab", "m14-l12");
Amazon.CDK.Tags.Of(this).Add("Environment", "learn");
Amazon.CDK.Tags.Of(this).Add("Owner", "learner");
}
}Complete code
The gateway below demonstrates the three protections that matter most: a per-call timeout, a circuit breaker and a stale read from a cache when the core is unhealthy. A fake core and fake clock make the behaviour reproducible without AWS.
// Run with: dotnet run CoreGateway.cs
// An anti-corruption gateway in front of a legacy core banking system:
// per-call timeout, a circuit breaker, and stale-but-labelled reads while the core is down.
var clock = new FakeClock(DateTimeOffset.Parse("2026-11-18T10:00:00Z"));
var core = new FakeCore();
var gateway = new CoreGateway(core, () => clock.Now, failureThreshold: 3,
openFor: TimeSpan.FromSeconds(30), callTimeout: TimeSpan.FromMilliseconds(200));
Console.WriteLine(await gateway.GetBalanceAsync("ACC-0000000001")); // fresh, fills the cache
core.Down = true;
for (var i = 1; i <= 5; i++)
{
var view = await gateway.GetBalanceAsync("ACC-0000000001");
Console.WriteLine($"call {i}: {view} (core was called {core.Calls} times)");
}
try { await gateway.GetBalanceAsync("ACC-0000000002"); } // never cached
catch (CoreUnavailableException e) { Console.WriteLine($"no cache -> {e.Message}"); }
core.Down = false;
clock.Now = clock.Now.AddSeconds(31); // breaker half-opens
Console.WriteLine(await gateway.GetBalanceAsync("ACC-0000000001"));
return 0;
public record BalanceView(decimal Amount, bool IsStale, DateTimeOffset AsOf);
public sealed class CoreUnavailableException(string message) : Exception(message);
public interface ICoreBanking
{
Task<decimal> GetBalanceAsync(string accountId, CancellationToken ct);
}
public sealed class FakeClock(DateTimeOffset start) { public DateTimeOffset Now { get; set; } = start; }
public sealed class FakeCore : ICoreBanking
{
public bool Down { get; set; }
public int Calls { get; private set; }
public Task<decimal> GetBalanceAsync(string accountId, CancellationToken ct)
{
Calls++;
if (Down) throw new HttpRequestException("core banking timeout (simulated)");
return Task.FromResult(1234.56m);
}
}
public sealed class CoreGateway(ICoreBanking core, Func<DateTimeOffset> now, int failureThreshold,
TimeSpan openFor, TimeSpan callTimeout)
{
private readonly Dictionary<string, BalanceView> _cache = [];
private int _failures;
private DateTimeOffset? _openUntil;
public async Task<BalanceView> GetBalanceAsync(string accountId)
{
if (_openUntil is { } until && now() < until) return Stale(accountId); // breaker open: do not call
try
{
using var cts = new CancellationTokenSource(callTimeout);
var amount = await core.GetBalanceAsync(accountId, cts.Token);
_failures = 0;
_openUntil = null;
return _cache[accountId] = new BalanceView(amount, IsStale: false, now());
}
catch (Exception e) when (e is HttpRequestException or OperationCanceledException)
{
// After the threshold, a single failed trial call re-opens the breaker straight away.
if (++_failures >= failureThreshold) _openUntil = now() + openFor;
return Stale(accountId);
}
}
private BalanceView Stale(string accountId) =>
_cache.TryGetValue(accountId, out var last)
? last with { IsStale = true }
: throw new CoreUnavailableException($"core unavailable and no cached balance for {accountId}");
}Expected output (the AsOf text depends on your culture):
BalanceView { Amount = 1234.56, IsStale = False, AsOf = 11/18/2026 10:00:00 +00:00 }
call 1: BalanceView { Amount = 1234.56, IsStale = True, AsOf = 11/18/2026 10:00:00 +00:00 } (core was called 2 times)
call 2: BalanceView { Amount = 1234.56, IsStale = True, AsOf = 11/18/2026 10:00:00 +00:00 } (core was called 3 times)
call 3: BalanceView { Amount = 1234.56, IsStale = True, AsOf = 11/18/2026 10:00:00 +00:00 } (core was called 4 times)
call 4: BalanceView { Amount = 1234.56, IsStale = True, AsOf = 11/18/2026 10:00:00 +00:00 } (core was called 4 times)
call 5: BalanceView { Amount = 1234.56, IsStale = True, AsOf = 11/18/2026 10:00:00 +00:00 } (core was called 4 times)
no cache -> core unavailable and no cached balance for ACC-0000000002
BalanceView { Amount = 1234.56, IsStale = False, AsOf = 11/18/2026 10:00:31 +00:00 }Notice that the core call count stops at 4: after three failures the breaker opens and calls 4 and 5 never reach the core. That is the protection the core owner asked for.
Code explained line by line
BalanceView(decimal Amount, bool IsStale, DateTimeOffset AsOf)is the domain type. The UI sees "as of" and "stale", not core-specific fields.ICoreBankingis the port to the core. A real adapter implements it over MQ, SOAP or REST; the fake here lets tests control failure.FakeClockmakes time a parameter, so the 30-second breaker window can be advanced instantly in tests.- In
GetBalanceAsync, the first line checks the breaker. If it is open and the time has not passed, the gateway returns the cached value without calling the core. - The call uses a
CancellationTokenSource(callTimeout), so a slow core is abandoned at 200 ms in the demo (2 s in the design). catch (...) when (e is HttpRequestException or OperationCanceledException)limits the breaker to transport and timeout failures; bugs such asNullReferenceExceptionare not swallowed.++_failures >= failureThresholdopens the breaker. After the open period, the next call is a trial: success resets, failure re-opens immediately because_failuresis still at the threshold.Stalereturns the last known value withIsStale = truevia awithcopy, or throwsCoreUnavailableExceptionwhen there is nothing to show. Never invent a balance.- This class is deliberately not thread-safe, to stay short. In a service use
Microsoft.Extensions.Http.Resilienceor Polly, or add locking, and keep breaker state per core endpoint.
Security considerations
⚠ Learning shortcut — not for production
The demo gateway caches balances in process memory and has no authentication, no per-account authorisation and no thread safety. In production the replica is an encrypted store with per-customer access checks in the layer above the gateway, breaker state is per instance or shared deliberately, and every call to the core carries a correlation ID for the audit trail. Credentials for the core live in Secrets Manager with rotation.
- One door. Only the gateway reaches the core network. Enforce with routes, security groups and IAM, then audit.
- Authorise above the gateway. The core may only know technical users; "customer sees only their own accounts" is enforced by your API layer (account management).
- Protect the core from abuse. Rate-limit per caller at the API edge and again at the gateway.
- Stale data is a security property too. Never use a stale balance for an authorisation decision such as approving a debit; use it only for display.
- Log without leaking. Correlation ID, account reference and outcome, not full message bodies.
Banking use case
At 23:30 each night the core enters its batch window for 50 minutes. Harbourline's app still shows balances, each tagged "as of 23:29", because reads come from the replica. A customer who sends a transfer at 23:45 sees "Processing: we will confirm shortly". The gateway queues the command; the worker drains it at the agreed pace after 00:20. One command times out after the core received it. The worker marks it UNKNOWN, enquires by business reference, finds it posted, records the core reference and notifies the customer. No duplicate, no support call.
Common mistakes
- Reading through to the core on every screen. It couples your peak load to the core's ceiling.
- Blind retries on timeout. They create duplicate postings; use idempotent references and enquiry.
- Treating CDC rows as business events. A table update may not mean "transfer settled".
- Exposing core data formats to apps. Every consumer then breaks on the next core change.
- One Direct Connect connection called "resilient". One link is one failure.
- Using stale data for decisions. Display only; authorise against the core.
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| Calls to the core time out only from AWS | Route or security rule missing on one side, or MTU and fragmentation issues | Check Transit Gateway routes, firewall rules and path MTU |
| On-premises hostnames do not resolve | No resolver forwarding rule | Add a Route 53 Resolver outbound endpoint and rule |
| FIFO queue throughput is low | One message group for everything | Use a group ID per account to allow parallelism with per-account ordering |
| Postings stuck, age alarm firing | Worker paused by an open breaker or credential expiry | Check breaker state, secrets and core status |
| Duplicate postings at the core | Retry without business reference | Add idempotency key and enquiry-before-retry |
| Balance shows old values for hours | Replication lag or stalled bridge | Alarm on replica asOf age; restart the bridge |
Cost and cleanup
The C# gateway demo is free. The CDK or Terraform stack creates two SQS queues and an alarm: effectively free at lab volumes. Direct Connect, Transit Gateway attachments, Site-to-Site VPN and Amazon MQ are design-only here because they bill hourly ⚠ VERIFY pricing before any proof of concept.
# Tear down what you deployed.
cdk destroy --profile learn-sandbox
terraform destroy
# Or delete the queues directly (substitute the queue URLs).
aws sqs delete-queue --queue-url <postings-queue-url> --profile learn-sandbox --region us-east-1
aws sqs delete-queue --queue-url <dlq-url> --profile learn-sandbox --region us-east-1
# Confirm nothing tagged for the course remains.
aws resourcegroupstaggingapi get-resources --tag-filters Key=Project,Values=cea-lab \
--profile learn-sandbox --region us-east-1Exercises
- 🟢 Guided: run the gateway demo. Change
failureThresholdto 2 and predict the new "core was called" counts. - 🟡 Challenge: add a
PostTransferAsyncto the gateway that returnsPosted,QueuedorUnknown, and write tests for a timeout after the core has accepted the message. - 🔴 Live problem: the core owner reports the new channel doubled morning peak load. Customers open the app 6 times each morning. Propose three changes that cut core calls without making balances unacceptably stale, with the as-of rule for each screen.
Assignment
Add architecture/core-integration/ to your portfolio: the 15-section document, a hybrid network diagram with failover paths, a sequence diagram of the unknown-outcome flow, an ADR choosing queued commands over direct calls for non-urgent postings, and the gateway with unit tests.
Solutions
With a threshold of 2, the breaker opens after the second failure. Call 1 fails (core calls 2 including the first success), call 2 fails (3), and calls 3 to 5 are served from the cache without calling the core, so the count stays at 3. Why: the threshold counts consecutive failures, and opening the breaker stops further calls.
Store the posting row first with the idempotency key. Call the core with the business reference. On timeout, return Unknown, set the row to UNKNOWN, then enquire by reference. A test fake accepts the message and then throws a timeout; assert the result is Unknown, assert no second post is issued, and assert that enquiry resolves it to Posted. Why: the dangerous case is exactly when the core has accepted the work but the caller cannot see it.
(1) Serve the home-screen balance from the replica, with an as-of time up to 30 seconds old. (2) Fetch transaction lists from the replica or lake rather than the core, with freshness up to 5 minutes. (3) Collapse repeated opens with a short-lived per-customer cache and request coalescing at the gateway. Keep strong reads only for the payment confirmation screen. The as-of rule per screen belongs in the API contract so the product owner can see the trade-off.
Knowledge check
Answer: The core is the system of record. Reads can tolerate small, labelled staleness; writes must be consistent and cannot be satisfied from a copy.
Answer: Retry blindly. The core may have posted it. Mark the outcome unknown and enquire by business reference first.
Answer: Both sides: the caller stops wasting time on a failing dependency, and the dependency gets breathing space to recover instead of being hammered.
Answer: No. Amazon MQ supports ActiveMQ and RabbitMQ. IBM MQ stays on premises or self-managed, with a bridge to AWS services ⚠ VERIFY current offerings.
Answer: A single connection at a single location is a single point of failure. Resilience needs separate connections and locations, plus a backup path such as VPN.
Interview questions
- How do you protect a legacy core from a new digital channel? A gateway with rate limits, timeouts, a breaker, read replicas and queued commands, agreed with the core owner.
- How do you avoid duplicate postings after a timeout? Business reference as idempotency key, store before call, enquire before retry.
- How do you handle the nightly batch window? Switch to queued mode, serve reads from the replica with as-of times, drain at a paced rate afterwards.
- What are the options for streaming core changes to AWS? DMS CDC, events from an outbox, or an MQ bridge; choose by how well they map to business events.
- How do you present mainframe coexistence to a design authority? Core stays the system of record; the gateway isolates change; migration proceeds by capability (strangler pattern), each step with rollback.
Certification practice
A bank needs predictable, private connectivity between AWS and its data centre with automatic backup. Which design is best?
A. Single Site-to-Site VPN over the internet. B. Two Direct Connect connections at different locations attached to a Transit Gateway, with a Site-to-Site VPN as backup. C. A public NAT gateway to the core. D. VPC peering to the on-premises network.
Answer: B. It gives dedicated paths with diversity and a backup. A has variable latency and no dedicated path, C exposes traffic publicly, and D cannot peer to on-premises.
Queued postings must be processed in order per account but in parallel across accounts. Which SQS configuration fits?
A. Standard queue. B. FIFO queue with the account ID as message group ID. C. FIFO queue with one message group ID for all messages. D. Two standard queues.
Answer: B. FIFO preserves order within a group and processes groups in parallel. A does not guarantee order, C serialises everything, and D does not provide ordering.
Only one team should be able to reach the core network from AWS. Which approach enforces this best?
A. A wiki page asking other teams not to connect. B. A dedicated gateway service and role with routes and security groups that allow only it to reach the core ranges. C. Share the VPN pre-shared key with all teams. D. Give each team a copy of the core credentials.
Answer: B. Technical enforcement plus audit. A is policy without control; C and D widen access.
Completion checklist
- I can explain reads from a replica and writes to the core
- I ran the gateway and saw the breaker stop core calls
- I can describe the unknown-outcome procedure step by step
- My design names the load ceiling agreed with the core owner
- I ran cleanup and confirmed nothing tagged
Project=cea-labremains
Key takeaways
- The core is the system of record and a fragile dependency: protect it with a gateway, pacing and a breaker.
- Writes go to the core, reads come from a labelled-stale replica, and stale data never authorises a decision.
- A timeout means unknown outcome: enquire by business reference before retrying.
- Hybrid resilience needs two Direct Connect connections plus a backup path.
- Operational resilience, outsourcing and change-management requirements need specialist review.
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.
Secure external integrations
Design safe connections to partner APIs, webhooks and file exchanges using egress allow-lists, mutual TLS, signed webhooks and third-party risk controls, and verify signed webhooks with a runnable C# verifier.
API orchestration: Step Functions or in-service
Decide when a multi-step banking operation should be orchestrated by AWS Step Functions and when by code inside the service, design timeouts, retries and compensation, and run a C# saga runner and an Amazon States Language definition.