You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A highly scalable distributed wallet system demonstrating:
Event-driven microservices
Saga pattern for distributed transactions
Idempotent APIs
Concurrency-safe wallet updates
Kafka-based asynchronous communication
π System Architecture
π· High-Level Flow
graph TD
A[Wallet Service] -->|Transfer Request| B[PostgreSQL]
A -->|MoneyTransferredEvent| C[Kafka]
C --> D[Notification Service]
D -->|NotificationSentEvent| C
D -->|NotificationFailedEvent| C
C --> E[Wallet Service Consumer]
E -->|SUCCESS| B
E -->|COMPENSATED| B
Loading
π§ Saga Workflow
sequenceDiagram
participant W as Wallet Service
participant K as Kafka
participant N as Notification Service
W->>W: Create Transaction (PENDING)
W->>K: MoneyTransferredEvent
K->>N: Consume Event
alt Success
N->>K: NotificationSentEvent
K->>W: Mark SUCCESS
else Failure
N->>K: NotificationFailedEvent
K->>W: Mark COMPENSATED
end