Database file and register function