[rabbitmq-discuss] Caching proxy for cloud HA

Jon Brisbin jon.brisbin at npcinternational.com
Tue May 25 14:29:40 BST 2010


response below...

On May 25, 2010, at 3:36 AM, Matthias Radestock wrote:

> Jon,
> 
> Jon Brisbin wrote:
>> I'm thinking I can also proxy my RabbitMQ servers for HA as well.
>> My proxies would be immediately responsive to changes in my cloud services, so servers will drop off and join the cloud at unknown intervals. I'm thinking I could have my RMQ clients connect to the HA
>> proxy, which load-balances requests to the configured back-end servers.
> 
> The proxy would have to operate with sticky sessions, since AMQP is a connection/session-oriented protocol, but other than that this should work.
> 
>> I could easily introduce caching here because the proxy is
>> transparent.
> 
> What would the proxy be caching? All AMQP operations carrying payloads are non-idempotent, which makes them unsuitable for caching.
> 
>> I could duplicate data coming in to multiple back-end servers
> 
> Multi-casting doesn't make sense for most operations. The obvious exception is basic.publish.
> 
> What would you do with the responses from the multiple back-end servers? How would you deal with operations that return different results depending on the back-end server? Anonymous queue declaration is one such example. Also, some aspects of AMQP are inherently racy. For example, operations on different channels can be executed in any order. That too means servers can return different responses for the same series of requests.
> 
> 
> Regards,
> 
> Matthias.

Actually, HAProxy does just about everything I need so far, so I'm just using that to front a standard cluster.

The HA I was thinking of would basically be a proxy pretending to be a single server. Incoming requests (client -> server) go out to all backend servers and responses (server -> client) go back to the client by using the first responder. The idea is that all backend servers are equal and no matter which one replies, that answer will be valid. It seems to me that any cloud or HA solution is going to involve a middle-man of some sort. No matter what service it is, something like HAProxy will have to be integrated into the platform to allow dynamic membership on the backend with a fixed front-end. 

As for caching, some of the things I'm using MQ for include running SQL queries. Since the results will be cacheable, I could return the last result directly from the proxy, saving the db connection, etc... and masking the caching from the client. Not everything would be cacheable, of course, but query bodies strike me as something I could easily cache.

Jon Brisbin
Portal Webmaster
NPC International, Inc.





More information about the rabbitmq-discuss mailing list