I have looked at the key-value database Redis and am curious about alternatives that would offer the following:
-
Instead of starting an external database engine as a separate process, and then connecting to it, e.g. via the C interface:
redisContext *c = redisConnect("127.0.0.1", 6379);Is there an alternative that gives the option of including the database code as a library, and loading the data as a file within-binary? For example, given the binary
myDbBinaryand the command:$ myBinary --filter=filterOptions db.datThe binary
myBinarywould not start a separate db process and connect to its port, but, instead,myBinaryloads the keys (and hashes) from the filedb.datinto memory (or similar VM arrangement) which it can then filter (withfilterOptions, whatever they might be) and perform key/hash lookups. -
C and Python interfaces to data and storage directives.
-
Hash support, by which I mean a key maintains a hash table as a value.
Does any software like this exist?
No, Redis works as a process, not as a library. There is no way currently of doing so. You can use alternatives like Kyoto Cabinet (which is more redis-like).
Kyoto has hash tables support for C and Python.
Alternatively you can use SQLite but it’s quite different than what you asked.