rust-rpxy icon indicating copy to clipboard operation
rust-rpxy copied to clipboard

Dynamic routing..

Open fairbairn opened this issue 1 year ago • 1 comments

Would there be an interest in extending the product to support dynamic routing?

What I mean is that the routing table is external and dynamic to the running proxy application, and it periodically refreshes its internal lookup table without a restart.

In the NGINX world, this would require a new config and a SIGHUP.

We have a scenario where our routing data is actually in REDIS and used as a shared cache.

We'd like to run multiple copies of rust-rpxy as a proxy array to a set of origin servers. Each origin server has a specific piece of content, but this is not known beforehand.

The content is placed on the origin ad-hoc, and then a reference to the content pointing to the origin IP is stored in Redis.

So if I'm looking for content of /content/what, and "what" was uploaded into origin 192.168.1.2, then our redis would have some lookup table where "content/what" maps to "192.168.1.2".

This redis content is updating constantly, but you would only need to query it periodically to insure the routing is current.

We'd like to use rpxy in some way to load this dynamic lookup table so as requests come in, it knows the proper server IP to proxy to in order to serve the request.

We could build an application to query our Redis server and write a new .toml config file for each rpxy we have running, but this becomes cumbersome, and we'd still need the ability to update the config with a sighup to avoid downtime.

What would be better is if it could query the redis server directly, then we only have to configure the rpxy to pull it's configuration (which is the same for every instance) from a central place.

pull instead of push.

Let me know your thoughts.

fairbairn avatar May 15 '23 04:05 fairbairn