I am designing an app that requires that all requests to our servers be routed through a single 'dispatcher'-type server. This server will, based on an API key sent in the request, forward the request on to an appropriate backend server, than relay the response back to the client.
eg., an incoming request could be http://example.com:6578/<api_key>/create?name=example&date=title
My first instinct is to use PHP with Lighttpd for the dispatcher, and store the api-key / server mappings with membase. However, this router could end up routing a huge number of requests, so performance is key.
At the same time, Lighty with APC is quite fast, and horizontally scalable.
Any suggestions for languages / architectures that should be used for something like this?
Edit: Key-value pairs would be fetched from membase or a similar key-value store. So, for and api_key of 1234, membase will return the IP 123.456.789.101. We would then forward perform the request to http://123.456.789.101/<client>/create?name=example
, and return the response back to the client.