Microservices
Airline Booking System
An airline booking backend split into five small services, so a slow email server never slows down a booking.
By Krrish Kumar
Split an airline backend into services with clear ownership, authenticate at the edge, and keep booking fast even though every booking triggers email that depends on a slow, unreliable SMTP server.
Request path
- Clientx-access-token
- API Gatewayrate limit · JWT verified by Auth
- Bookingseats · Sequelize on MySQL
- RabbitMQpublish, respond immediately
- Reminderconsume · Nodemailer
Five services, each with its own Sequelize models and migrations. The only asynchronous edge is the one to email, which is exactly where the slow dependency lives.
Why it's built this way
Service boundaries follow ownership
Auth owns identity, Flights owns inventory, Booking owns reservations, Reminder owns delivery. Each keeps its own models and migrations, so no service reaches into another's tables.
Asynchronous where the slow dependency is
SMTP is slow and flaky. Putting RabbitMQ between Booking and Reminder means a mail outage delays an email instead of failing a booking; messages wait in the broker.
Authentication at the edge
The gateway rejects unauthenticated requests before they reach Booking, so downstream services never re-implement token checks.
When something fails
If the SMTP server is down, reminder messages wait in RabbitMQ and the booking still succeeds. Email is delayed, not lost.
Known limit
Calls between Booking and Flights are synchronous HTTP with no timeout budget or circuit breaker yet. That is the next failure mode to close.
Outcome
A five-service system with a single entry point, per-service data ownership, and booking latency decoupled from email delivery.
Full request path, step by step
- 01The client calls the gateway. express-rate-limit throttles each client, and morgan logs every request.
- 02For booking routes, the gateway asks Auth to verify the JWT before anything reaches a downstream service.
- 03Verified requests are proxied to Booking, which reads the flight and updates seat availability.
- 04Booking publishes a reminder message to RabbitMQ and responds without waiting for email.
- 05Reminder consumes the message, persists a notification ticket in MySQL, and sends it over SMTP with Nodemailer.