database implementation with main functionalities