Our use case evolved during time, at the beginning we wanted one domain, multiple zones, cross regions (WAN) - that was hasr to maintain, error prone.
So we placed:
1.) redis pub/sub in the middle
2.) one domain with one zone for GUI and some logic to main region
3.) every executor/worker node with multiple containers contains one domain, with 2 zones, every container contains one node
I tried NATS only on localhost, not in server environment yet. Basicly I believe, it should be a more performant redis replacement,
the idea behind it is almost the same (channels patterned subscriptions).
What use case arised these days is the following:
There are cases, where there can be only one connector to external system, which is reused by multiple executors.
But the executors doesn't know about eache other, so the first one, that creates that connector marks that to redis, holding a time evicted lock with it's address and connector identifier.
Other executor first tries to acquire that lock on redis, and if they don't suceed, than they just get the first nodes address and redirect their requests there (sync and async).
Something like rs or ws, looked like a good fit at least for prototyping, although not very performant one. "Patterned channels" was actualy the next logical step we thought of - exactly as you suggested, but with redis (but we will test also NATS).
They require some additional logic to make sync and async over it, and some level of reliability, but it looks like there is no simpler way...
On Thursday, November 26, 2015 at 2:23:22 PM UTC+1, Tomáš Fecko wrote:
Hi Tomas,
With clustered REST services I would use a load balancer with one of the following setups:
1. Static routing
2. Kubernetes which can manage dynamic IP addresses and DNS resolution
It
sounds as if static routing won't work for your use case and Kubernetes
is too much overhead. Have you had a chance to look at the NATS
binding? It's a simple solution since it eliminates the need to manage
changing endpoint addresses. Basically you could bring up a single NATs
instance or a cluster and clients/services connect to it, which
eliminates the need to propagate endpoint routing information to the
clients.
Currently the NATS binding supports
channels but I can easily added support for request/reply. Would that
work for you? Otherwise, we would have to discuss how to propagate REST
endpoint which overlaps a lot of the functionality offered by solutions
like Kubernetes (and which become complicated in container-based
environments).
Jim