[services] Inner function to write to DynamoDB by batch
Summary:
This is a services database inner function that uses batch write to the DynamoDB.
Batch write can be used for batch putting or batch deleting items (D4220). The batch operations are much more effective than put/delete one-by-one in case of the network and database latency and DynamoDB WCU (Write Capacity Units) usage per second on a single partition.
This function splits the write requests into chunks sized by the constant from D4372 if needed and sends the write requests to the DynamoDB in chunks. Because DynamoDB has a batch operations chunk size limit.
Linear task: ENG-1302
Test Plan: Run yarn test-tunnelbroker-service-dev-mode passing the tests.
Reviewers: karol, tomek
Reviewed By: karol, tomek
Subscribers: ashoat, tomek, adrian, atul, karol, abosh
Differential Revision: https://phab.comm.dev/D4373