Database connection and fig configuration