Database config and model implemantation