in reply to Database in a folder?

I would be careful with using threads on your database: depending on the filesystem you are using you can have nasty issues with concurrent access to the same file: what will happen if two threads try to change the same file? At best you get an error or at worst you mess up the contents of the file.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James