Caching Strategies Explained: Cache-Aside, Write-Through and Write-Back
Caching strategies and their trade-offs: cache-aside, read-through, write-through, write-back and write-around, plus eviction policies, TTLs and invalidation.
Kafka, RabbitMQ and Amazon SQS compared: log vs queue models, ordering, replay, throughput, delivery guarantees and operations, and when to use each.

Message systems let services communicate asynchronously: a producer sends a message and moves on, and consumers process it later. Kafka, RabbitMQ and SQS are three of the most popular choices, and they are built on different ideas.
| Kafka | RabbitMQ | SQS | |
|---|---|---|---|
| Model | Partitioned, replayable log | Broker with exchanges and queues | Managed queue |
| Ordering | Per partition | Per queue (with caveats) | Standard: best effort; FIFO queues: ordered |
| Replay | Yes, within retention | Not by default | No |
| Throughput | Very high | High | High, scales automatically |
| Routing | Topics and partitions | Rich: direct, topic, fanout, headers | Simple; combine with pub/sub services |
| Operations | Significant (unless managed) | Moderate | Minimal |
All three can deliver messages at least once, which means duplicates are possible. Design consumers to be idempotent; see our guide to idempotency keys. “Exactly-once” processing is possible in specific setups but requires careful design end to end.
Use a queue to smooth spikes and decouple slow work, such as sending notifications (see designing a notification system) or recording analytics (see designing a URL shortener). Choose a log when multiple consumers need the same events or replay matters.
Not exactly. It’s a distributed log that can be used like a queue through consumer groups, while also supporting replay and multiple readers.
SQS, because it’s fully managed. Managed offerings also exist for Kafka and RabbitMQ.
Yes. Many systems use Kafka for event streaming and a queue for background jobs.
Every article is edited by a human and checked against our editorial policy. Spotted a mistake? Tell us.
Caching strategies and their trade-offs: cache-aside, read-through, write-through, write-back and write-around, plus eviction policies, TTLs and invalidation.
Rate limiting algorithms compared: fixed window, sliding log, sliding window counter, token bucket and leaky bucket, with code and distributed design tips.
How idempotency keys make retries safe: why duplicate requests happen, how to store and check keys, handling concurrent requests, expiry and common mistakes.