FS is a filesystem backend implementation for KVS. Put the {dba,kvs_fs} property for the kvs application in your sys.config.


All examples can be executed in Erlang REPL. Only requirement is to have kvs set in dependencies and kvs application started.

Create a new kvs_fs table called test. When executed, this function will create a new directory called test under data directory in the current workspace.

kvs_fs:create_table(test, []). % will return: % ok

Put a new key/value in table test. When executed, a new file is created under test directory. Its name is based on the sha1 of the key encoded in base64.

Table = test. Key = key. Value = <<"my_value">>. kvs_fs:put({test, Key, Value}). % will return: % ok

Get a key from value test.

kvs_fs:get(test, key). % will return: % {ok, {test, key, <<"my_value">>}}

Delete a key

This module may refer to: kvs.