Complete implementation of the database