Metaswitch/crest — pull request #50 by rkd-msw (2013-08-16 16:07:48+00:00)
Title: {Reviewer: Andy} More efficient read-only version of Homestead

Andy, as discussed, this is the read-only version of my new, more efficient Homestead API.

Note that:
* PassthroughHandler doesn't make as much sense in this context, so I don't use it. It's still used in Homer.
* I've created a new Cassandra wrapper to unify common operations, and to contain ha_get and ha_get_slice. This means code duplication between this and PassthroughHandler; I'll convert PassthroughHandler to use my new Cassandra wrapper before I merge dev_new_homestead_api into dev.
* Because we agreed on a homestead_cache and homestead_provisioning keyspace, we no longer map one Cyclone application to one Cassandra keyspace, which makes things a bit weird. I suspect the right long-term answer is to drop that assumption, and have Homer set up its own Cassandra connection rather than that happening in main.py.
* I've used send_error rather than throwing an exception on a cache miss, which makes our performance in that case a bit better.
* Speaking of which, I don't have any backend code - I just return 404 on a cache miss.

I've built a .deb, installed it (manually creating the keyspaces and tables) and tested it with ab, getting reasonable response times (average 4ms per concurrent request).