Closed dzvancuks closed 2 years ago
We actually run go-ipam with postgres backend with multiple instance and no problems because postgres has a good optimistic lock implementation we use.
I must admit that i am not an expert in Redis, but as far as i can tell the integration tests pass for redis, and in the integration test there are many tests for this exact szenario.
Yes, I see that SQL storage uses transactions with commit/rollback action.
Updated title to emphasize Redis commands.
I would appreciate a pull request which will ensure the same guarantees for the redis storage
I have to admit I missed the Watch
command. It triggers transaction with similar to commit or rollback operations.
Sorry for that. I'll close issue.
I'm trying to implement IPAM in stateless environment using Redis as central DB. After analyzing redis module it seems that there will be racing and traffic congestion issues.
Library is OK for single node operation, but won't do on multinode due to lack of syncronization. Easy and dirty solution would be SETNX as a mutex. But this will slow operatons while other nodes wait for lock release.
There is also PubSub model. Where nodes can passively watch for key chanes. This way nodes can track updates and react faster on them.
And finally we should keep in mind latency. Extra checks and retries increases traffic. Instead it is more preferable to Pipeline or Script Redis commands.