Dynamically choose database location