A poorly named experiment to see how you can distribute work among consumers based on CouchDB generated IDs.
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
ids
README
main.js

README

Usage
-----

node ./main.js [number of consumers]

Example: node ./main.js 3

The General Idea
----------------

Let's say you have a bunch of consumers polling a changes feed. You want to
divide the work between the consumers evenly, so you decide to base it on the
documents' _id since they are just big hexidecimal numbers.


Flow
----

  - Take in the results of /_uuids (from a file)
  - Grab the last 4 characters of each id
  - Converts that hex number to decimal
  - Take the remainder of that decimal number divided by the number of nodes
  - Output distribution