[rabbitmq-discuss] Performance of One vs. Many Topic Exchanges

Chris stuff at moesel.net
Wed Feb 13 21:17:14 GMT 2013


I am implementing an abstraction over dynamic pub/sub.  The idea is that
you have named "themes", and within those themes you have "subjects" that
can be used as a filter.  Themes may or may not be transient.

I think have two choices:

1) Each named "theme" is a separate topic exchange and "subjects" map
directly to routing keys *(i.e., "stocks" topic exchange, with messages
having routing keys like "nasdaq.apple.price")*.

2) There is a single topic exchange and the routing key is a composite of
theme and subject *(i.e., "themes" topic exchange, with messages having
routing keys like "theme.stocks.subject.nasdaq.apple.price")*.

Although #1 has a better one-to-one mapping to my problem, I am inclined to
go with #2 because it is much easier to manage (a single exchange that
never gets deleted, vs many exchanges that I must manage the lifecycle of).

The only thing I am unsure of is if there is any difference in performance?
 Multiple exchanges are more expensive in memory, but will a single
exchange need more CPU to route messages because it is dealing with so many
more disparate bindings?

Thanks for any guidance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130213/3ba7ba06/attachment.htm>


More information about the rabbitmq-discuss mailing list