tezvyn:

Design client-side event batching and prevent unload data loss

Source: developer.mozilla.orgadvanced

It tests balancing network efficiency and data reliability in browser analytics. Strong answers cover in-memory batching with size or time triggers, sendBeacon or fetch keepalive on visibilitychange, and a retry queue.

It tests designing a high-throughput telemetry pipeline that minimizes network overhead without dropping events during page transitions. A strong answer outlines an in-memory ring buffer with size and time triggers, flushes via fetch during the session, and escalates to sendBeacon or fetch keepalive on visibilitychange or beforeunload to survive page death. It should also mention an IndexedDB retry queue for offline or failed requests.

Read the original → developer.mozilla.org

Get five bites like this every day.

Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.

Design client-side event batching and prevent unload data loss · Tezvyn