Wait for the server vs optimistic update
Waiting shows a like only after the server answers. An optimistic update shows it at once and keeps it in an outbox until the server accepts it. When the API is down for 15 s at 120 likes/s, waiting fails 17 percent of taps and p99 is 202 ms. The outbox gives p99 2.2 ms and loses no like.
W 3 + R 3 of 5 · every read sees the last write
13 deliveries · 10 payments applied · 0 charged twice
Case 1
A like must feel instant: p99 under 100 ms on 4G with a 65 ms round trip. The API is down for 15 s at 0:20 while 120 likes/s arrive. No like may be lost and no tap may fail.
| Measure | Goal | Wait for the server | Show at once, retry from an outbox |
|---|---|---|---|
| p99 latency | under 100 ms | 202 ms Fail | 2.2 ms Pass |
| Lost writes | none | 0 Pass | 0 Pass |
| Error rate | under 0.1% | 16.7% Fail | 0% Pass |
| Monthly cost | 8 USD/mo | 12 USD/mo |