Menu

Why your SQS FIFO queue still loses order, and how to stop it
πŸ“°

Why your SQS FIFO queue still loses order, and how to stop it

DEV Community: serverlessΒ·Sascha Mirow-StanitzokΒ·1 day ago
#NRuNFqY6
#devtoserverless#devto#dev#group#fifo
Long article (898 words) β€” no AI summary yet.
Reading 0:00
15s threshold

Picture a bike rental system where a bike is reported as "returned" before its "rented" event has been processed. The dashboard now shows the bike out on the street, even though it is parked at the station. Switching to an SQS FIFO queue looks like the obvious fix. In my experience, it is only half of one.

I recently wrote a detailed walkthrough on SQS FIFO with Lambda , including a complete CDK project. Here is the condensed version of what I learned while building it.

Order belongs to the message group, not the queue

FIFO in Amazon SQS does not mean one global line. Order is only guaranteed among messages that share the same message group ID. Messages from different groups may overtake each other and are processed in parallel.

That makes the group ID the most important design decision. A constant ID such as "default" gives you strict global ordering, but also only one batch in flight at a time, so a single slow message blocks everything.…

Continue reading β€” create a free account

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