write data into db file