Micro Services seem to be a trendy topic in software development nowadays and often they go hand in hand with message queues as an integration approach. So the question arises, whether message queues become the replacement for relational databases as an integration scenario and whether it is a better approach or not.
So here are some questions:
- Yes, for emails --> RabbitMQ, 10,000 requests / seconds
- RabbitMQ
- Kafka
- See ELK Stack for high load scenarios --> distribution to multiple queues
- distribute work on several workers
- moved from ActiceMQ to kafka
- DB (e.g. Redis) as a cache before the queue
- doesn't matter if messages are lost
- RabbitMQ provides persistence to disk
- persistence brings a performance penalty
- Kafka --> seems to perform very well
- Kafka as a replacement for ActiveMQ and Redis (in a Elkstack scenario)
If you are using message queues in a cloud environment: are you using shared or dedicated services - what is your experience with either
- Amazon Queue SQS --> not reliable but cheap
- Using an error queue --> retrying
- Saga pattern...
- Think about your architecture --> bounded context --> "self contained system" Stefan Tilkow, Eberhard Wolf
- Domain Driven Design by Eric Evans
- Measure delays between read and write in the queue
- Track time when message is written and read --> scale based upon this information
- JSON
- Kafka can compress messages
- Old post on Quora
- Kafka vs. RabbitMQ vs. Kestrel vs. ActiveMQ
- Performance Comparison of several messaging queues
- Performance overview of RabbitMQ given different ACKs
- Discussion about downsides of Kafka
- Loooong discussion about RabbitMQ vs. Kafka
Some facts from various sources (no guarantees)
Feature | RabbitMQ | Kafka |
---|---|---|
Messages/s | 20k/s | 200k/s write, 3M/s read |
Routing capabilities | Advanced, see https://www.rabbitmq.com/getstarted.html | topic-like exchange only |
Acknowledgemts | message acknowledgement to assure delivery state | consumer needs to remember delivery state (e.g. via Zookeeper) |
- start with a Monotlith and split it up later (unless you know the domain very well - eg. in a e-commerce shop)
- see Domain Driven Design by Eric Evans