Back to work

Distributed Payments

Nexus RTP - Distributed Payment System

Distributed payment backend focused on correctness, latency, idempotency, serializable transactions, and reliable event delivery.

A payment-system backend built around immutable ledger semantics, sharded account writes, retry safety, and crash-safe asynchronous workflows.

GoCockroachDBKafkaRedisPrometheus

Challenge

Design payment flows that preserve balance correctness under retries, duplicates, and high-contention account updates.

  • Idempotent UETR transaction handling.
  • Immutable double-entry ledger records.
  • Balance consistency checks after state transitions.

Performance Work

The hot path moved away from a single contended write pattern and toward sharded account updates under SERIALIZABLE isolation.

  • Reduced P99 latency from 1500ms to 140ms.
  • Eliminated hot-row contention with account sharding.
  • Kept correctness explicit instead of trading it away for speed.

Reliability

Kafka outbox / CDC patterns keep asynchronous workflows reliable when processes crash, retry, or receive duplicate events.

  • Crash-safe event delivery.
  • Duplicate handling and retry safety.
  • Observable asynchronous workflow state.