Monday, July 29, 2013

ZeroMQ instead of HTTP, for internal services

This article describes how to use ZeroMQ for RPC calls to internal services. HTTP is the canonical choice for public facing services. But for RPC to internal services in systems composed of many small parts, you're probably better off using ZeroMQ instead of HTTP.

In summary, the benefits ZeroMQ offers over HTTP are:

  • Multiple concurrent RPC calls over the same TCP connection. With HTTP, you're limited to sequential calls (keep-alive). This is a big one. 
  • No manual connection management. This isn't impossible to do with HTTP, and is mostly a library problem, but AFAIK few libraries exist that lets you do this right with HTTP. 
  • Supports multiple server processes responding to requests. No HTTP load balancer needed. 
  • No manual retry handling. Can stop the server, do a RPC, then start the server, then get a response - the message is queued, instead of delivered directly.
Read more here

Leave a Reply

All Tech News IN © 2011 & Main Blogger .