• Tatkal Ticketing Woes resolved! – Proposed Cloud Architecture for IRCTC

    by  • March 7, 2011 • Cloud Computing, Stories • 12 Comments

    IRCTCAnyone who has booked a Tatkal railway ticket on IRCTC Website knows that getting a ticket when the counters open is no mere feat. “Service Unavailable” and “Page not found” screens greet you and when you finally do get past them, the seat selection module or the payment module conks out on you. These are not one off instances. In Jan 2011 alone, there were more than 2.9 million failed transactions (of the 11.7 million total transactions) which is a whooping 25% fail rate. To add to the woes, failed login attempts and other request failures only goes to show  that something is really amiss here!

    Why is booking a train ticket on India’s largest (and one of the world’s top 5) e-commerce sites such a pain? Is it because, as people suspect, the “evil” travel agents lobby to shut it from individual customers or does the problem lie somewhere else?

    Before we get to that, here are some statistics (released by IRCTC in August 2010) to give us a sense of the complexities involved.

    - IRCTC has more than 16 million users who book about 9 million tickets every month online and about 40% of these are booked during the morning hours (8 AM IST to 10 AM IST approx).In other words, everyday during the morning hours (8 AM to 10 AM approx) more than 120,000 tickets get sold.

    - IRCTC web site and its API if open 23 hours every day (with a daily maintenance shut down from 23:30 to 0:30)

    IRCTC’s Existing Architecture

    From the information available in the public domain, we understand that the existing architecture of IRCTC’s e-ticketing infrastructure is a 3 tier architecture involving front-end web/app servers for the website and back-end database with integration to payment services, third party API’s such as clear trip and integration with printing services and so on. The application is developed on the Microsoft platform and uses Oracle as the database.

    Proposed Scalable Architecture

    DISCLAIMER: The architecture proposed is based on our understanding of  the IRCTC ticketing system and information available in the IRCTC website and the public domain. IRCTC or Indian railways are in no way connected to this project.

    The infrastructure needs to be designed to dynamically scale in order to handle variable demand during the day as well as peak demands during festive season and holidays. Having a static number of servers for such requirement will not be ideal as it would lead to either under-provisioning (poor performance issues) or over-provisioning (over-paying). This is where a cloud architecture really pays off. This architecture can be designed to bring in scalability, elasticity and loose coupling to provide optimal performance for all kinds of infrastructure demands. And IRCTC only has to pay for what they use, hence saving them a lot of capital expenditure on infrastructure.

    Here’s a small video clip of the proposed architecture

    Given below are the modules in the architecture

    Scalable Web/App and WebServices

    A major share of the customer requests are handled by the IRCTC website/App and its API modules (for third party integration with other travel sites). These modules would be separated out and setup in an AutoScaling mode, where there are always a certain minimum number of servers running which will automatically scale up and down according to the number of requests.

    Load Balancing

    A front end Load Balancer in the infrastructure effectively manages the automatically scaled servers by routing requests between the servers. Failover is built-in into the architecture. If one of the server becomes unavailable,  the Load Balancer automatically routes the requests to other servers. This also ensures High-availability of the website and the APIs since the degraded servers will be automatically replaced without any downtime.

    Database High Availability

    The Database layer would be setup with multiple Master/Slave configuration with data replication. Writes would  be handled by the Master server and reads would happen on the Slaves. In addition, the Slaves can be automatically promoted to Masters when needed thereby making the database layer highly available.  Other services such as reporting, printing can be handled by the Slaves directly which will take the load off the Masters.

    Content Distribution Network

    Moving the static content such as Images, Scripts, Style Sheets, HTML to a content distribution network serves the content to the end user faster through the nearest edge location resulting in reduced latency. As the content is served from a different infrastructure/network the load on the main web app server is reduced.

    Managed DNS Server

    Using a Managed DNS Server, in case of an outage at a primary data center, automatic transition from the primary data center to a redundant secondary setup (Hot Disaster Recovery setup) can be achieved. This results in no service down time even in extreme cases of a complete data center level failure.

    De-coupling the systems

    One of the best practices in designing a highly scalable and available architecture is to have a decoupled architecture. In IRCTC’s case, the web/app, APIs and the search engine are to be completely decoupled so that each can be scaled independently. For example, one of the main functions in the web site is train look-up where the trains, routes and seats are looked up by the users. This area can be separated out with a search engine and an effective caching layer thereby removing the load on other systems.

    We believe, by utilizing the cloud and making some minor modifications in the architecture, one of the widely used services in India can be made more robust and would considerably lessen the agony of the person booking a train ticket.

    About 8KMiles

    8KMiles is an internet company that is focused on building solutions around cloud computing. 8KMiles’ Cloud Solutions group offers cloud consulting, engineering and migration services to help companies leverage the power of cloud computing. 8KMiles is an Amazon Web Services Systems Integrator and a Microsoft SPLA partner.


    Sources:

    IRCTC Website

    http://www.slideshare.net/rsnarayanan/kevin-ms-web-platform

    About

    12 Responses to Tatkal Ticketing Woes resolved! – Proposed Cloud Architecture for IRCTC

    1. manu
      March 7, 2011 at 4:37 pm

      HI,

      if we move the current application to cloud based architecture, will the end product be the same/is there any advantage for the customers other than accessing the website? how can we ensure that the system will produce the apt result?

      • rahul
        March 16, 2011 at 9:45 am

        @manu The core principle behind cloud computing is to abstract the infrastructure and provide high availability and scalability. The customers wont experience anything different apart from it being always available. However, once the traffic load becomes manageable, IRCTC can focus their efforts on building customer’s convenience features.

    2. ®
      July 13, 2011 at 1:01 pm

      I think maybe this architecture will decrease the load. But giving fast service means depending on a good server specs. IRCTC uses a single robinround dns server structure to balance load on servers. But instead of this they should use servers for loadbalancing. THe front end is used by IRCTC server but the reservation on the back end is used on the railway servers. The load generates on the front end servers of the IRCTC which is handled in a very poor manner due to proccessing of the pages. But AFAIK the backend servers must also be of good configuration because the API used by other 3rd Party Websites also generates load on the BACK END railway database servers.

      So overall first IRCTC should look over their fromend servers as most of the people are facing issues while getting information thorough IRCTC and the failure rate is almost 50-60% at 08:00 AM from service unavailable.

    3. October 18, 2011 at 10:13 pm

      There is No ACID property in cloud computing…. how we can able to solve this issue…. because world most of the company and researcher till now working hard to solve this issue….
      with out ACID property there is no guarantee for ur Transaction….

      Thank u……..

    4. KPSK
      November 24, 2011 at 8:34 am

      Oracle has new age servers with a amazing blend of both h/w and software. I believe IRCTC should focus on getting the ‘EXA DATA’ server for handling the DB part, ‘EXA LOGIC’ for handling the application part and move all their analatical requirement to the ‘EXA ANALYTICS’ boexs then I am 200% sure that they can provide a much better user feel. The user expericenc in ensuring the required content is available to them in times of high need (from user perspective) like say a ‘tatkal’ booking can be very well handled by the Oracle ‘EXA …..’ serics of boxes. Imagin an entire China Rail n/w booking/management is handled by these boxes and that itself proves their capbilities. Autorities at IRCTC should realize this now. By the way the Elastic cloud is also supported. And the best part of these machines is their in memory data handling and manupulation capabilities, they communicate on infiniban n/w and is highly available with amazing fault talarent and recovery features. Even for an upgrade of your application you need not get it offline!

    5. Pradeep
      April 3, 2012 at 2:36 pm

      Akamai is the solution.

    6. Shweta Gulati
      April 14, 2012 at 2:54 pm

      Hi,

      I must say a great solution to the existing problem. But did u try getting in touch with IRCTC and proposing them the solution? It will be good if this could be implemented or any feasible solution which would make IRCTC faster and better.

      I am a computer engineer , so send me a mail if you are keen on working on this problem.

      Thanks
      Shweta

    7. April 19, 2012 at 9:45 am

      i agree with the big words and cloud can mae the thing better .let suppose if IRCTC buy your soloution and impliment and all good from application and datatbase site but what about the internet bandwdth in data center of IRCTC .in your proposal i dn’t see any solution of this bandwidth issue .

      i belive IRCTC is already using server load balancer .Also now a days if you see at 8 AM service is good after the new tatkal rule .

      Also i belive IRCTC would be trying best to make the service better but due to hell lot of user the are not able to get rid from the issue .Best idea for IRCTC to make a arrangemnet such that tatkal should open before 24 hours of departure of particular train so that conncurent connection will distribute over the time .All the user will not try to login @ 8 AM .

      i hope IRCTC can think of this …

    8. April 26, 2012 at 1:57 am

      Cloud computing is nothing to do with in this Situation, They Needs to correct there:
      1. Architecture,
      2. Dividing the Load between Servers According to Zones from where the Request are coming, or fixing the Number of Request at a particular Server (After finding out how many concurrent Request can be Easily handled).
      3. They need some Messaging Architecture so that When people made some decisions on booking, and they have filled there all the Details so that Information Can be kept in Packets, or in Objects and Transfer that Info to the Back-end to process that Ticket booking, so Atleast who had made till that Information filling, can be the beatifically.

      And many more Improvements Can be done there, But I am sure cloud computing is not the Solution for that Problem :)

    9. Karthik
      April 30, 2012 at 1:41 pm

      Noting is going to change…. IRCTC sucks..

    10. April 30, 2012 at 4:02 pm

      Primary need is to make sure IRCTC and technology vendor feel the need to fix this.. We have seen most of the organizations write a shabby code which would consume triple the number of servers.. I am sure IRCTC code is no exception to this..Our experience says that, even with re-engineering, they can server double the requests with no hardware or architectural changes.
      Yes, they need to have cloud kind of hardware scalability (i.e private cloud) to be cutting edge and allow horizontally performance benefits .
      It is also a myth floating around that ACID is not possible in cloud.. that is not true .. Normal DB’s can be used with ACID.. however kind of performance which you get with CAP model can’t be achieved.. What ever is the scalability of Clould DB’s can be achieved in RDBMS.. wait and watch.. To me I see RDMS has a different structure of storage and current cloud db’s have a different structures not thing more..
      In cloud Scaling (data size) is one thing and with scale performance scaling is other thing. Scaling of data sizes can be very well achieved everywhere once HDFS kind of file system is adopted.
      Also, no one can stop any to use RDBMS in cloud .. provided one uses IaaS options from could vendors. I am sure Indian IT servers, for the current myths to die it would take another decade
      In the Worst case, IRCTC can have Dynamic Cluster depending on the load with their own server cluster.. Else, they can introduce the concept Priority Que..if not FIFO at least Fair FIFO model.
      Trust me the issue may be about what the current contract exists between IRCTC and Technology provider.
      If the technology providers are given revenue share based on each ticket selling, this would have been solved long back.. to me it looks like, provider gets revenues based on hardware/CPU basis.. so vendor is pushing for more hardware through more failures and giving unfair experience to end users..

      Trust me if you look at 75% success transactions.. I am sure many would have been crying for the experience they had even in success..

      Let IRCTC feel the need for Code Engineering, Re-Architecture then I am sure everything would fall in place… It is the way $ flow decide everything.. IT stupidity is bodies and hours sell more than less of them which can be achieved through brains and excellence..

    11. MM
      June 27, 2012 at 12:00 pm

      Using IMDB (In-Memory DataBase) can handle this problem smartly, IMDB is 10 times faster than traditional database systems and it can boost the performance of IRCTC in peak booking times.