update db read/write