

Pushing to 100,000 API clients simultaneously - jkarneges
http://blog.fanout.io/2013/10/30/pushing-to-100000-api-clients-simultaneously/

======
rpedela
Pretty cool!

1\. Is there a way to route a request to a specific backend server? For
example, all file uploads go to one server and everything else goes to
another? Personally, I would use something like this if I could add custom
routing logic.

2\. What about handling authentication? Then the request is never submitted to
the backend. Again it could just be a hook for custom logic.

3\. Similar to #2. Is there a way to have custom validation logic? Some
validation is very application-specific which I am not talking about. However
sometimes you want to validate that the request is HTTPS, JSON formatted, etc.

~~~
jkarneges
1\. Pushpin can route by the start of the request path using the path_beg
parameter in the rule (e.g. "*,path_beg=/uploads [upload server]"). For more
advanced routing logic I suggest putting HAProxy in front of Pushpin.

2\. I'm not sure I follow. If authentication is used (say with Authentication
or Cookie headers), then the request just gets passed to the backend server
like any other request. Would you not want this?

3\. This probably doesn't belong at the Pushpin layer. X-Forwarded-Protocol is
used to indicate use of HTTPS, though, which the backend could use as input
for enforcement.

~~~
rpedela
For my use case, I see Pushpin or something like it being more of a server
that handles client connections, auth, and routing. Kinda like a super load
balancer. Then you could have a normal load balancer in the front to give
clients a single IP to connect to. The whole point being to reduce load on the
app server, DB, etc by performing logic (auth, basic validation) that must be
performed on every request.

I can understand if that is not the goal of the project since the main focus
seems to be realtime over HTTP.

~~~
jkarneges
I have been considering some special auth support. For example, there could be
rules like "if an Authentication header is identical for multiple requests,
then assume it is from the same authenticated user entity without necessarily
forwarding the request to the origin server again". This alone doesn't buy you
anything, but it could be used as the basis of further rules such as a cache
layer that caches per-user.

These ideas are not totally baked but could help in reducing load to the
backend servers, which falls in line with Pushpin's goals.

~~~
rpedela
Sounds great. Definitely an interesting project that I will keep my eye on.
Yes I am a cyclops... :)

