+1 to Xinchao's suggestion: we should have one db manager class handling the all cache too, I do not know though how the cache should be organized internally (within the class).