Having tough time in understanding few things. I have two replicated service host (A & B) (may be scaled to a max 3 in future) behind a gateway. Each service host needs to save some data/state (key-value) of its respective host. To avoid SPOF, the same state/data needs to be replicated to both the host so that if one server goes down then other should be in position to serve. Please suggest some mechanism to solve this problem. (to be very specific if any distributed framework)
Master-slave replication: Host A will be master and Host B will be slave. But my question is:
- All the write request from host B will route via host A and then eventually to B.
- Also, lets say host A goes down, then there will be no write and B will stuck till A is recovered.
Is my understanding correct that write cannot be done in slave? In case there is some workaround e.g upgrading slave to master, still re-routing issue is there as mentioned previously.
I think solution can be implemented using other approach (multi-master & leaderless) though but couldn't come up with any conclusion. I tried comparing few of them:
- Redis - By default it is master-slave but enterprise version is having master-master configuration also. So could be a possible solution.
- Dynamo style - Riak, Cassandra, Voldemort etc. Not sure about complexity involved
Requirement:
- Solution must be simpler and lightweight without consuming much resource of service host machine.
- Data is in key-value format
- Read/write should very fast. (in-memory would be preferable)
- Occurrence/Frequency of read/write action is not very fast.
- Volume of data is also very less. total size of data at any host at any point may not exceed 1 mb.