Transnational KV store API

I’m interested in what APIs were needed in your KV store.
I’ve seen you needed the following to get wide-column store:

  • TransactionPut(Key, Value, [Condition possibly on another key])
  • Scan (start, end)

Note: I understand how you’ve reused scan to implement Get(row) due to they way you’ve encoded columns as values with the table/index/key/ as the prefix, which is quite clever, if memory intensive.

But as you’ve implemented more of SQL, what have you found you needed in your KV store?

An interesting one is Conditional-Put (CPut) which puts a key only if there is a certain existing value, or no existing value. This is useful for unique indexes (including the primary index) so it is used in most inserts (the exception is when we can overwrite values, e.g. upsert).

We don’t have at the KV level a primitive to put a key A conditional on the value or existence of another key B.

We also have primitives for deleting keys and ranges of keys.