deal database and controller