db directory handling