Тёмный

IRCTC System Design | Railways Ticket Booking Service | System Design Interview Question 

The Tech Granth
Подписаться 20 тыс.
Просмотров 15 тыс.
50% 1

Railway train or in general ticket booking is a common thing in today's world.
Today we will learn to design system to meet the requirement of ticket booking system like IRCTC.
In this video I have covered the System Design for IRCTC. Content deals mainly around the database table structure and the best way a query can be performed. Relevant APIs and a High level design of the software is also added in the video.
Here software lifecycle of Search train, book train, cancel train and notification has been explained in details.
Also touched on the topic of how to choose column to create index and further partition your table to improve performance of the Railways booking system, so that your design is scalable and queries are optimized.
0:00 Introduction
0:10 Requirements
3:48 Major Life Cycles of components involved
5:28 Search Trains
15:37 Book train Ticket
19:33 Payments to be made
21:09 Capacity Estimation
22:02 Relevant APIs
27:42 High Level Design of IRCTC
Payment Gateway : • Payment Gateway System...
URL Shortener : • Video
Distributed Cache : • System Design | Distri...
You can buy us a coffee at : www.buymeacoffee.com/thetechg...
system design: • System Design | Distri...
DS for beginners: • Arrays Data Structures...
leetcode solutions: • Leetcode 84 | Largest ...
github: github.com/TheTechGranth/theg...
facebook group : / 741317603336313
twitter: / granthtech

Наука

Опубликовано:

 

