You are designing a basket abandonment system for an ecommerce company. The system will send a message to a user based on these rules: ✑ No interaction by the user on the site for 1 hour Has added more than $30 worth of products to the basket ✑ Has not completed a transaction You use Google Cloud Dataflow to process the data and decide if a message should be sent. How should you design the pipeline?
Show Answer & Explanation
Correct Answer: C. Use a session window with a gap time duration of 60 minutes.
A session window groups events by user activity and closes after a defined period of inactivity — exactly matching the rule "no interaction for 1 hour." When the session closes after 60 minutes of inactivity, Dataflow can evaluate the basket state and trigger a message. Fixed windows (A) split time into equal chunks regardless of user activity. Sliding windows (B) overlap and don't represent inactivity gaps. Global windows (D) collect all data and don't naturally model per-user inactivity.