Factored out record_database.py functionality.