write,read in db