๐ฆ Fintech Traffic Architecture โ Reference Design (Interview Level)
Letโs assume:
- Public fintech platform
- Web + mobile clients
- Partner APIs
- Microservices backend (EKS/ECS)
- Lambda-based async flows
- Strong security + audit requirements
โ Layered Traffic Model (How I Explain in Interview)
I design traffic in layers, not tools:
Layer 1 โ Global Edge Layer
- CloudFront
- WAF
- DDoS protection
- TLS edge termination
- static asset caching
Layer 2 โ API Control Layer
- API Gateway (for external APIs)
- throttling
- auth
- schema validation
- partner control
Layer 3 โ Application Routing Layer
- ALB (HTTP microservices routing)
- path/host routing
- service fan-out
Layer 4 โ High-Performance TCP Layer
- NLB (when needed)
- gRPC / TCP / static IP
Interviewers like layered thinking.
๐ CloudFront โ When to Use in Fintech Traffic
โ Use CloudFront When:
- public user traffic global
- frontend assets
- document downloads
- statement PDFs
- JS/CSS bundles
- WAF + bot protection needed
- geo restriction required
- edge TLS termination
- origin shielding needed
โ Donโt Use CloudFront When:
- internal APIs only
- ultra low latency internal calls
- highly dynamic non-cacheable APIs (sometimes still OK but limited gain)
โ ๏ธ CloudFront Tradeoffs
- cache invalidation cost
- config complexity
- header forwarding affects cache hit
- not ideal for east-west traffic
- origin timeout limits exist
๐ช API Gateway โ When to Use in Fintech
โ Use API Gateway When:
- external partner APIs
- fintech integrations
- merchant APIs
- webhook endpoints
- Lambda backends
- need throttling per client
- usage plans needed
- request validation needed
- auth centralization needed
๐ช API Gateway Strengths
- built-in throttling
- per-client limits
- JWT/IAM auth
- request validation
- direct Lambda/SQS integration
- no servers
- audit visibility
โ ๏ธ API Gateway Tradeoffs
- per-request cost high at scale
- payload limits
- timeout limits
- not ideal for streaming
- adds latency vs ALB
- mapping templates complexity
โ๏ธ ALB โ When to Use
โ Use ALB When:
- microservices on EKS/ECS
- path-based routing needed
- multiple services behind one domain
- HTTP/gRPC routing
- WAF integration needed
- container backends
- need host/path rules
๐ช ALB Strengths
- L7 smart routing
- multiple target groups
- sticky sessions
- WebSocket support
- cheaper than API GW at high RPS
- good for internal + external apps
โ ๏ธ ALB Tradeoffs
- no per-client throttling
- no usage plans
- less API governance
- regional only
- higher latency than NLB
- HTTP only
โก NLB โ When to Use
โ Use NLB When:
- TCP/UDP traffic
- gRPC high performance
- static IP required
- partner IP allowlisting
- TLS passthrough
- ultra low latency
- very high RPS
โ ๏ธ NLB Tradeoffs
- no path routing
- no WAF
- no auth layer
- no header rules
- L4 only
๐ง ALB Buffering & Request Handling โ Interview Trap Topic
โ Does ALB buffer requests?
Yes โ ALB buffers client request body before sending to target (for HTTP). Implications:
- protects backend from slow clients
- adds memory buffering at LB
- large uploads can stress LB
- backend sees full request at once
โ ๏ธ ALB buffering tradeoffs
- large uploads โ latency
- streaming not ideal
- timeout risk for slow upload
- better to use S3 pre-signed upload for large files
Interview bonus if you mention this.
โฑ๏ธ Timeout & Limit Differences (Critical)
API Gateway timeout
- shorter integration timeout
- good for fast APIs only
ALB timeout
- configurable idle timeout
- better for longer HTTP calls
CloudFront timeout
- origin timeout limits
- retries configurable
Mismatch causes 502/504 errors โ real production failure pattern.
๐งพ Fintech Pattern โ Typical Final Architecture
Public Web App
CloudFront โ WAF โ ALB โ EKS services
Partner API
CloudFront (optional) โ API Gateway โ Lambda / ALB backend
High-Perf gRPC
Client โ NLB โ service
๐งฎ Decision Matrix โ Interview Gold Answer
โ When interviewer asks: โALB vs API Gateway vs CloudFront?โ
Answer like this:
Use CloudFront when:
- global edge delivery
- caching
- WAF edge protection
- static or semi-static
- user-facing web
Use API Gateway when:
- external APIs
- partner integrations
- per-client throttling
- auth + validation needed
- serverless backend
Use ALB when:
- container microservices
- internal/external app routing
- path routing
- high RPS HTTP
Use NLB when:
- TCP/gRPC
- static IP needed
- ultra performance
- non-HTTP
๐ฅ Interview Power Move Answer (One-liner)
If interviewer asks:
โHow do you choose between them?โ
Say:
I choose based on layer โ CloudFront for edge delivery and protection, API Gateway for API governance and throttling, ALB for microservice HTTP routing, and NLB for high-performance L4 traffic. I donโt treat them as competitors โ I layer them.
Thatโs a senior-level answer.
Perfect โ now we move into the Traffic Architecture Scenario Round โ 20 Questions. This is exactly how senior DevOps / platform interviews probe depth: they give a traffic pattern and ask you to choose the right AWS traffic component + justify tradeoffs + limits.
Rules for this round:
- Each scenario = realistic fintech / prod case
- You answer with design + reasoning
- I give you model interview-grade answer
- Focus = CloudFront vs API Gateway vs ALB vs NLB decisions
Weโll do Questions 1โ10 in this message (so it stays readable). Then next 10 after.
๐ง Traffic Architecture Scenario Round โ Q1โQ10
โ Scenario 1 โ Global fintech web app with heavy static + dynamic API
Question: What traffic stack do you choose?
Answer: I put CloudFront at the edge for global acceleration, TLS, WAF, and static asset caching. Static content goes to S3 origin with long TTL. Dynamic API paths route to ALB or API Gateway depending on API type. This reduces origin load and latency while keeping API control separate.
โ Scenario 2 โ Partner payment API with strict per-client rate limits
Answer: API Gateway is the right front door because it supports usage plans, API keys, and per-client throttling. ALB cannot enforce per-client rate limits. Iโd attach WAF and JWT/Lambda authorizer. Backend can be Lambda or ALB/EKS.
โ Scenario 3 โ Internal microservice-to-microservice traffic inside EKS
Answer: None of these โ use ClusterIP + service mesh or internal service networking. Using ALB/API Gateway for east-west traffic adds latency and cost. Interviewers like when you say โdonโt use edge tools internally.โ
โ Scenario 4 โ Ultra-low latency gRPC trading service
Answer: NLB. It supports TCP/HTTP2/gRPC efficiently with low latency. ALB adds L7 overhead and may cause protocol issues. If static IP needed for exchange allowlist โ NLB with Elastic IP.
โ Scenario 5 โ Public REST API with Lambda backend and moderate traffic
Answer: HTTP API Gateway โ lower cost and latency than REST API type. Native Lambda integration, built-in auth and throttling. No need for ALB here unless traffic becomes very high and steady.
โ Scenario 6 โ 2GB file upload from clients
Answer: Direct S3 pre-signed upload โ not ALB or API Gateway. Both have payload and buffering limits. LB buffering makes this inefficient and failure-prone. Edge can still use CloudFront โ S3 if needed.
โ Scenario 7 โ Need WAF + bot filtering + geo block for web + APIs
Answer: CloudFront + WAF at edge. Then route to ALB or API Gateway origins. Edge WAF is cheaper and blocks earlier. Centralizes protection.
โ Scenario 8 โ Legacy TCP payment switch integration
Answer: NLB โ TCP passthrough, stable IP, high connection scale. ALB/API Gateway are wrong protocol layer.
โ Scenario 9 โ 150 microservices HTTP platform, want single public endpoint
Answer: CloudFront โ ALB with path/host routing to many target groups. One ALB per env is cost-efficient and operationally simpler. API Gateway would be expensive and rule-heavy at that scale.
โ Scenario 10 โ Need request/response transformation at gateway layer
Answer: API Gateway REST API (not HTTP API) because it supports mapping templates and transformation. ALB cannot transform payloads. This is a feature-based choice.