Load data
The load data phase manages the creation and updating of items in the external system.
Triggering event
Airdrop initiates data loading by sending a message with the event type START_LOADING_DATA
to the snap-in.
If the maximum Airdrop snap-in runtime (13 minutes) has been reached,
the snap-in must respond to Airdrop with a message with event type of DATA_LOADING_PROGRESS
, together with an optional progress estimate.
In case of DATA_LOADING_PROGRESS
, Airdrop starts the snap-in with a message with event type CONTINUE_LOADING_DATA
.
Once the data extraction is done, the snap-in must respond to Airdrop with a message with event type DATA_LOADING_DONE
.
Implementation
This phase is defined in load-data.ts.
Loading is performed by providing a list of item types to load (itemTypesToLoad
), ordered in the sequence they should be loaded.
Each item type must provide create
and update
functions, which handle the denormalization of records to the schema of the external system and facilitate HTTP calls to the external system. Both loading functions must manage rate limiting for the external system and handle errors. The create
and update
functions should return an id
of the record in the external system and optionally also modifiedDate
. If a record cannot be created or updated, they indicate the rate-limiting offset or errors.