mdsol/cassandra_priam_cookbook — pull request #1 by benton (2013-12-06 03:12:09+00:00)
Title: Feature/refactor simpledb

This PR includes (unfortunately) some pending work that is not mine.

My additions are mostly refactoring:

* changed overall structure from a list of copy-pasted commands to a DRY, "build data from config, then act in one place" code structure
* removed many needlessly quoted Ruby expressions
* replaced brittle fog /excon dependencies with Amazon-supported aws-sdk

For me, there are many aspects of this cookbook's behavior whose motivation remains unclear. Leader election seems to be solely for the purpose of determining whether or not to write to SimpleDB, even though the commands to do so are identical and idempotent from any system in the cluster. Because the algorithm is based on lexical ordering, and the timing is in no way coordinated between systems, the potential for nodes choosing a different leader is quite high -- so it's probably just as well that these effects are limited.