Tickets:
Jira Legacy server System JiraFOLIO Issue Tracker serverId 01505d016ccf3fe4-b8533301-3c2e368a-90f1983e-ee9b165564fc20c466b11a49 key CIRC-573 Jira Legacy server System JiraFOLIO Issue Tracker serverId 01505d016ccf3fe4-b8533301-3c2e368a-90f1983e-ee9b165564fc20c466b11a49 key UICIRC-736
Batch API
Existing API endpoints to provide batch API alternative of:
...
These endpoints would follow a similar design structure as to those described here:
Jira Legacy server System JiraFOLIO Issue Tracker serverId 01505d016ccf3fe4-b8533301-3c2e368a-90f1983e-ee9b165564fc20c466b11a49 key FOLIO-2050 - https://issues.folio.org/secure/attachment/20079/Possible%20batch%20api%20workflow.png
References:
Jira Legacy server System JiraFOLIO Issue Tracker serverId 01505d016ccf3fe4-b8533301-3c2e368a-90f1983e-ee9b165564fc20c466b11a49 key MODUIMP-57 Jira Legacy server System JiraFOLIO Issue Tracker serverId 01505d016ccf3fe4-b8533301-3c2e368a-90f1983e-ee9b165564fc20c466b11a49 key MODINVSTOR-478 Jira Legacy server System JiraFOLIO Issue Tracker serverId 01505d016ccf3fe4-b8533301-3c2e368a-90f1983e-ee9b165564fc20c466b11a49 key MODINVSTOR-353 Jira Legacy server System JiraFOLIO Issue Tracker serverId 01505d016ccf3fe4-b8533301-3c2e368a-90f1983e-ee9b165564fc20c466b11a49 key RMB-505 Jira Legacy server System JiraFOLIO Issue Tracker serverId 01505d016ccf3fe4-b8533301-3c2e368a-90f1983e-ee9b165564fc20c466b11a49 key FOLIO-1156 - https://s3.amazonaws.com/foliodocs/api/mod-inventory-storage/instance-storage-batch.html
- https://s3.amazonaws.com/foliodocs/api/mod-inventory-storage/instance-sync.html
- https://www.citusdata.com/blog/2017/11/08/faster-bulk-loading-in-postgresql-with-copy/
- https://stackoverflow.com/questions/46715354/how-does-copy-work-and-why-is-it-so-much-faster-than-insert
- How to design batch API (General recommendations)
- https://www.postgresql.org/docs/12/sql-values.html
The Design
The existing renewal process is too slow. However, having a batch perform one operation at a time has also proven problematic. The suggested design is to have a batch queue up a defined number of renewals and then perform the operation.
The business logic can perform a pre-process where it checks to see if any of the renewals would fail for business logic reasons. Queue all renewals that pass the business logic test and then when the queue size is reached perform the SQL operation on that queue. This is potentially problematic in that if something fails in the queue the entire queue might be considered a failure. If this is undesired then a queue size of 1 must be used.
...