← All comparisons

Payment Gateway vs Instagram Feed

Payment System

Payment System

Pay-in flow through a PSP, double-entry ledger and wallet, idempotency for exactly-once, plus reconciliation against settlement files.

Components (13)

  • E-commerce Backend
  • API Gateway
  • Payment Service
  • Idempotency Store
  • Risk / Fraud Check
  • Payment Executor
  • PSP
  • Card Schemes
  • Retry + Dead Letter Queue
  • Wallet
  • Ledger
  • Payments DB
  • Reconciliation

Headline numbers

  • Txn TPS (avg)~10/sec
  • Txn TPS (peak)~50/sec
  • Ledger writes / sec (peak)~100
Instagram Feed

Instagram Feed

Fan-out on write vs read, ranking, CDN.

Components (10)

  • Mobile Client
  • CDN
  • API Gateway
  • Feed Service
  • Post Service
  • Kafka
  • Fan-out Worker
  • Redis
  • Postgres
  • S3

Headline numbers

  • Posts / sec (avg)~3,000/sec
  • Feed read QPS~58,000/sec
  • Fan-out writes / sec~600,000/sec

Key differences

Only in Payment Gateway
  • PSP
In both
  • Client
  • Api Gateway
  • Service
  • Cache
  • Queue
  • Database
Only in Instagram Feed
  • CDN
  • S3

Flow shape

Payment Gateway flows
  • Pay-in: charge a card10 steps
  • Reconciliation (settlement file)3 steps
  • Payment order fails: retry then DLQ4 steps
  • Idempotency store is cold5 steps
Instagram Feed flows
  • Post a photo (fan-out on write)7 steps
  • Open feed (precomputed timeline)5 steps
  • Fan-out Worker is down7 steps
  • Timeline cache flushed (Redis restart)4 steps