What interface should be used for HA storage
Add your comments directly to the page. Include links to any relevant research, data, or feedback.
Background
Going to rip off the docker libkv API and implement it as puppet functions under the libkv:: namespace.
A storage backend in libkv should implement (fully or partially) this interface:
Non-Atomic * delete(String $key) (Boolean) * deletetree(String $directory) (Boolean) * get(String $key) (Any) * put(String $key, Any $value) (Boolean) * exists(String $key) (Boolean) * list(String $directory) (Hash) Atomic * atomic_create(String $key, Any $value) (Boolean) * atomic_delete(String $key, Hash $previous) (Boolean) * atomic_get(String $key) (Hash) * atomic_put(String $key, Any $value, Hash previous, Hash options) (Boolean) * atomic_list(String $directory) (Hash) Support * empty_value() (Hash) * info() (Hash) * provider() (String) * supports() (Array) Defined but not implemented * watch(String $key, Queue $queue) - Not Implemented * watchtree(String $key, Queue $queue) - Not Implemented * newlock(String $key, Hash options) - Not Implemented
We will start with four backends:
- mock - This is a fake KV store that will only be used for unit and acceptance testing purposes.
- legacy-simp6 - this duplicates fakeca and passgen and other simp modules that store random files on a puppet master. This will be the default at least for the SIMP 6 major branch.
- consul - implements the storage semantics under consul
- etcd - implements the storage semantics under etcd
The default will be 'legacy-simp6' so it won't be an API breakage
Architecting is considered finished when unit and acceptance tests are created in pupmod-simp-libkv, and mockprovider passes all the tests. implementation of other backends will be other tickets.
Documentation will be another ticket blocked by this one, as I don't want to finalize docs until after the first providers are written and we attempt to integrate with existing modules
global parameters:
- url
- softfail
- debug
- auth
Relevant data
Options considered
Option 1: | Option 2: | |
---|---|---|
Description | ||
Pros and cons | ||
Estimated cost | LARGE | MEDIUM |