Skip to content

Instantly share code, notes, and snippets.

@jaz303
Last active August 29, 2015 14:16
Show Gist options
  • Save jaz303/7f9410aa1f6f7676faa9 to your computer and use it in GitHub Desktop.
Save jaz303/7f9410aa1f6f7676faa9 to your computer and use it in GitHub Desktop.

In this scenario, there is a single pool of combined workers/content servers, and each of these machines is authoritative for a given set of sites (probably determined by some sort of consistent hash). A dynamic reverse proxy is responsible for dispatching each incoming request to the correct worker machine based on the request hostname/path.

Plan 1

Pros

  • simple
  • exactly one machine is authoritative for each site, so no need for distributed locking (in-process lock is sufficient)

Cons

  • migration could be tricky; need to co-ordinate update of dynamic proxy's routing table with migration of content between workers
  • possible resource wastage - system anticipated to be read-heavy, yet we're running a worker pool on each machine

Plan 2

Pros

  • worker pool and content server pool can be scaled independently
  • no migration issues - all content servers capable of serving from the entire shared FS

Cons

  • complicated
  • need measures in place to deal with dangling locks
  • it's quite complicated
  • did I mention it's complicated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment