HomePhabricator
Diffusion Comm ecd2f2cb68fe

[services] Inner function to write to DynamoDB by batch

Description

[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

Details

Provenance
maxAuthored on Jun 27 2022, 6:19 PM
Reviewer
karol
Differential Revision
D4373: [services] Inner function to write to DynamoDB by batch
Parents
rCOMMa84aa5c62bc3: [services] Tunnelbroker - Change in `getAwsRegion()` function to use `.
Branches
Unknown
Tags
Unknown