I'm migrating my application from Riak 1.4 to Riak 2.
In the past I have been colocating my application on every node of the Riak cluster. It connects only to the local Riak node (at localhost:8087
), monitors the availability of Riak and advertises its own availability based on that.
Remote Haproxies monitor multiple of these applications and direct enduser traffic to any available application instance:
enduser --network--> Haproxy --network--> pool[ application->riak ]
My reasons for this architecture were
- Lowest possible latency between application and Riak
- Zero-Conf of the application, it always expects Riak at localhost
- Good control of traffic distribution in HAProxy (and only there)
- Good security: protobuf was only exposed to localhost
The java-client documentation now suggests that, when connecting, a Riak client application shall be aware of all nodes of a Riak cluster. In light of this, is my approach still acceptable? Or should I instead switch to a scenario where every instance of the application is aware of, and connected to, every Riak node?