Adaptive control for availability and consistency in distributed key-values stores