Grouped history log storage into a batch to reduce datastore transaction numbers