Menu

RPC vs NATS: It's Not About Sync vs Async — It's About Who Owns Completion
📰
0

RPC vs NATS: It's Not About Sync vs Async — It's About Who Owns Completion

DEV Community: grpc·Harrison Guo·about 1 month ago
#io5heOtg
#dev#class#strong#caller#consumer#article
Reading 0:00
15s threshold

A team I worked with once migrated an order-placement path from gRPC to NATS because "it's decoupled and faster." The old flow was simple: the web service called PlaceOrder via gRPC, got back an order ID, rendered success to the user. The new flow: web service publishes order.place to NATS, an order-service consumes it and processes asynchronously. Within three weeks they had three kinds of incidents on rotation: Duplicate orders — retry on the publisher side meant the same order was placed twice when the first publish actually succeeded but the ack was slow. Lost orders — consumer crashed mid-process; no ack meant NATS redelivered, but the consumer had already partially committed state, so redelivery was rejected by a dedup check. The order just... disappeared from the user's perspective. Dark-failure support tickets — users reported "I clicked buy and nothing happened." From the publisher side, everything looked fine.…

Continue reading — create a free account

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

Read More