Write db interfaces to make it easier to operate database.