I have a prototype server[0] that's doing an os.walk()[1] for each query a client[0] makes.
I'm currently looking in to ways of caching this data in memory, speeding up queries and hopefully allowing for expansion in to storing metadata and data persistence later on.
I've experimented with SQLite before, but I find SQL complicated for tree structures, so i thought I would get some advice before actually commiting to SQLite
so is there any cross-platform, embeddable or bundle-able non-SQL databases that might be able to handle this kind of data, with a small (10k-100k files) list and extremely small amount of connections 10-20 maybe? which will scale to handling metadata as well
[0] the server and client are actually the same piece of software, this is a P2P application, thats designed to share files over a local trusted network with out a main server, using zeroconf for discovery, and twisted for pretty much everything else
[1] query time is currently 1.2s with os.walk() on 10,000 files
here's the related function in my python code that does the walking
def populate(self, string):
for name, sharedir in self.sharedirs.items():
for root, dirs, files, in os.walk(sharedir):
for dir in dirs:
if fnmatch.fnmatch(dir, string):
yield os.path.join(name, *os.path.join(root, dir)[len(sharedir):].split("/"))
for file in files:
if fnmatch.fnmatch(file, string):
yield os.path.join(name, *os.path.join(root, ile)[len(sharedir):].split("/"))