Dispatch rules in riak
alanmckean at me.com
Tue Feb 2 20:35:48 EST 2010
I have been trying to set up my own routing rules to allow for serving
up static files alongside the dynamic data that I server up from Riak,
and any help will be greatly appreciated.
While there was a demo in previous versions of Riak taht showed how
the dispatch map was set up (stickynotes), the latest version seems to
not have a similar example. There is an example ('demo') in the apps/
webmachine directory, and it shows how to set up dispatch rules in the
webmachine_demo_sup:init/1, but it seems to have no relationship to
riak. Can someone inform me about how to set up my own routes in Riak?
A related question regards architecture: is it preferable to have
separate webmachine instances that are calling and load-balancing
across a tier of Riak servers (via http or riak_client calls) or to
embed your application in the Riak instances themselves and hitting
them directly from the browsers? The question that I posed above
relates to putting app logic in the Riak instances and controlling the
routing to that logic. The other approach (fronting the Riak instances
with Webmachine instances would either using http REST or duplicating
code that exists in Riak for converting the incoming request data
(e.g., json) to the raw_resource format that riak_client calls use.
More information about the riak-users