start with write to db