Your account
A real account. The password is hashed with BCrypt, and five wrong tries lock it for fifteen minutes.
Signed in as
Live demo · tatkal train booking
MiddleBerth is a backend built as five Spring Boot microservices around Kafka, PostgreSQL and Redis. Book a real berth below, pay with a Razorpay test card, and watch every call it makes.
A real account. The password is hashed with BCrypt, and five wrong tries lock it for fifteen minutes.
Signed in as
Tatkal opens one day ahead. These counts come from search-service, which reads Redis and never touches the booking database.
Choose a train and class above.
Each claim locks its row with FOR UPDATE SKIP LOCKED, so claims arriving together step over each other instead of taking the same berth. A repeated request is stopped by a unique constraint, never by checking first.
The request only joins a queue. Holding a thread and a database connection for everyone waiting would exhaust the pool in the first second of a rush, so the page asks for its answer, and the server says when to ask again.
One thread doing all the booking, a lock inside a Redis library, a session made on every request, nginx running out of ports, and a query reading 172,512 rows to claim one berth. Each one fixed and measured.