Writing data to a single database