Solved

Import API batch transactional?

  • 30 March 2021
  • 1 reply
  • 37 views

  • New Participant
  • 0 replies

Hi everyone,

 

I’m currently importing events saved in a mongoDB via the /import endpoint. At the moment my java implementation sends 1 event per request. Also the status(if response is 1= SUCCESS, 0 = FAILED) of each request is saved on my side so an event is not imported twice. Because i have a lot of historical data that i need to import, i would like to send 50 events in batch.

 

My question is, is the processing on mixpanel side transactional? So if i receive a 0 as response, am i sure no event was saved?

 

 

Thanks

icon

Best answer by ArthurCilley 9 April 2021, 01:38

Hi rwi,

 

Unless you have a retry mechanism set-up on your end, referencing here:

When sending a batch request to Mixpanel, we will accept the request and return a '1' status if at least one of the events is valid. In this case, invalid events are dropped. If no events are valid, then a '0' status will be returned.

It sounds like there may be also concern around duplicate tracking for retry attempts. If so, you can leverage the special $insert_id property that Mixpanel uses in conjunction with the event name, timestamp and distinct_id as a deduplication key.  See here for more details.

This means that if you are including a $insert_id that’s universally unique to each individual event, Mixpanel will reconcile and deduplicate the data even if you send in multiple instances of the same event with matching $insert_ids.  This can help alleviate the precision in ensuring there isn’t duplication or missed tracking of events.

Would this help?

Warm Regards

View original

1 reply

Hi rwi,

 

Unless you have a retry mechanism set-up on your end, referencing here:

When sending a batch request to Mixpanel, we will accept the request and return a '1' status if at least one of the events is valid. In this case, invalid events are dropped. If no events are valid, then a '0' status will be returned.

It sounds like there may be also concern around duplicate tracking for retry attempts. If so, you can leverage the special $insert_id property that Mixpanel uses in conjunction with the event name, timestamp and distinct_id as a deduplication key.  See here for more details.

This means that if you are including a $insert_id that’s universally unique to each individual event, Mixpanel will reconcile and deduplicate the data even if you send in multiple instances of the same event with matching $insert_ids.  This can help alleviate the precision in ensuring there isn’t duplication or missed tracking of events.

Would this help?

Warm Regards

Reply


Mixpanel