hard

Design an Event Lifecycle Management System

Design a scalable and fault-tolerant system to manage and analyze events with distinct start and end points. The system must ingest large volumes of event data from various services and support querying to determine the status of events at any given time (older than 24 hours), even when events arrive out of order or significantly delayed. An event can last up to one hour.

Key requirements:

- Scalability: The system must handle data volumes that cannot be stored on a single disk or managed by a single server, requiring a distributed and horizontally scalable architecture. - Out-of-Order and Delayed Events: The system must handle events arriving out of order (e.g., an endEvent arriving before its corresponding startEvent) and also manage events that may arrive hours or days after they actually occurred. - APIs:

- startEvent(eventid, timestamp): Record the start of an event. - endEvent(eventid, timestamp): Record the end of an event. - getOngoingEvents(timestamp): Return the count of events ongoing as of the specified timestamp. Can be called only for a timestamp older than 24 hours.

- Data Storage: Efficiently store event data, with appropriate indexing and sharding strategies, and optimize for querying the status of events. - Fault Tolerance: Ensure the system is fault-tolerant and supports eventual consistency.

This problem focuses on designing a system that efficiently manages and queries event data, accommodating out-of-order and delayed events while ensuring scalability and fault tolerance.

Loading the workspace...