Implement database.