Problem Statement: Notifications and Updates
💁♂️ Problem
Job-To-Be-Done (JTBD): "When I am tracking an asset or an order, I need to see its live, up-to-the-second status and location, so I can make timely decisions and have confidence in the system."
Pains to Resolve:
-
Information Lag: Customers receive outdated information due to polling intervals (e.g., data is 1-10 minutes old). This causes a lack of trust in the platform.
-
Manual Effort: Users are forced to manually refresh pages or re-open the app to get the latest status, leading to a frustrating and inefficient user experience.
-
Reactive, Not Proactive: Users find out about critical events (like a delivery arrival or status change) after a delay, preventing them from reacting in a timely manner.
-
Poor User Experience: The system feels slow, static, and disconnected from the real-world events it's supposed to be tracking.
🎯 Measuring Success
Leading Indicators (System Performance):
-
Data Latency: Reduce the time from an event occurring in the physical world (e.g., GPS ping) to it being reflected in the UI to under 1 second ($P_{95} < 1000ms$).
-
Reduction in Polling API Calls: Decrease the number of
GETrequests from clients for status updates by over 95%, significantly reducing server load. -
WebSocket Connection Stability: Achieve and maintain a WebSocket connection success rate of $>99.5%$ for active user sessions.
Lagging Indicators (Business & User Impact):
-
Customer Satisfaction (CSAT): Increase in CSAT scores related to "system responsiveness" and "timeliness of information."
-
Reduced Support Tickets: A measurable decrease in support inquiries with the subject "Where is my order?" or "What is the status of X?".
-
Increased Engagement: Increase in average session duration on tracking pages, as users find the live data more engaging and trustworthy.
🪚 Existing Solutions
-
Current Legacy Platform: The only solution we provide. It relies on clients (web/mobile) repeatedly polling REST APIs at a set interval (e.g., every 60 seconds). Backend updates are often handled by scheduled jobs and our message queues are actually database tables. This is inherently slow and inefficient.
-
User Workarounds: Customers repeatedly manually refresh the page or call staff (i.e. drivers) for a "real" update, indicating a clear gap between their needs and our system's capability.
-
Competitors: Many modern logistics and tracking platforms already provide a live, "map-like" experience where updates are pushed to the user in real-time. We are currently at a competitive disadvantage.
🤔 Proposed Solution
We will transition from a request-response architecture to a modern, event-driven architecture. This represents a foundational platform shift.
-
Event Ingestion: Implement a high-throughput event ingestion service (e.g., an API gateway feeding into a message queue) to receive data like GPS updates and status changes from devices and other systems in real-time.
-
Event Bus: Utilize a central event streaming platform (like Apache Kafka, AWS Kinesis, or Google Pub/Sub) as the system's "nervous system." All incoming events are published to topics on this bus.
-
Real-time Push to Clients:
-
Create a notification or "push" service that subscribes to relevant topics on the event bus.
-
Integrate WebSockets into our web UI and mobile applications, allowing for a persistent, two-way communication channel with the server.
-
When the push service receives a relevant event (e.g.,
OrderStatusUpdated), it immediately pushes the new data through the active WebSocket connection directly to the client.
-
-
UI/App Update: The client-side applications will be refactored to listen for these pushed messages and dynamically update the UI (e.g., move a pin on a map, change a status badge) without requiring a full page refresh.
This creates a "push" model where the system tells the user about updates the moment they happen, solving the core problem of information lag and manual effort.