31 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 38   
@TheTechGranth
@TheTechGranth 2 года назад
Do watch the video in Full, set the Play speed to 1.25X or 1.5X as per your convenience, do not depend on the PPT :)
@abhinabachakraborty5379
@abhinabachakraborty5379 2 года назад
I think, you have under-estimated the total size of the table for a month. Why? Because I feel, you have taken the avg stopping station per day per train is 80. This will work only if you book ticket from the source station to the destination station of the train. Where as in reality, ppl hardly do that. So you need to have all possible station combinations. i.e if a train has n stops, there will be n*(n-1)/2 such combinations i.e instead of 80, that number will be 3160, which shoots up the total table size for a month to ~245GB with rest your estimations. I personally feel a Graph Database will be a better choice for this kinda problem.
@atanusikder4217
@atanusikder4217 2 года назад
For n*(n-1)/2 combinations Storage required -> (20000*140*40*79 )/8 = 1.1 GB per day around 30 GB per month
@lytung1532
@lytung1532 Год назад
Thanks for the useful tutorial. The another improvement is that we can truncate historical data of train details into separate table/database so that we can move them to other kinds of drive or compress them to save costs. The reason for this idea is the fact customers unlikely query for the historical train details. What do you think?
@soumavanag5025
@soumavanag5025 2 года назад
Good explanantion, thank you :)
@TheTechGranth
@TheTechGranth 2 года назад
Hope it was helpful. Do like and subscribe and share with others 🙂
@uditagrawal6603
@uditagrawal6603 2 года назад
Queries: 1. It is assumed that there are 80 stations per train but when we store in the train search then shouldn't we be storing n2 entries for each train where n=80 so the estimation needs to be corrected. 2.We are sharding train_details_info table based on date but if user wants to cancel ticket/get_booking_details based on PNR then how will info be available will we be searhcing on each shard based on PNR? 3. Shouldnt the payment and booking db be same as we will not get the transaction functionality across multiple DBs. Could you please help with these queries. Thanks!!!
@suchismitagoswami5609
@suchismitagoswami5609 Год назад
Great Content! I think we should introduce API gateway in place of load balancer and the API gateway will point to different load balancers for respective services (Booking Ticket Service, User Profile Service etc.)
@TheTechGranth
@TheTechGranth Год назад
Glad it was helpful. Do like and subscribe and share with others 🙂
@ChandraShekhar-by3cd
@ChandraShekhar-by3cd 2 года назад
Thanks a lot for such a great video! Could you pls suggest some resources for LLD and system design. Thanks
@TheTechGranth
@TheTechGranth 2 года назад
There is no one source from where you can learn everything that is the gap I am trying to fill with the help of this channel. I will suggest you to read engineering blogs of tech companies like uber
@3dlove100
@3dlove100 2 года назад
Nice One :)
@TheTechGranth
@TheTechGranth 2 года назад
Thanks 🙂
@ChandraShekhar-by3cd
@ChandraShekhar-by3cd 2 года назад
Could you please make a video on detail regarding how to design api in details and also in coding as well?? So that we can have a great idea about building the api. Thanks for you hard work and constant effort to make a positive contribution in the community.
@TheTechGranth
@TheTechGranth 2 года назад
Hmm good point, will add this but it may take a while as have some other stuffs on priority list. Next week will be Tik Tok or Bloom filter 😉
@ChandraShekhar-by3cd
@ChandraShekhar-by3cd 2 года назад
@@TheTechGranth Thanks sir.
@ganant23
@ganant23 Год назад
i came here to check how was the case being handled where we wanted to book from B->D if train route is from A->B->C->D . felt my time was wasted here.sigh!
@bajaj-gaurav
@bajaj-gaurav Год назад
Hello Anant, Did you find the answer? I am looking for the similiar answers! Can you please provide ref!
@uditagrawal6603
@uditagrawal6603 2 года назад
Nice video 👏 Could you please help in understanding of concepts mentioned such as orchestration or choreography?
@TheTechGranth
@TheTechGranth 2 года назад
Glad it was helpful. Do like and subscribe and share with others. For these core concepts, check outy video of microservices design patterns, here I have explained both of these as part of SAGA pattern ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-Bt7aC-7mEw0.html Hope you will find it helpful 🙂
@srndrpec
@srndrpec 2 года назад
Train details table at any time will have 3 months data info which gets added every day. However it can archive old data. You mention about partitioning is it table partitioning?
@TheTechGranth
@TheTechGranth 2 года назад
Yes, it is table partition
@kalyanisatya4027
@kalyanisatya4027 2 года назад
Please do videos on google translator, google news system design
@sivaram1804
@sivaram1804 2 года назад
How to get the irctc apis how to buy and where can I go?
@RanjanKumar-ie1sd
@RanjanKumar-ie1sd Год назад
Can you tech me a coding to make a tatkal software
@user-hx7zt6gk6v
@user-hx7zt6gk6v 6 месяцев назад
Seat allotment logic would be ?
@shubhamsaxena5114
@shubhamsaxena5114 4 месяца назад
important part is simply skipped
@learnersparadise7492
@learnersparadise7492 2 года назад
go into depth, transaction, locks, scalability etc, this was just scratching surface
@TheTechGranth
@TheTechGranth 2 года назад
Kindly check out the complete playlist for system design. It is really tough to cover everything in one video, cause long monotonous video. Transactions are covered in payment gateway, locks in bookmyshow. Please let me know if further details are required will have a look and come up with some example
@koteshwarraomaripudi1080
@koteshwarraomaripudi1080 2 года назад
Lot of things are not clear (at least for me). Ex: If a train goes from A->B->C->D->E. How are you storing the data in DB because i may want to search from B->D then we neeed to see this train part of the search result you never spoke about how we are going to handle concurrency which is very imp for train ticket booking this is a high high level design. Need to incorporate lot more details.
@TheTechGranth
@TheTechGranth 2 года назад
In train details we are storing the starting point and end point for a train. If train stops at A B C D E, then in train details you will have entry for A->B B->C and so on. So your problem is solved 🙂
@koteshwarraomaripudi1080
@koteshwarraomaripudi1080 2 года назад
@@TheTechGranth now searching becomes too complex. Let's say train has 26 stops by alphabet names in order. Now let's i wannna go from c to o, then we have to find trains that has c to d, d to e, e to f,....., N to o.
@TheTechGranth
@TheTechGranth 2 года назад
@@koteshwarraomaripudi1080 you have to pass on the from_station as C and to_station as O for that day. Anyway we have partitioned the table on day basis
@kvv6452
@kvv6452 2 года назад
@@TheTechGranth Wouldn’t this logic be too complex. For eg: if the train route is a, b, c, d, e, f, g, h (8 stations). As mentioned there will be 8 entries in train info details. Who will be loading these entries per date for each of the train. Will there be a separate service or would it be some job ? If user wants to travel from b to g and books ticket, the seat counts/capacities should be deducted in 6 tables for that journey. Is there a chance of optimization ? Also, in api design of booking, why generate pnr is api. It is important but an intrinsic api. Why does fetching a train route need a date as input ?
@TheTechGranth
@TheTechGranth 2 года назад
@@kvv6452 1) it will be a service, we can maintain train route in some static table, train_details will be populated each day. Because for any particular day, we can only book ticket in like 3-4months in advance. 2) it should not be worst case you can think of it as graph with order it topologically 3) we need api for pnr generation because each day the number of pnr generated will be high, so will be faster if we just pick some pregenerated value
@rabindrakumar949
@rabindrakumar949 2 года назад
Let say train is travelling between x to z through y. How you will handle booking like x to y and y to z for different classes on any date. How you will store the data.
@TheTechGranth
@TheTechGranth 2 года назад
To keep it simple, it should be 2 booking
Далее
Штаны легионера
00:44
Просмотров 324 тыс.
Top 7 Ways to 10x Your API Performance
6:05
Просмотров 319 тыс.