new write_db