Menu

1 / 2

Saga, Circuit Breaker & Friends on Android: Surviving a Checkout in a Metro Tunnel

DEV Community·Padmakar Garg·4 days ago
#xm9brKIL
#dev#saga#retry#breaker#suspend
Long article (3419 words) — no AI summary yet.
Reading 0:00
15s threshold

Patrick is on the metro. She opens QuickBite (a made-up food delivery app), adds a biryani, applies a coupon and taps Pay ₹349 .

The train enters a tunnel.

The spinner keeps spinning.

Did the payment go through?

Is the coupon gone?

If she taps Pay again, will she be charged twice?

If she swipes the app away, what happens to the half-finished order?

Patterns like Circuit Breaker and Saga are usually taught with backend microservices. But a mobile app is also one part of a distributed system, with an unreliable network and a process that the OS can kill. This post shows which patterns help on Android, and where each one stops helping.

The cheat sheet

Pattern Question it answers Android / Kotlin tool

Timeout How long do I wait? OkHttp timeouts, withTimeout

Retry + backoff + jitter Was it a temporary glitch? Arrow Schedule , WorkManager backoff

Circuit breaker Should I even try right now? Arrow CircuitBreaker

Fallback What do I show if it fails?…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.