1

I am making a chat app. There is a pic of yourself. You can send messages to other people and when they receive the message they receive your avatar too.

The trick is that images cost resources and they don't change that often. Is RabbitMQ suited for exchanging avatars ? Or do I need to design my own system ?

P.S : I'm new to RabbitMQ but Im experienced with writing apps, servers, ...

Thomas
  • 8,306
  • 8
  • 53
  • 92

1 Answers1

5

In brief: Yes, technically, it may be used. But it would be better to send link to image that served separately, say, from CDN or just from your web-server.

Long answer: RabbitMQ can handle large payload (I tested 2GB and it works like a charm) but it doesn't designed for that. RabbitMQ works best when queue fits in memory. Even if messages get dumped to disk (I guess this is your case if you want your messages be permanent and available after RabbitMQ restart, also don't forget to make queues also permanent) it always will be faster to keep message as small as you can (without any side performance degradation). Also, most apps (web or platform-specific) use caching, so downloading avatar image once and then just display it whenever you need would be definitely faster and resource-friendly way rather then send that binary every time.

pinepain
  • 12,453
  • 3
  • 60
  • 65