Repository and database