Search code examples
ckey-valueramg-wan

Gwan kv, persistent flag / Number of items


I have decided to use Gwan's KV store in place of a Redis NoSQL database. I saw in the Manual that the kv supports a persistent flag for file IO to keep data I guess between restarts. It uses the callback recfn, but how exactly would this function be formatted to save the KV to a file, I understand C file IO just not quite interfacing this call back and formatting the data to a file, and then the reverse of reloading it back into the KV when Gwan starts.

Also I noticed you can set the number of items that the kv will have. How can this be set so that there is technically no limit, so things can be continuously added untill you run out of ram

Thanks guys


Solution

  • The recfn callback is user-defined and allows you to decide under which format data will be stored on disk (plain-text, formated, indexed, compressed, distributed, etc.).

    We recognize a dedicated example would surely help, thanks for pointing that.

    The number of items that you can indicate at the creation of a key-value store is merely an hint aimed to using appropriate memory allocation strategies - it does not actually limit the size of an ever-growing store.