IRCTC.CO.IN is Indian Railway’s ticket booking website and is demonstrative of what is wrong with our country. Our docile nature to accept solutions of inferior quality and live with it. Those who have used irctc need not be told what is wrong with it. The railway officials blame it on the “load” without realizing Google, Visa, Master card etc. handle billions of transactions a day. And even if IR is facing problems which are very unique there is not reason why they should not invest money in solving those.
Like Batman says “when you are in a room full of all super villains take on the strongest villain first”, I would say always solve first the problem which are easy to solve and for which well known and tested solutions exist. So I have such very basic suggestions to IRCTC.
1. Use CDN please.
2. Clear partitioning between the static and dynamic content
I can understand if it is a computationally expensive operation to query the seat availability but there is absolutely no excuse for why the About Us page can not load even during the peak time. This kind of static content be replicated across various servers based on the need.
3. Provide a wallet feature
Payment gateway is another bottleneck. Many times IRCTC fails to respond even after successful payment and the money gets into limbo. It gets returned after few weeks. Solution to that problem is let the users load a fixed amount initially in their account and when they book the ticket the transaction need not go to a payment gateway.
4. Partition the transactions.
In any system the bottlenecks are the places where many try to access a resource which is physically limited/cant be replicated. In case of bank transactions it is money. Since you can replicate money you have to ensure that only one transaction happens at a time. Why are banks transactions so fast but train booking so slow? That is because even though the banks handle magnitude more transactions than railways, the key difference is that the bank accounts are logically separated from each other and transactions per account are very low. For example when you pay money at a mall, only two accounts are involved. Your account from which money is deducted and merchant account to which money is added. If you notice the payees account is immediately deducted but the merchant’s account is not credited immediately. That operation generally happens later as a batch operation.
For obvious reasons deduction needs to happen immediately because there is a lower limit to how much you can deduct where as addition can be delayed as there is not upper limit to how much can be added.
For railways the problem is opposite. Each train is like a bank account and thousands are trying to deduct money from it. Hence the ticked booking operation can not be delayed. It needs to happen immediately.
The good news however is that we can always partition the problem. To use the bank analogy. Each Train class is like a bank account. We can assume on an average it may have 300 seats. Each train is logically separate from each other. Which means people trying to book Rajdhani tickets should not affect people booking Shatabdi tickets. You keep all the data of different trains on different servers and sync them periodically with a central server.
Thus people who are attempting to book One train will never affect other train aspirants. Yeah, of course even that does not solve the problem completely because handling 30000 users desperate to get just 300 seats is even a problem but it is likely to occur for only few trains and not all.
But then why irctc has not done it yet ?
I think the reason is the on the counter system. Railways ticket booking is not an internet only feature. You can always book them over the counter and there is it always very fast. I am told that there are 9 HP mainframes that power that system and the web interface is a second class citizen who is exposed to the mainframes through some complicated tunnel.
Hence the transactions are highly centralized. There are 4 zones each having a pair of servers. All transactions are processes centrally there. If we want to improve the performance of the website this central processing needs to become more distributed which means even the railway counter machines needs to have a software upgrade. All this is a measure change and if it goes wrong it can cause riots on stations. Hence no one is willing to take the risk.
Note: All this is based on no evidence at all. So dont take it seriously.