implement the db model and interface