Permalink
Browse files

update readme

  • Loading branch information...
igrigorik committed May 4, 2011
1 parent eb69280 commit 649bd1da502449dd2d4e2e49a358d5af39d1faea
Showing with 7 additions and 5 deletions.
  1. +7 −5 README.md
View
@@ -27,13 +27,15 @@ Ultimately this functionality should be nothing more than a module in Nginx, Apa
**Converting HTTP to a stream oriented protocol:** HTTP is not built for stream multiplexing, but protocols like [SPDY attempt to solve this](http://www.igvita.com/2011/04/07/life-beyond-http-11-googles-spdy/) by introducing an explicit concept of streams and stream IDs into each packet. Hence, Goliath parses the HTTP request and converts the incoming request into SPDY protocol (Control + Data packets) - in other words, `router.rb` is an HTTP -> SPDY proxy.
-**Decoupling frontends from backends:** Usually a router needs to be aware of all the backends before it can decide where to route the request (i.e. Nginx example above ane exactly what we want to avoid). Instead, our router does something smarter: it uses [ZeroMQ XREP/XREQ](http://www.igvita.com/2010/09/03/zeromq-modern-fast-networking-stack/) sockets to break this dependency. Specifically, the router *binds* an XREQ socket on port 8000 when it first comes up - nothing more, nothing less. The router accepts HTTP requests and pushes SPDY packets to port 8000 (the router knows nothing about where or how many backends there are).
+**Decoupling frontends from backends:** Usually a router needs to be aware of all the backends before it can decide where to route the request (i.e. Nginx example above and exactly what we want to avoid). Instead, our router does something smarter: it uses [ZeroMQ XREP/XREQ](http://www.igvita.com/2010/09/03/zeromq-modern-fast-networking-stack/) sockets to break this dependency. Specifically, the router *binds* an XREQ socket on port 8000 when it first comes up. The router accepts HTTP requests and pushes SPDY packets to port 8000 - the router knows nothing about where or how many backends there are.
-Next, we have `hello.rb` which is a simple example of a worker process, in this case written in Ruby, but it could be any language or runtime. What does it do? It connects to port 8000 when it comes up and waits to receive 0MQ messages, which are actually carrying SPDY frames - 0MQ + SPDY are a great match here, since both are message and stream oriented.
+Next, we have `hello.rb` which is a simple example of a worker process, in this case written in Ruby, but it could be any language or runtime. What does it do? It connects to port 8000 (via an XREP socket) when it comes up and waits to receive 0MQ messages, which are actually carrying SPDY frames - 0MQ + SPDY are a great match here, since both are message and stream oriented.
-That's it. The cool part.. Start the router, and then start as many workers as you want, or shut them down at will. 0MQ will do all the work for connection setup and/or teardown. Our router knows nothing about how many workers there are, and our worker knows nothing about how many frontends there are. Now all we need is an Nginx module. :-)
+That's it, and the best part is.. Start the router, and then start as many workers as you want, or shut them down at will. 0MQ will do all the work for connection setup and teardown. Our router knows nothing about how many workers there are, and our worker knows nothing about how many frontends there are. Now all we need is this as an Nginx module! A quick visual representation of what is happening here:
-(If you're not familiar with 0MQ: XREQ socket automatically load-balances incoming requests (round-robin) to all the XREP workers. As implemented the example code will buffer the incoming HTTP request before it is dispatched to the worker but will/can stream the response back from the worker without waiting for complete response).
+![arch](https://img.skitch.com/20110504-kqgt26cyjiapj3hqy5j6m7t6hk.jpg)
+
+(If you are not familiar with 0MQ: XREQ socket automatically load-balances incoming requests (round-robin) to all the XREP workers. As implemented the example code will buffer the incoming HTTP request before it is dispatched to the worker but will/can stream the response back from the worker without waiting for complete response).
## Summary
@@ -75,4 +77,4 @@ Now kill one of the workers, and send a new request.. ZMQ does all the cleanup w
- [ZeroMQ: Modern & Fast Networking Stack](http://www.igvita.com/2010/09/03/zeromq-modern-fast-networking-stack/)
- [Life beyond HTTP 1.1: Google’s SPDY](http://www.igvita.com/2011/04/07/life-beyond-http-11-googles-spdy/)
-- [@igrigorik](http://www.twitter.com/igrigorik)
+- [@igrigorik](http://www.twitter.com/igrigorik)

0 comments on commit 649bd1d

Please sign in to comment.