You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This removes the "read-your-writes" guarantee since several of the backing
stores we wish to support either do not support it or do not support it by
default.
Signed-off-by: Joel Dice <[email protected]>
Copy file name to clipboardExpand all lines: imports.md
+39-30Lines changed: 39 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -24,44 +24,53 @@ ensuring compatibility between different key-value stores. Note: the clients wil
24
24
serialization/deserialization overhead to be handled by the key-value store. The value could be
25
25
a serialized object from JSON, HTML or vendor-specific data types like AWS S3 objects.</p>
26
26
<h2>Consistency</h2>
27
-
<p>Any implementation of this interface MUST have enough consistency to guarantee "reading your
28
-
writes" for read operations on the same <ahref="#bucket"><code>bucket</code></a> resource instance. Reads from <ahref="#bucket"><code>bucket</code></a>
29
-
resources other than the one used to write are <em>not</em> guaranteed to return the written value
30
-
given that the other resources may be connected to other replicas in a distributed system, even
31
-
when opened using the same bucket identifier.</p>
32
-
<p>In particular, this means that a <code>get</code> call for a given key on a given <ahref="#bucket"><code>bucket</code></a>
33
-
resource MUST never return a value that is older than the the last value written to that key
34
-
on the same resource, but it MAY get a newer value if one was written around the same
35
-
time. These guarantees only apply to reads and writes on the same resource; they do not hold
36
-
across multiple resources -- even when those resources were opened using the same string
37
-
identifier by the same component instance.</p>
38
-
<p>The following pseudocode example illustrates this behavior. Note that we assume there is
39
-
initially no value set for any key and that no other writes are happening beyond what is shown
40
-
in the example.</p>
41
-
<p>bucketA = open("foo")
27
+
<p>An implementation of this interface MUST be eventually consistent, meaning that, after some time
28
+
with no further updates, all replicas in the (potentially distributed) system will eventually
29
+
converge on a consistent state for all values. This allows replicas to temporarily diverge to
30
+
ensure low latency and high availability. Implementations based on a centralized or local
31
+
backing store may provide a stronger consistency model, but guest components which are intended
32
+
to be portable to any <code>wasi-keyvalue</code> implementation should not rely on anything stronger than
33
+
eventual consistency.</p>
34
+
<p>Given that each <ahref="#bucket"><code>bucket</code></a> resource may represent a connection to a different replica in a
35
+
distributed system, values read for a given key from two different <ahref="#bucket"><code>bucket</code></a>s may differ, even if
36
+
those <ahref="#bucket"><code>bucket</code></a> resources were opened using the same string identifier. In addition, consecutive
37
+
operations on a single <ahref="#bucket"><code>bucket</code></a> resource may produce temporarily inconsistent results if
38
+
e.g. the implementation is forced to reconnect to a different replica due to a connection
39
+
failure. For example, a write followed by a read may not return the value just written, even if
40
+
no other recent or subsequent writes have occurred.</p>
41
+
<p>Consider the following pseudocode example (and assume we start with an empty store and no other
Copy file name to clipboardExpand all lines: watch-service.md
+39-30Lines changed: 39 additions & 30 deletions
Original file line number
Diff line number
Diff line change
@@ -22,44 +22,53 @@ ensuring compatibility between different key-value stores. Note: the clients wil
22
22
serialization/deserialization overhead to be handled by the key-value store. The value could be
23
23
a serialized object from JSON, HTML or vendor-specific data types like AWS S3 objects.</p>
24
24
<h2>Consistency</h2>
25
-
<p>Any implementation of this interface MUST have enough consistency to guarantee "reading your
26
-
writes" for read operations on the same <ahref="#bucket"><code>bucket</code></a> resource instance. Reads from <ahref="#bucket"><code>bucket</code></a>
27
-
resources other than the one used to write are <em>not</em> guaranteed to return the written value
28
-
given that the other resources may be connected to other replicas in a distributed system, even
29
-
when opened using the same bucket identifier.</p>
30
-
<p>In particular, this means that a <code>get</code> call for a given key on a given <ahref="#bucket"><code>bucket</code></a>
31
-
resource MUST never return a value that is older than the the last value written to that key
32
-
on the same resource, but it MAY get a newer value if one was written around the same
33
-
time. These guarantees only apply to reads and writes on the same resource; they do not hold
34
-
across multiple resources -- even when those resources were opened using the same string
35
-
identifier by the same component instance.</p>
36
-
<p>The following pseudocode example illustrates this behavior. Note that we assume there is
37
-
initially no value set for any key and that no other writes are happening beyond what is shown
38
-
in the example.</p>
39
-
<p>bucketA = open("foo")
25
+
<p>An implementation of this interface MUST be eventually consistent, meaning that, after some time
26
+
with no further updates, all replicas in the (potentially distributed) system will eventually
27
+
converge on a consistent state for all values. This allows replicas to temporarily diverge to
28
+
ensure low latency and high availability. Implementations based on a centralized or local
29
+
backing store may provide a stronger consistency model, but guest components which are intended
30
+
to be portable to any <code>wasi-keyvalue</code> implementation should not rely on anything stronger than
31
+
eventual consistency.</p>
32
+
<p>Given that each <ahref="#bucket"><code>bucket</code></a> resource may represent a connection to a different replica in a
33
+
distributed system, values read for a given key from two different <ahref="#bucket"><code>bucket</code></a>s may differ, even if
34
+
those <ahref="#bucket"><code>bucket</code></a> resources were opened using the same string identifier. In addition, consecutive
35
+
operations on a single <ahref="#bucket"><code>bucket</code></a> resource may produce temporarily inconsistent results if
36
+
e.g. the implementation is forced to reconnect to a different replica due to a connection
37
+
failure. For example, a write followed by a read may not return the value just written, even if
38
+
no other recent or subsequent writes have occurred.</p>
39
+
<p>Consider the following pseudocode example (and assume we start with an empty store and no other
0 commit comments