Skip to main content
Question

Risk of unordered events using HTTP V2 API asynchronously

  • 2 July 2024
  • 3 replies
  • 34 views

Hello!  ⁠Looking at Amplitude's Raw Data Fields Documentation, a user's event stream is reported based on event_time. 

event_time = client_event_time + (server_received_time - client_upload_time)

  • What exactly is client_upload_time? Docs say "client_upload_time: Local timestamp (UTC) when the device uploaded the event." I'm not clear on what that means.
  • We are thinking about incorporating backend events with our frontend events.  Our backend is in Ruby so we'd use the HTTP V2 API asynchronously.  Will performing asynchronously open the risk for un-ordered events? 

Appreciate any insight. Thanks! 

3 replies

Userlevel 2
Badge +5
Hi morancathy,

The `client_upload_time` is the local timestamp (UTC) when the device uploaded the event. This timestamp is generated when the event is sent from the client side to Amplitude's servers. It's important to note that this timestamp can be influenced by factors such as the device's clock settings, internet connection quality, and event batching logic in the SDKs.

As for your question about the risk of unordered events when using the HTTP V2 API asynchronously, it's a valid concern. If events are not uploaded immediately, the recorded event time can differ significantly from the original time the event was fired. This could potentially lead to unordered events. However, Amplitude has mechanisms in place to adjust for this. The `event_time` in Amplitude, which is used for reporting, is calculated as `client_event_time` adjusted by the difference between `server_received_time` and `client_upload_time`.

That being said, it's always a good idea to monitor your data after implementing new data ingestion methods to ensure everything is working as expected.

You can read more about this here: https://www.docs.developers.amplitude.com/data/sdk-troubleshooting-and-debugging#client-event-time-shows-unexpected-value

I hope this helps! Let me know if you have any other questions.

Best,
Yosimy


P.S. Checkout upcoming events and user meetups on our events page.

Thank was a super fast response Yosimy! 

Thanks so much for your insight and further documentation. This helps a lot in our planning.

Cheers, 

Cathy

Userlevel 2
Badge +5
Hi Cathy,

You're very welcome, happy to have helped!

Best,
Yosimy


P.S. Checkout upcoming events and user meetups on our events page.

Reply