System Design of a Ticket Booking System: BookMyShow

  Рет қаралды 18,309

Gaurav Sen

Gaurav Sen

Күн бұрын

Пікірлер: 19
@zephyrakash2003
@zephyrakash2003 2 ай бұрын
I think the best approach was a 2 phase write on cache and on completion update DB. So 1st request comes -> update the cache of seat id's as "processing" so that the next request don't overlap. Then let's say you need to fire n number of events till your booking is done and the payment is complete. Or you need events when the payment fails. If payment fails the cache is written again and changed from processing state to open state. If payment succeeds update the key value to reserved and write changes to DB. For an overlapping request we need to verify central cache and if found processing / reserved send fail status. It's important to get that - if your booking request takes 200ms (to cover all events and get responses) To write a cache value across a seat at the start of processing 1 booking request takes 5ms and you don't wait other incoming request for 200ms ... let me know what you guys think.
@charan775
@charan775 3 ай бұрын
43:00 why is queue required here for concurrent bookings? can't this be implemented using optimistic locking? whichever intent comes first, we update their status = locked so other two booking intents are going to fail because they needed to update on open status row only cause if I open two tabs simulatenously and try to book overlapping seats then one of them fails
@swamysriman7147
@swamysriman7147 3 ай бұрын
I guess they were assuming lockless or local lock design there.
@charan775
@charan775 3 ай бұрын
@@swamysriman7147 wont lockess design have lesser throughput? because we are processing one request at a time for each section of the seats
@Golbyzshorts
@Golbyzshorts 3 ай бұрын
Hey gaurav, I have a query.i have a cron job in which I have a scenario of same row getting inserted by multiple thread through concurrency which I want to avoid.how can we achieve this? Technologies used: jpa springboot webflux
@AravinthRavichandran-n1k
@AravinthRavichandran-n1k 3 ай бұрын
hi rocker what is the primary identifier for the datal; try using unique constraint. if it is a update operation try using pessimestic locking if it is a fresh record find out why multiple threads are working and producing same data
@RohitKumar-ve3fi
@RohitKumar-ve3fi 4 ай бұрын
will the booking be synchronous? how long does the server keep the connection of the client? let's say user has to wait for 5 mins in the queue, will the user see a buffering in the device?
@dhruvgupta2634
@dhruvgupta2634 4 ай бұрын
Must needed video after Coldplay's concert tickets demand.... 💀 Bhaiya, aapko mili kya ticket? 🥲
@lakanavarapunagamanikantaa7299
@lakanavarapunagamanikantaa7299 4 ай бұрын
how we can scale the event queue service
@patelaryan0914
@patelaryan0914 4 ай бұрын
event queue is not a service we need to scale we just need to handle the single point of failure as multiple request comes it just goes into queue
@himanshubanerji8800
@himanshubanerji8800 2 ай бұрын
Can we have more of these please
@ayushgupta-je8kx
@ayushgupta-je8kx 4 ай бұрын
Cant we use versioning to prevent double booking?
@charan775
@charan775 3 ай бұрын
same doubt
@charan775
@charan775 3 ай бұрын
40:30 isn't this wrong? not updating status from locked to open even though technically its open.
@B-Billy
@B-Billy 3 ай бұрын
Yeah, it got missed... the bookingStatus will be 'Booked'.
@keeplearning8102
@keeplearning8102 4 ай бұрын
At the end you have make it like, i will provide you seat number, customer dont have that liberty, this is not going to wrk
@ankurbrdwj
@ankurbrdwj 4 ай бұрын
koi nahi bacha payga , sabka ticket katega 🎟😆
@shashibhushan3289
@shashibhushan3289 4 ай бұрын
sabka katega ticket ,sabko is duniya se jana hai
@paritosh944
@paritosh944 4 ай бұрын
💀💀
System Design Interview: TikTok architecture with @sudocode
45:35
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
Mom Hack for Cooking Solo with a Little One! 🍳👶
00:15
5-Minute Crafts HOUSE
Рет қаралды 23 МЛН
Google system design interview: Design Spotify (with ex-Google EM)
42:13
IGotAnOffer: Engineering
Рет қаралды 1,2 МЛН
Jeff Dean: AI will Reshape Chip Design - NeurIPS 2024
43:53
GradientSpills
Рет қаралды 6 М.
YouTube High Level System Design with @harkirat1 !!
35:02
Keerti Purswani
Рет қаралды 115 М.
Introduction to NoSQL databases
26:18
Gaurav Sen
Рет қаралды 796 М.
System Design: Concurrency Control in Distributed System | Optimistic & Pessimistic Concurrency Lock
1:04:45
How to Remember Everything You Read
26:12
Justin Sung
Рет қаралды 3,5 МЛН
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.