High-Performance API Gateway for Logistics: ASP.NET Core & YARP
Building a unified mobile and web API gateway for fleet telemetry, real-time driver dispatching, and rate-limiting using Microsoft YARP and ASP.NET Core.

Figure 1: High-level architectural overview and system topology.
The Engineering 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 & Core Components
Key Engineering Challenges & Solutions
Resilient Connection and Payload Size for Mobile Clients
Courier drivers on the road had unstable network connections and required lightweight data transfers to avoid synchronization failures.
Developed an API Gateway routing layer designed to transfer fast, light payloads, and optimized client synchronization calls.
Enabled efficient data transfer for drivers in areas with weak mobile network coverage.
Background Data Synchronization under Traffic Spikes
Processing thousands of tracking updates and package scan events simultaneously without causing primary database deadlocks.
Decoupled database writes from the web request pipeline by routing updates through background worker services in .NET.
Relieved direct database write pressure during peak delivery hours.
Architectural 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 & Security
- •Successfully handled heavy peak traffic spikes.
- •Maintained high availability and minimal routing downtime.
- •Rate limiting configured at the gateway level.
- •Secure token-based access control for courier clients.
Outcomes & Lessons Learned
The gateway successfully handled heavy peak traffic spikes with high availability and minimal routing downtime, enabling real-time tracking for logistics coordinators.
- 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.
Related Case Studies

About Rajdip Khavad
Rajdip Khavad is a Senior Full-Stack & Frontend Engineer specializing in Angular, ASP.NET Core, enterprise application architectures, scalable integrations, and high-performance web systems.