Db write caching