Designing and building a high-throughput API gateway to connect mobile courier applications with enterprise backoffice tracking systems, handling real-time updates and offline synchronization.
Project Context
- Business Domain: Logistics & Supply Chain
- Project Context: Building an API Gateway to connect mobile courier applications with enterprise backoffice tracking systems.
My Role
My role was as a Senior Backend Developer. I contributed to designing the API Gateway routing, implementing rate limiting and caching strategies, integrating real-time notifications, and developing database synchronization background services.
The Challenge
The mobile courier applications required fast, light payloads, offline synchronization, and resilient connection handling while processing thousands of updates from drivers on the road. The system needed to handle peak traffic spikes without database overload.
Architecture
- API Gateway: API Gateway incorporating caching and rate limiting. YARP / ASP.NET Web API.
- Backend APIs: ASP.NET Core / .NET Web API.
- Messaging & Queueing: Background worker services were used to decouple asynchronous processing from the web request pipeline.
- Real-time Alerts: Firebase Cloud Messaging (FCM) for real-time delivery notifications.
- Database & Sync: Relational database with synchronization handled by .NET background worker services.
- Caching: Redis caching.
Technology Stack
Frontend
- Mobile Application (Ionic/Angular)
Backend
- ASP.NET Web API
- .NET Background Worker Services
- YARP
- Redis (Caching)
Data
- SQL Server
Infrastructure
- Docker
- Azure
- Firebase Cloud Messaging (FCM)
Key Engineering Challenges
Challenge 1: Resilient Connection and Payload Size for Mobile Clients
- Challenge: Courier drivers on the road had unstable network connections and required lightweight data transfers to avoid synchronization failures.
- Solution: Developed an API Gateway routing layer designed to transfer fast, light payloads, and optimized client synchronization calls.
- Engineering Impact: Enabled efficient data transfer for drivers in areas with weak mobile network coverage.
Challenge 2: Background Data Synchronization under Traffic Spikes
- Challenge: Processing thousands of tracking updates and package scan events simultaneously without causing primary database deadlocks.
- Solution: Decoupled database writes from the web request pipeline by routing updates through background worker services in .NET.
- Engineering Impact: Relieved direct database write pressure during peak delivery hours.
Technical Decisions & Trade-offs
- Caching and Rate Limiting at the Gateway: Implemented Redis caching and rate limiting directly at the gateway layer. This protected downstream services from traffic surges, though it added middleware configuration complexity.
- Asynchronous Processing Strategy: Decoupled backend processing using asynchronous background worker services to isolate primary transactional databases from direct write spikes.
Performance & Scalability
- Successfully handled heavy peak traffic spikes.
- Maintained high availability and minimal routing downtime.
Security
- Rate limiting configured at the gateway level.
- Secure token-based access control for courier clients.
Outcome
The gateway successfully handled heavy peak traffic spikes with high availability and minimal routing downtime, enabling real-time tracking for logistics coordinators.
Lessons Learned
- Gateway caching (via Redis) is essential to absorb high-frequency read requests from mobile tracking clients.
- Utilizing asynchronous background worker services in .NET isolates primary transactional databases from write spikes.
Similar case studies
Legacy ASP.NET Monolith Modernization with YARP & .NET 8
Learn how an enterprise legacy ASP.NET MVC application was modernized incrementally to .NET 8 and Angular using the Strangler Fig pattern and YARP.
Secure Patient Portal & Telemedicine System | ASP.NET Core & Angular
Case study on designing a secure patient portal and telemedicine system with Angular, ASP.NET Core REST APIs, JWT authentication, and WebRTC.
About Rajdip Khavad
Rajdip Khavad is an Angular and ASP.NET Core/.NET developer specializing in enterprise applications, APIs, application modernization and performance-focused engineering. On this project, his focus was API architecture, traffic management and distributed backend services.
