Rajdip Khavad Logo
Rajdip Khavad
Back to all case studies
.NET & Distributed SystemsProduction Case Study

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.

DomainNational Freight Logistics
Engineering RolePrincipal Systems Architect
Completed2026-05-12
Core StackASP.NET Web API, YARP Gateway, Redis, Worker Services
18M+Daily Processed Requests
< 4msP99 Latency Overhead
0.001%Failed Request Rate
High-Performance API Gateway for Logistics: ASP.NET Core & YARP

Figure 1: High-level architectural overview and system topology.

Project Context & Challenge

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.

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.
System Design & Architecture

Architecture & Core Components

•**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.
Deep-Dive Engineering

Key Engineering Challenges & Solutions

Challenge 01

Resilient Connection and Payload Size for Mobile Clients

Problem & Constraints:

Courier drivers on the road had unstable network connections and required lightweight data transfers to avoid synchronization failures.

Engineered Solution:

Developed an API Gateway routing layer designed to transfer fast, light payloads, and optimized client synchronization calls.

Production Impact:

Enabled efficient data transfer for drivers in areas with weak mobile network coverage.

Challenge 02

Background Data Synchronization under Traffic Spikes

Problem & Constraints:

Processing thousands of tracking updates and package scan events simultaneously without causing primary database deadlocks.

Engineered Solution:

Decoupled database writes from the web request pipeline by routing updates through background worker services in .NET.

Production Impact:

Relieved direct database write pressure during peak delivery hours.

Technical Trade-offs

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

Performance & Scale
  • •Successfully handled heavy peak traffic spikes.
  • •Maintained high availability and minimal routing downtime.
Security Governance
  • •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

Rajdip Khavad

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.