Тёмный
Vinayak Sangar
Vinayak Sangar
Vinayak Sangar
Подписаться
Комментарии
@ishallwin24
@ishallwin24 День назад
Won't we need ACID properties for order request table? Given it would be used for order cancelling, money blocking and money refunding.
@perfectalgos9641
@perfectalgos9641 5 дней назад
Great work. It would be great if you could paste the link of excalidraw .
@amreshgiri
@amreshgiri 6 дней назад
🎯 Key points for quick navigation: 00:02 *📈 Overview of Stock Exchange Systems* - Overview of major stock exchanges (NSC, BSC, NASDAQ, NYSE, etc.). - Challenges in designing a stock exchange system. - Key aspects: scalability, fairness, limit orders, and matching engine. 04:09 *📋 Functional Requirements of Stock Exchange Systems* - Core functionality: buying and selling stocks. - Support for limit orders. - Orders valid for the duration of market hours. - Payment integration via third-party providers. - Partial matching of orders. 08:07 *🌐 Non-Functional Requirements and Scale* - High availability and consistency requirements. - Ensuring trade fairness for all participants. - Handling a peak load of 60,000 transactions per second (TPS). 26:00 *📊 Introduction to Queues in Stock Exchange Systems* - Introduction to the necessity of introducing queues in the system, - Reasons for using separate queues for buy and sell orders, - Importance of segregating queues for different stocks. 29:15 *⏰ Workflow of Order Validation and Storage* - Workflow from client request to order validation and storage, - Notification process to clients with order IDs, - Initial handling of buy and sell requests into respective queues. 30:10 *🔄 Scaling and Operation of Matcher Service* - Scaling considerations for matcher nodes pulling from queues, - Implementation of Amazon SQS-like visibility timeout for message consumption, - Frequency and handling of matcher nodes pulling from buy and sell queues. 33:06 *💱 Matching Logic and Handling Partial Orders* - Logic for matching orders based on best available prices, - Handling partial orders and requeuing unmatched portions, - Ensuring orders are fulfilled or updated in the order status database. 38:31 *📜 Execution of Matched Orders and Notification* - Separation of match creation and execution using a queue system, - Tasks performed by the executor service post-match, - Importance of publishing match execution notifications to scalable services like Kafka or SNS. Made with HARPA AI
@ashishk8490
@ashishk8490 8 дней назад
can you please elaborate a bit on POP servers?
@darkstudio3170
@darkstudio3170 21 день назад
you are best , thank you
@user-vq7cu7cs3w
@user-vq7cu7cs3w 27 дней назад
Only one word orz GOD
@ishankrajpal8231
@ishankrajpal8231 29 дней назад
Genuinly Appreciate ur efforts here
@rabindrapatra7151
@rabindrapatra7151 29 дней назад
Seat we dont pass during booking of a flight. Seat details come in picture on web checkin only
@aravindhvasu195
@aravindhvasu195 Месяц назад
One of the very few videos that seamlessly tailored together all the essential components without assuming anything. Thanks a lot!
@manishasingh-de8hi
@manishasingh-de8hi Месяц назад
Why you stopped putting videos, These are really good and gem, especially all the system design videos.
@DipanshaChhabra
@DipanshaChhabra Месяц назад
truely awesome
@auroshisray9140
@auroshisray9140 Месяц назад
top quality ! thanks bro!!'
@neetadhavade
@neetadhavade Месяц назад
really underrated video. Deserves more likes
@user-te8mg8rs8c
@user-te8mg8rs8c Месяц назад
This sharing was so good, thanks! One thing I want to point out that the real fact is that the number infinitely approximates 1 because "retry" is always set to 3 :)
@42Siren
@42Siren Месяц назад
Great video. Thanks
@360Anurag
@360Anurag Месяц назад
How are the media files cached in real time? Considering they are significantly larger than manifest file. Do the clients directly pull it from cdn servers or does it route through the backend then cdn. I have observed the clients directly pull the media from cdn.
@360Anurag
@360Anurag Месяц назад
Well explained. Could have touched on HLS as well as its popular.
@amazingmanish
@amazingmanish Месяц назад
40:15, You may not need to rollback after payment booking. What you can do is have a SQS queue in place and a scheduler will update the Booking Info let's say after 10 mins.
@superrin
@superrin Месяц назад
the story telling is great. Easy to understand. Thanks a lot!
@marcioduarte2906
@marcioduarte2906 2 месяца назад
How do you manage consistency between when you get a message from the queue (SQS), have a positive match, send it to the Executor service and then delete the message from SQS? Do you have an intermediate step in the Matcher service in which you synchronously check and update the state of those orders (maybe in the db) before deleting the message from SQS? My concern is: If you have orders Buy A with Sell B matching, you process them, send another message to the queue for the Executor Service and right after you fail to delete those messages from SQS (in the Matcher service) Then retry happens and you get more messages from both Buy and Sell queue. A and B but now also Sell C, this time the algorithm matches A and C, sends it to the Executor service successfully and deletes A and C from SQS successfully. We are not in an inconsistent state, The executor service cannot de-dup on Buy A and we've effectively lost a Sell C order. Thanks
@perfectalgos9641
@perfectalgos9641 22 дня назад
Great questions. I think we should use a persistent storage with 2PC capability. When we successfully notified the Queue then the storage will be settled and fire the event.
@JAIGANESH-gd3qj
@JAIGANESH-gd3qj 2 месяца назад
Nice explanation 🎊🎉
@RishinderRana
@RishinderRana 2 месяца назад
Learnt a lot from this video. Well diagrammed and explained. Great job! Quick question though. Here you're storing the live stream to s3 and intend to serve it from there. So new streaming content will be written to the disk every second. Can the client read from the new files on the fly while the file has jsut been written without any latency? or do we need to stream the data directly to some broker that delivers the content as a data stream instead.
@merutiwari-admiralyt8539
@merutiwari-admiralyt8539 2 месяца назад
How can i implement this
@sristijaiswal1013
@sristijaiswal1013 2 месяца назад
Very detailed video. Thanks a lot.
@perpendicular355
@perpendicular355 2 месяца назад
You should work on fixing your mic
@szyulian
@szyulian 3 месяца назад
Watched. --
@nchomey
@nchomey 3 месяца назад
Thanks for these videos! One quibble - it's server-sent events. Also, there's no upgrade for SSE - it's just a normal http request with specific headers to tell the server to keep the connection alive. It might also be worth explaining why you might just do SSE if you don't need the bidirectional communication of ws - simpler, more compatible with networks and load balancers, etc..
@AmitAgrawal-xu8uk
@AmitAgrawal-xu8uk 3 месяца назад
Very Nicely explained !!! Best video for this topic ..thanks for sharing
@sunilsurana4767
@sunilsurana4767 4 месяца назад
How short are individual chunks during streaming? Given its a live stream i guess they should be 1 or 2 seconds? Does that mean manifest file gets updated every second and the client has to pull manifest file every second?
@ravipradeep007
@ravipradeep007 4 месяца назад
Nice video , just one comment @37.58 when you are discussing about limit orders , imagine there are 1 million limit orders for a stock which is going through a nose dive the matcher system might get overwhelmed , second i am assuming queue is not ordered and say a stocks price is 100 and somebody has placed a limit buy order at 105 at 11.00 am and someone else at 102 11.02 am , but since the matcher is taking them out sequentially it might end up matching 11.00 order since it would be fetched first , to a sell order , if the matcher has not pulled the whole queue , This can be a big bottleneck or more so incorrect behaviour
@SunnyKumar-ud9gp
@SunnyKumar-ud9gp 4 месяца назад
Loved the content
@santoshbhatnagar2155
@santoshbhatnagar2155 4 месяца назад
how does the movie booking companies handle the locking part, does this decision depends on the criticality of the usecase, for example we are okay with the user to retry here, we can take an optimistic locking and in other ways we choose pessimistic locking.
@santoshbhatnagar2155
@santoshbhatnagar2155 4 месяца назад
Really nice and in-depth video.
@SunnyKumar-ud9gp
@SunnyKumar-ud9gp 4 месяца назад
The content is amazing
@nammi895
@nammi895 4 месяца назад
Bhai gazab video, aag laga di bhai
@shubh191
@shubh191 4 месяца назад
Thank you very much sir for informative video. This is really very helpful. It would be great if you could create video for coding for this airline system
@gsenthilkumar8139
@gsenthilkumar8139 4 месяца назад
00:07 Airline reservation system requires handling limited resources, parallel requests, flight search capabilities, and failure handling. 02:51 The main point is to understand the high-level diagram of an Airline reservation system and the functional requirements. 07:42 Certain parts of the airline reservation system prioritize availability, while others prioritize consistency. 09:58 Capacity estimation for Airline Reservation System 14:49 Designing a read-heavy system for airline reservation 17:16 Applying filters on a booking reservation system 21:31 The airline reservation system includes three tables: flight API, booking information, and payment details. 23:48 The storage requirement for flight information is very minimal. 28:05 The need for distributed systems arises when storing petabytes of data that cannot fit into one machine. 30:03 Clients can scale independently without being a point of failure for each other. 34:31 Building an interface for notification and analytics services 36:44 Booking service has multiple steps: checking availability, completing payment, updating booking information. 41:00 Implementing distributed transactions with the two-phase commit approach 42:58 Handling concurrency in parallel requests 47:20 Serialization using pessimistic locking 49:26 Implementing TTL on locks is necessary to prevent indefinite locking of resources. 53:43 Using pessimistic locking in airline reservation systems. 55:44 Handling payment failures and refund scenarios in the airline reservation system 59:58 Consistency and serialization are important in an airline reservation system Crafted by Merlin AI.
@VishalThakur-wo1vx
@VishalThakur-wo1vx 4 месяца назад
Great video. I have some feedbacks. 1. Talk about Orchaterator vs Choreographer pattern. Booking Service is acting as a Orchasterator . We can also use decentralized system like Kafka. 2. 2PC is generally not practical to achieve distributed transaction. A better approach would be SAGA pattern and having compensating events. 3. Also, talk about creating some derived data. For example, is a flight is booked completely . Keep this info in cache and keep cache in sync with DB so that cancellation would mark this booked flight to available.
@adilkevin6220
@adilkevin6220 4 месяца назад
Can you make similar video on google system design
@informatician
@informatician 5 месяцев назад
can u provide the excalidraw link
@somghos4363
@somghos4363 5 месяцев назад
Great insightful video!! one design considration. we can use one kafka cluster here . with different topic for each stock list. this kafka can also help in notification and analtyyics. purpose
@amriteshsingh2952
@amriteshsingh2952 5 месяцев назад
Thanks for the video, very insightful. I am just wondering about the matching service which takes the events from buy and sell queues and matches them. Since the queue maintains the messages in order, and a buy event can match with a sell order which is present in later part of the queue, how do we match the orders in that case here?
@timo9madrid7
@timo9madrid7 4 месяца назад
same question for me. did you figure it out?
@mohinicoder
@mohinicoder 5 месяцев назад
I am wondering why didn't you use CDN instead of cache, in between end user watching stream and facebook server?
@arupde6320
@arupde6320 5 месяцев назад
be regular
@AdityaGupta-fz8mr
@AdityaGupta-fz8mr 5 месяцев назад
Superb
@user-dn1wl3ej7z
@user-dn1wl3ej7z 5 месяцев назад
Great video !! Clearly explained everything in a simple manner. Thanks so much.
@koeber99
@koeber99 5 месяцев назад
Wouldn't it make sense to name the media files with descriptive names (Encoding type, Seconds, steamID,? That would allow POPs and client to predicted the next file without referencing to cache. Example? streamID: streamID12345, 1080 P, 50 Seconds. etc. So the cache can just hold the parent directory of files (s3). redis: streamID12345 -> s3: /youtube/India/Vinayak/. Example: s3: /youtube/India/Vinayak/streamID12345_1080P_01Seconds.MPEG s3: /youtube/India/Vinayak/streamID12345_480P_01Seconds.MPEG s3: /youtube/India/Vinayak/streamID12345_1080P_02Seconds.MPEG s3: /youtube/India/Vinayak/streamID12345_480P_02Seconds.MPEG ...... s3: /youtube/India/Vinayak/streamID12345_1080P_50Seconds.MPEG s3: /youtube/India/Vinayak/streamID12345_480P_50Seconds.MPEG every Second add a new file to S3. Now the client can predict and download the next "second file" as they come in.
@vinayakmajgaonkar6168
@vinayakmajgaonkar6168 5 месяцев назад
Run video on 1.5 speed thank me later ...🎉
@manueldiera6781
@manueldiera6781 5 месяцев назад
Such a great video, excellent content presented in a very well balanced way. Thanks!
@ishaancse1994
@ishaancse1994 6 месяцев назад
Really helpful