Skip to content

Commit 4573243

Browse files
Fixing markdown rendering
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
1 parent 93ab0e6 commit 4573243

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

docs/compatibility.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
#Cross-Backend Compatibility
1+
# Cross-Backend Compatibility
22

33
The value of `libkv` is not to duplicate the code for programs that should support multiple distributed K/V stores like the classic `Consul`/`etcd`/`zookeeper` trio.
44

55
This document provides with general guidelines for users willing to support those backends with the same code using `libkv`.
66

77
Please note that most of those workarounds are going to disappear in the future with `etcd` APIv3.
88

9-
##Etcd directory/key distinction
9+
## Etcd directory/key distinction
1010

1111
`etcd` with APIv2 makes the distinction between keys and directories. The result with `libkv` is that when using the etcd driver:
1212

@@ -17,7 +17,7 @@ This is fundamentaly different than `Consul` and `zookeeper` which are more perm
1717

1818
Apiv3 is in the work for `etcd`, which removes this key/directory distinction, but until then you should follow these workarounds to make your `libkv` code work across backends.
1919

20-
###Put
20+
### Put
2121

2222
`etcd` cannot put values on directories, so this puts a major restriction compared to `Consul` and `zookeeper`.
2323

@@ -32,7 +32,7 @@ _ := kv.Put("path/to/key", []byte("bar"), nil)
3232

3333
Will work on `Consul` and `zookeeper` but fail for `etcd`. This is because the first `Put` in the case of `etcd` will recursively create the directory hierarchy and `path/to/key` is now considered as a directory. Thus, values should always be stored on leaves if the support for the three backends is planned.
3434

35-
###WatchTree
35+
### WatchTree
3636

3737
When initializing the `WatchTree`, the natural way to do so is through the following code:
3838

@@ -63,7 +63,7 @@ events, err := kv.WatchTree(key, nil)
6363

6464
The code above will work for the three backends but make sure to not try to store any value at that path as the call to `Put` will fail for `etcd` (you can only put at `path/to/key/foo`, `path/to/key/bar` for example).
6565

66-
##Etcd distributed locking
66+
## Etcd distributed locking
6767

6868
There is `Lock` mechanisms baked in the `coreos/etcd/client` for now. Instead, `libkv` has its own implementation of a `Lock` on top of `etcd`.
6969

@@ -79,4 +79,4 @@ The general workflow for the `Lock` is as follows:
7979

8080
The whole Lock process is highly dependent on the `delete`/`expire` events of `etcd`. So don't expect the key to be still there once the Lock is released.
8181

82-
For example if the whole logic is to `Lock` a key and expect the value to still be there after it has been unlocked, it is not going to be cross-backend compatible with `Consul` and `zookeeper`. On the other end the `etcd` Lock can still be used to do Leader Election for example and still be cross-compatible with other backends.
82+
For example if the whole logic is to `Lock` a key and expect the value to still be there after it has been unlocked, it is not going to be cross-backend compatible with `Consul` and `zookeeper`. On the other end the `etcd` Lock can still be used to do Leader Election for example and still be cross-compatible with other backends.

0 commit comments

Comments
 (0)