Generalize database component to work in dev and in prod