Is there a disk backed Dict somewhere? I would like to be able to do the following:
d = DiskBackedDict{K,V}(mypath)::Associative{K,V} # load or create new one if not existing
x = d[foo] # this is as fast as an ordinary Dict lookup.
d[bar] = y # this may be dog slow, but the result must be stored at mypath
d2 = DiskBackedDict{K,V}(mypath) # error mypath already in use
Wondering how big is the dictionary of data you are thinking about using? If it’s smaller one can roll a simple solution fairly quickly in a couple of hours.
Not sure if one already exists
Not big, maybe 100mb at most. I guess its indeed not too hard to implement this. However if there is an existing solution I would prefer that. Also there are some implementation issues I am unsure about:
For storage of arbitrary julia objects, JLD is the only option I can think of. But I don’t know if there is a way to modify a value in a JLD file. The only way I am aware of is delete the file and save the modified version.
I am not sure how to do the locking of a path that belongs to an active DiskBackedDict.
What you are essentially doing is making something like key-value based store - and it’s not that difficult to make a Julia for them. I made one back in 2015 for Aerospike, that we use for our product at http://www.dynactionize.com.
It is an INI like file but it fits much better to Julia since the type of the values can be specified. If you don’t have to complicated types this could be a very goos solution. One big plus for me was that I can hand edit the files.