ideawu / ssdb

SSDB - A fast NoSQL database, an alternative to Redis
http://ssdb.io/
BSD 3-Clause "New" or "Revised" License
8.19k stars 1.41k forks source link

Reload SSDB config without losing connections (SIGHUP) #1228

Open rhessing opened 6 years ago

rhessing commented 6 years ago

Currently I'm dockerizing SSDB to cope with autoscaling using master-master-master-etc replication. However, when I scale my service the new container will discover current containers. But the currently running containers also get notified of the new container and add it as a new master within the SSDB configuration. Then the ones running will restart SSDB to also slave from the new container.

Currently a SSDB restart will disconnect any running request which is not so nice. Can the configuration reload be done without a restart but a reload? Just like Apache/Nginx can?

This will enable horizontal scaling without service interruption :-)

ideawu commented 6 years ago

I used to think a lot on SSDB distributed.

I think the easiest way is to make a proxy, clients connect to the proxy, not to SSDB instance directly. The proxy knows any SSDB instance down and up, so it can make its decision to write to/read from which SSDB instance.

Distributed storage system is extremly complicated. So by this time, SSDB relies on users decisions.

rhessing commented 6 years ago

So a configuration reload is not possible?

ideawu commented 6 years ago

Not possible.