Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
The code for the demo at my Scottish Ruby Conf talk
branch: master

This branch is 3 commits behind tyler:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
nginx
roles
views
.gitignore
README
client.rb
server.rb

README

Demo for the talk "Distributed Systems with Rack"
-------------------------------------------------

This is the complete code for my Scottish Ruby Conference talk. It demonstrates the idea
of having a website generated by multiple distinct and distributed services.  For the
purposes of the demo, we have a server application which assigns roles to computers that
connect.  In reality, you'd probably have a legitimate proxy server sit in front of the
clusters of nodes...

In our case though, we keep a list of clients that are connected, and which roles
they've been assigned to. When we want to generate a page, we determine which roles are
necessary, pick one of the clients from each role at random, and use Nginx to combine
the results into a single page.



Client Startup
--------------

ruby client.rb 1.2.3.4:9876



Server Startup
--------------

nginx -c /path/to/distributed_demo/nginx/nginx.conf
ruby server.rb 9876



Cheers,

  Tyler
Something went wrong with that request. Please try again.