Тёмный

What is the Publisher Subscriber Model? 

Gaurav Sen
Подписаться 590 тыс.
Просмотров 279 тыс.
50% 1

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

 

7 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 181   
@gkcs
@gkcs 3 года назад
If you are preparing for a system design interview, try get.interviewready.io. All the best 😁
@spicytuna08
@spicytuna08 6 лет назад
In your example at 9:00, the business logic of transfer and transfer fee is tied down to each other. so this biz logic cannot be broken down to 2 microservices in first place regardless of event driven service or pub/sub service is used.
@sdfg204
@sdfg204 5 лет назад
Nice and complete explanation, some examples where they are used: 1) all notifications work this way. 2)Event driven systems are particularly lightweight, so they are extensively used for Notifier hardware(sensors) with minimal processing power/ power consumption , to broadcast events whenever their is a malfunction/low battery. 3) they are mainly used for systems which are not inherently in requirement of security, though some kind of crypt might get used to ensure the source of msg to be valid. 4) not particularly a point but, should have mentioned youtube's own publisher-subcriber system while putting a video on youtube ;-)
@gkcs
@gkcs 5 лет назад
Great points Aneesh, especially the last one 😉
@sdfg204
@sdfg204 5 лет назад
@@gkcs thanks, always learning with you
@ayasswain
@ayasswain 4 года назад
Very nicely explained. Publish subscribe model is also used for order fulfillment by many companies when users place orders online to buy their products.
@spicytuna08
@spicytuna08 6 лет назад
thank you for enlightening me about this system design. i have a comment on the arrows. those arrows supposed to be bi-directional since requests go into one direction and responses go to another direction. looking forward to your videos. thanks again.
@the-iter8
@the-iter8 2 года назад
I'm a second-year student pursuing btech in case, I started watching this video for a gcloud quest topic coverage. I literally have no clue what you're talking about in this video, but it was explained thoroughly so I guess it was cool. Thumbs up.
@sankalparora9374
@sankalparora9374 Год назад
Very clean and very precise - knew about it but the video made it clearer. Thanks. Great work sir!
@gkcs
@gkcs Год назад
Thank you Sankalp!
@shubhamchaudhary5358
@shubhamchaudhary5358 3 года назад
Conclusion: S0 is very clever for its commission 😂
@josephloso6914
@josephloso6914 6 лет назад
you are among the best youtube teachers I have encountered simple and very easy to understand
@Kiran-zy2dl
@Kiran-zy2dl 5 лет назад
You sir, have a clear approach.
@user-oy4kf5wr8l
@user-oy4kf5wr8l 4 года назад
Thank you, hope i can finish watching ur videos soon .....lol..... so much good quality videos !!!!!!!!!!!!!we love u !!!!!!!!!!!!!!!!!!!!!!!!!
@chithraprakash2271
@chithraprakash2271 2 года назад
Great explanation. Very useful video. Thanks for sharing
@rajumondal4283
@rajumondal4283 6 лет назад
almost everytime u give a hint of the next lecture its great
@gkcs
@gkcs 6 лет назад
Thanks 🙂
@smithmarta
@smithmarta 2 года назад
Idempotent means that the state of the server will be changed AT MOST ONCE by a series of invocations. Thus, the publisher-subscriber architecture isn't idempotent, as demonstrated in this awesome tutorial. Thanks, Gaurav! :)
@gkcs
@gkcs 2 года назад
Thank you Marta!
@raj_kundalia
@raj_kundalia 2 года назад
Watched on 13 Nov, 2021 - Thanks for the video.
@anastasianaumko923
@anastasianaumko923 Год назад
Thank you for your work! 😌 Very educative
@kvaranovich
@kvaranovich 6 лет назад
Wow, I liked the explanation a lot. Thanks!!!
@gkcs
@gkcs 6 лет назад
Thanks!
@dilawarmulla6293
@dilawarmulla6293 6 лет назад
Amazing explanation! Continue making videos on system design.
@gkcs
@gkcs 6 лет назад
Thanks Sameer!
@royeun7988
@royeun7988 4 года назад
one of the best system design channels!
@gkcs
@gkcs 4 года назад
Thanks!
@miguelpetrarca5064
@miguelpetrarca5064 2 года назад
GCP Pub/Sub states that if a topic does not have subscribers, but messages are published to it, the messages won't be delivered since they were published before any subs were present. This is different than what you had stated. Why?
@jimhewes7507
@jimhewes7507 6 лет назад
I’ve watched a couple of your videos so far. Very good job! I enjoyed them. At 8:56 you mention that you’ll be dealing with ways to avoid the out-of-order problems (consistency, I guess) in a later video. Have you made that yet? If so, where is it? I’ve been interested in general message passing systems for a long time because of the loose coupling aspect of it. That’s what attracted me to the Actor model. But in trying to write some small programs with the Actor model (for example I use the C++ Actor Framework) I run into problems with out of order messages similar to what you’ve described here. The nice thing about the model is that each actor is a single thread, making it easier to reason about and avoid deadlocks. But according to the theory, messages are not necessarily in order within the system. So it seems as if it’s really just pushing the complexity of the problem of deadlocks into the realm of message order. What I’m looking for is general patterns, techniques, etc. for dealing with out-of-order messages. Or I should say, dealing with cases where messages need to occur in a certain order within a system. If you know of any resources let me know since I haven’t found any so far.
@gkcs
@gkcs 6 лет назад
Have a look at ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-dGXHHABFGnk.html. It has a tech video in it's description which talks about the solution to out of order messaging.
@trushapatel9012
@trushapatel9012 4 года назад
​@@gkcs You mentioned in your video, that this system is not good for Financial systems. Well only if the request needs an immediate response. For any load based system, this is a perfect architecture. Let's say you did perform a transaction and want it to be send to your analytics services to process and store it in it's local database, this architecture can work well. Something like this Server1 => DB1 Transaction => Message placed to Queue with Primary Key generated in DB with coming transaction (at this point my queue knows DB is updated with Server1 information) => Server 2 will pick message from Queue and query DB1 with Primary Key passed with message in Queue => Pull data from DB1 and perform analytics operation on it and store results into DB2. * Here Primary Key can be any unique identifier, maybe BatchId or maybe GUID (Unique Identifier)
@JM_utube
@JM_utube 4 года назад
@@trushapatel9012 i know it sounds good but in practice tons of things go wrong LOL.
@Bala-go6cc
@Bala-go6cc 6 лет назад
Good video. It helps me to understand better.
@gkcs
@gkcs 6 лет назад
Thanks Bala!
@rarindam
@rarindam 5 лет назад
Very good presentation......the explanation of failure is a bit wrong from POV of design....on can simpy argue just by redesigning so that S2 only sends a message after it has processed, SO takes the commission out, then the design is not going to have the problem stated. But kudos to you for explaining this is so much clean detail.
@HamzaKhan-oz2xm
@HamzaKhan-oz2xm 2 года назад
Nicely explained
@qbmain1487
@qbmain1487 3 года назад
very useful video, thanks for explanation!
@0613008caonima
@0613008caonima 5 лет назад
brilliant examples and explanation
@SachinChauhan-ch6el
@SachinChauhan-ch6el 3 года назад
wow, an excellent explanation !
@sugyansahu9120
@sugyansahu9120 6 лет назад
Great video. I was expecting this publisher subscriber thing. Moreover, you can also cover publisher-subscriber design patterns also.. which is using the object oriented model.
@gkcs
@gkcs 6 лет назад
Ah, the observer pattern? I'll try to get something on that too 😋
@sugyansahu9120
@sugyansahu9120 6 лет назад
Gaurav Sen Thanks bro! I have learned a lot from you. :) keep going.
@ashutoshmishra2328
@ashutoshmishra2328 3 года назад
Hey Gaurav, thanks for the amazing content. :) At 1:05 you said "even if it is asynchronous, S2 will wait for S3 and S4 responses to come". I didn't understand why S2 will wait for the responses, since it is asynchronous it should not wait right.? it can go and process next request, in future at some time when it'll get the response it can handle that in a different thread. that is what i understood by asynchronous. please correct me if i'm wrong, thanks :)
@shilashm5691
@shilashm5691 2 года назад
He just wrongly said it .
@AshishKumar-gh2bz
@AshishKumar-gh2bz 9 месяцев назад
He meant, on failure case, even if system is asynchronous, say, for failure at S4, S1 will only know about it, when timeout of S2 is reached, (and then timeout of S1 is reached.). You have the correct understanding of asynchronous.
@shivamsingh-cz7od
@shivamsingh-cz7od 5 лет назад
You are absolutely phenomenal! Pls never ever stop making videos!
@gkcs
@gkcs 5 лет назад
Thanks!
@JaiRam-bh9ej
@JaiRam-bh9ej Месяц назад
very complex explanation .... its better to read form website than from here
@andreastewart6361
@andreastewart6361 6 лет назад
very good explanation
@navroze92
@navroze92 6 лет назад
Awesome work. Very well explained with examples:) 1. Are there more videos coming out for system design ? 2. Also I have a question related to system design. I do understand that system design questions are very broad and we need to narrow it down during an interview. But there are so many technologies that need to be learnt and I am quite sure all of them cannot be learnt. So when I am understanding and learning system design problems what are the must know technologies and also do I need to know all of them in depth. Can you cover the must know technologies for system design and maybe make a separated video for the different technolgies
@gkcs
@gkcs 6 лет назад
Thanks! 1. There will be more videos on system design. There is a lot more to cover in this topic 😁 2. Some hot topics are Zookeeper, Cassandra, Docker and Git. It's best to know how they work internally to get a sense of general consistency and availability principles.
@akshaybhosale697
@akshaybhosale697 3 месяца назад
Thankyou
@sylviaboyani1707
@sylviaboyani1707 2 года назад
thanks gaurav!
@schan263
@schan263 6 лет назад
Thanks for the video. I really enjoyed it and I really liked your presentation.
@gkcs
@gkcs 6 лет назад
Thanks!
@ridhwaans
@ridhwaans 3 года назад
about the poor consistency issue, can't you wrap the transactions in a callback such as rails before/after commit. then it doesnt really become an issue
@mariodmc6691
@mariodmc6691 6 лет назад
Smooth explanation. great video
@gkcs
@gkcs 6 лет назад
Thanks Mario!
@satyamdwivedi7006
@satyamdwivedi7006 3 года назад
Great Job
@tsndiffopera
@tsndiffopera 5 лет назад
Coherent and lucid explanation. Thanks for the video. I am subscribing to you. :)
@gkcs
@gkcs 5 лет назад
Thanks Sai!
@ritiksaini-619
@ritiksaini-619 2 года назад
RU-vid might be using it as well You upload a video with service1(S1) The notification system for subscribers is pending in the message queue waiting for S2 or S3 probably a reason why I get notified late for new videos
@wedesiexplorer3432
@wedesiexplorer3432 5 лет назад
Thanks for explaining this so simply Gaurav. In the financial institution example, How about if we build the debit transaction in S1 and post the message for transfer to MQ? If the transfer fails we can recredit the amount. Dont we see the same thing in current banking system where we get the debit message immediately and the transfer completes after few days. Thanks again.
@gkcs
@gkcs 5 лет назад
Yes that's one way to do it. I was more interesting in the concept than the real world parallel :)
@gabrielolocordova9986
@gabrielolocordova9986 4 года назад
Nice Video
@prashanthtirupachurvasanth2224
@prashanthtirupachurvasanth2224 4 года назад
Hey man, amazing series and big fan of your work. Wanted to touch upon the message delivery guarantees pub-sub architectures provide, like "at-least once, at-most once or exactly once". That would be appealing to developers as it will lessen their code logic to maintain the state. Thoughts?
@gkcs
@gkcs 4 года назад
At least once requires idempotency on the receiver. Ay most once is like the typical request-response behaviour of web apis. Exactly once uses transactions. Yes, the guarantees help a lot.
@robinadams8196
@robinadams8196 4 года назад
Good job...🔥🤝🏽
@anishtaneja5665
@anishtaneja5665 5 лет назад
Thankyou and nice video man. but can you please explain the idempotecncy point in an elaborated manner.
@gkcs
@gkcs 5 лет назад
Check out the links and Google around 😉
@harisridhar1668
@harisridhar1668 3 года назад
6:45 Hi Gaurav - when it comes to the setting with financial transactions/atomicity, is it basically the following? 1. Transactions are performed in their chronological order of arrival? 2. Transactions must be fully complete; that is, in a given series of transactions (t_0,t_1, ... t_i, t_{i+1}, ... t_n ), if Transaction ( t_i ) fails, then no transaction afterwards will be executed?
@edwinzin
@edwinzin 3 года назад
I have the same train of thought, it's a good overview of pub/sub though
@amritagarwal931
@amritagarwal931 6 лет назад
Hi Gaurav, You started by saying that S1 has to wait for S0 and S2, similarly S2-> (S3, S4). If you are using a queue that means that the response does not matter to the requesting machine. So the service can just asynchronously call the each other and forget no need to wait. To be clear we should definitely use message queues for these scenarios (benefits like retry etc). I just felt that your comparison was flawed.
@gkcs
@gkcs 6 лет назад
Hey Amrit, that is a good question! This would be true if we had an atmost once message delivery requirement. I was highlighting the atleast once message delivery requirement. We don't care about the order, but we do care about messages being sent successfully :)
@amritagarwal931
@amritagarwal931 6 лет назад
Gaurav Sen in case multiple request. Spawn multiple threads asynchronously, does not make much difference. Queues are definitely better , I am just saying the first point in your comparison does not make any sense.
@gkcs
@gkcs 6 лет назад
I understand that multiple threads can speed up processing, however you have to wait for a successful response from both of them. We cannot ignore failure in our system. It has to be recovered from or reported to the user. If you have to wait for both of them to complete, you are dependent on their response. Is the point clear now? 🙂
@Swasrishi
@Swasrishi 5 лет назад
What will happen if, say, a tsunami destroys the Message Queue? Is there a backup necessary/possible? Even in case of a backup DB: if there is some data that hasn't been synced before the disaster, is it lost forever? Is it possible to handle this scenario? PS: Great series! Thank you for your contribution to mankind!
@JM_utube
@JM_utube 4 года назад
same as any other distributed service. your message queue will be redundant and make copies of the data hopefully across physical locations to prevent this from happening. replication is a fundamental concept in the kafka message broker service. of course, that data for replication is being transferred across the network, so if data hasn't been replicated it will indeed be lost if the original node fails.
@chandraballa4860
@chandraballa4860 5 лет назад
Hi Gaurav, i am a huge fan of your presentations and appreciate your time and effort on these. QQ- In a publish subscribe model like KAFKA, the publisher S1 or S2 publish the messages to the KAFKA topics and it is upto to the subscriber group to pull the messages isn't it. Listeners need to be configured to the KAFKA topics to pull the messages by the subscribers and the message broker doesn't push them to the subscribers. Please let me know if my understanding is wrong.
@gkcs
@gkcs 5 лет назад
Thanks Chandra! The push mechanism allows real time subscriptions. It as common a mechanism for publish subscribe as any.
@nitinpatil-gf7jt
@nitinpatil-gf7jt 4 года назад
great explanation..But why the invoice is getting generated before even debiting the account? It should be the other way round right? But I got your point...inconsistency because one tractionsaction is distributed across services..!!
@ankitgaur8439
@ankitgaur8439 6 лет назад
keep up with good work bro. Don't give up, you will surely make it big. Good luck :)
@gkcs
@gkcs 6 лет назад
Thanks Ankit :)
@kamyakamya1874
@kamyakamya1874 2 года назад
Hey Gaurav, Great content thanks for sharing. I have a question, Kafka exactly-once semantics overcame the problem of idempotency and consitency issue right?
@gkcs
@gkcs 2 года назад
They use distributed transactions, which is a little expensive (blocking). But yes, the problem can be solved that way.
@MithunKumar-xy9pp
@MithunKumar-xy9pp 6 лет назад
How will adding MQ improve end user response time? If S4 is down , S1 still has to wait till S4 process message.
@gkcs
@gkcs 6 лет назад
No, it can respond immediately after writing to the queue between S2 and itself. That write is enough to ensure that S4 will have an eventual write.
@juanmamani2110
@juanmamani2110 5 лет назад
In your opinion what should the best core API for gps telemetry? Producer API Consumer API Streams API Connector API I think should be streams API, isn't? So event driven model should be for microservices, or not?
@namrataajmeri6814
@namrataajmeri6814 Год назад
What architecture needs to be there for financial services?
@priyankasahoo6728
@priyankasahoo6728 5 лет назад
Can you please create video on soap vs rest service usage. When to use which one?
@gkcs
@gkcs 5 лет назад
Use restful, always.😁
@priyankasahoo6728
@priyankasahoo6728 5 лет назад
Do you mean we can use restful services everywhere .. then why do still people use soap for some of their use case .😊
@gkcs
@gkcs 5 лет назад
It's unnecessary and difficult to change old services. 😁
@mangeshjoshi8875
@mangeshjoshi8875 3 года назад
Excellent explain action Gaurav 👍 One question , as this is pub/sub model, is there any option in informatica cloud application integration , when a simple event can be directly loaded into one database table, our Business team wants to load Salesforce platform events into a db table, I did not find any such literature in informatica, if you provide any inputs Mangesh
@learn_now_dot_sh_28
@learn_now_dot_sh_28 4 года назад
role of cloud functions in pub/sub system.
@elfchosen1477
@elfchosen1477 3 года назад
I feel this publisher subscriber model diagram is different from what I saw somewhere else.
@threekingdoms99
@threekingdoms99 Год назад
1:46 I don't get "Inconsistent Data" part, can anyone explain for me or give me examples? Thank you.
@mannysingh6618
@mannysingh6618 6 лет назад
Pub/Sub is used extensively in finance.
@gkcs
@gkcs 6 лет назад
It is, but for event posting and tasks which can afford idempotency. In cases which need synchronous responses, we can't have the pub-sub mechanism.
@nishantgarg7497
@nishantgarg7497 4 года назад
Can anyone pass the next link on consistency as mentioned on 9:01
@spicytuna08
@spicytuna08 6 лет назад
When S1 response back in the pub/sub model, it should response with some data, not just stating that the message has been successfully published.
@gaming_with_ajey
@gaming_with_ajey 4 года назад
Great explanation as always. Just one more advantage - Since publishers and subscribers have different capacities for publishing and consuming messages. The number of messages that can be published/consumed is not limited as we can scale our Message Queues separately. Correct?
@gkcs
@gkcs 4 года назад
Yes, we can provision the queues independently 😁
@claushellsing
@claushellsing 4 года назад
I have always a doubt regarding this type of architecture, how to I poll the message broker??? If I have node application that if listening for en event of RabbitMq in order to send a notification to my users, How do i poll ? A "for" ? A "while" ? Does RabbitMq come with a hook ?
@abisheksoni3354
@abisheksoni3354 2 года назад
Great content. One query : Suppose the commission is on % basis let say 10% . And publisher pushing message along with request I'd First time s0 (10% of 900)charged for 90 rupees S2 failure . Second time s0 see the message with same request I'd will not charged because earlier it charged as 90 and that is not more then it should be (10 % of 800) is 80 means there is difference of 10 and processing the s2 ( success). Can we use/maintain a different queue instance which help us : if any failure occurs on S2 then revert the respective transaction on s0 ( by maintaining some unique I'd to do so) . Please correct me if I wrong anywhere. Thanks in advance
@sreyanchakravarty7694
@sreyanchakravarty7694 6 лет назад
Hi Gaurav. Just wanted to ask a question about about Competitve programming. Do you think we are at a point where CP has become absolutely necessary to get a job at a top tier company like Google, FB, etc? Also do you think someone with a poor math background should pursue CP just for job offers?
@gkcs
@gkcs 6 лет назад
Hey Shreyan! It isn't necessary to do CP for a job there. Practicing algorithms and math within the syllabus is still enough to clear the interviews. Of course, practicing problem solving helps, and CP in turn helps you do that. If a guy has a poor math background, he should try and improve that. I don't think it helps participating with the sole purpose of getting a job. Keep hope! Cheers!
@sreyanchakravarty7694
@sreyanchakravarty7694 6 лет назад
Gaurav Sen maybe I was a little ambiguous. I meant is CP necessary for a job in top tier company like Google/Directi. Will you say that CP is still not necessary?
@saadanwar7908
@saadanwar7908 5 лет назад
"You cannot use this for mission critical systems, where either there's a success or a failure. There is no atomicity in this" (9:06 - 9:13) Could you please elaborate more on why this is the case? I know atomic transactions are that they either all succeed, or all fail together. Wondering if you could provide more context on this. Thanks!
@gkcs
@gkcs 5 лет назад
Thanks! Inconsistent data is a problem in these systems. Like a account being debited but the other not being credited. This is possible if one service works and the other fails. This is common in messaging systems.
@RaoVenu
@RaoVenu 4 года назад
I would disagree with "You cannot use this for mission-critical systems". Your example was just a poorly designed event bus.
@JohnDoe-ji1zv
@JohnDoe-ji1zv 4 года назад
Rao Venu can u give a good design example then ?
@HarishKumar-yh3tz
@HarishKumar-yh3tz 6 лет назад
Hi Gaurav, your videos are really good, i have a question, as you said publish subscribe model gets the job done for twitter and gaming services, but what is the alternative for financial services, build a monolith app?
@gkcs
@gkcs 6 лет назад
When idempotency is not an option or when we need consistency across services, the publish subscribe model is ill fitting. Mission critical stuff in finance has to be dealt with in a different way. However, banks and other finance services can use this is places like analytics and book keeping.
@Gimmiyimmy
@Gimmiyimmy 4 года назад
you said that this architecture is not suitable for financial application, then which architecture is suitable for financial application. is it Request/Response or something else?
@rahulsoni-lx5rb
@rahulsoni-lx5rb 3 года назад
🤩🤩
@nileshmanganakar1595
@nileshmanganakar1595 4 года назад
Hii gaurav, firstly I really love your videos. Big fan. and i appreciate all that you do. we get to learn a lot from these videos. I have one doubt. In the bank example, we could have configured the message queue to send the message to S2 (fund transfer ) service first and if that is successful only then send the message to S0(Invoice) service right?? This could have solved the problem right? Or is there any catch in it which I might be missing? Thanks alot again!!!!
@gkcs
@gkcs 4 года назад
The message queue doesn't usually have ordering/conditional logic on subscribers. It could send events to S2 and take separate 'success' events from S2, which S0 can subscribe to. If the sucess events have enough context, S0 can work on it. This would be similar to a request response architecture, with the queue being a broker.
@dineshroks
@dineshroks 3 года назад
@@gkcs So the message broker sends the events to multiple services concurrently?
@PouyaAtaei
@PouyaAtaei 4 года назад
minute 2:43! how do you send a success message to the user when your S2 response is not resolved yet?!
@raptrdelta2095
@raptrdelta2095 3 года назад
If S4 is broken ,kaftka will take care to send response right Kaftka is having copy of that S4 Right?
@patrisudheer9424
@patrisudheer9424 4 года назад
hi Gaurav, good video. one query , what will happen , if message queue goes down and the messages/ events gets lots .
@gkcs
@gkcs 4 года назад
The message queue should have some way of persistence, if the events are important. The queue service also has to be distributed to allow fault tolerance. Have a look at Apache Kafka.
@shivamsingh-cz7od
@shivamsingh-cz7od 5 лет назад
Ques: is event-driven DB same as the pub-sub model, why choose one over another? Is the only difference persistent storage or more?
@gkcs
@gkcs 5 лет назад
You can try our some of the links in the description :)
@shivamsingh-cz7od
@shivamsingh-cz7od 5 лет назад
many thanks :)) seems event-driven DB just a concept of pub-sub from the doc!
@thisisayush8
@thisisayush8 3 года назад
While showing request response architecture, it is advisable to show either bidirectional arrow or 2 different arrows (opposite direction) between client server
@gkcs
@gkcs 3 года назад
I prefer the single arrow to show where the request is going to.
@thisisayush8
@thisisayush8 3 года назад
@@gkcs just to share information, we are developing DDS framework for Autonomous vehicles as it can handle both request response as well as publisher subscriber system (without broker).
@vikkikumar2285
@vikkikumar2285 2 года назад
will message broker push msge to Server or server will poll msge from message broker ?
@harshvardhansinghchauhan231
@harshvardhansinghchauhan231 6 лет назад
Please can you suggest me from where i can study system architecture and design patterns
@gkcs
@gkcs 6 лет назад
You could try highscalability, Martin Fowler's blog and tech conference videos. Plus, there are some videos on this channel :)
@harshvardhansinghchauhan231
@harshvardhansinghchauhan231 6 лет назад
Gaurav Sen thanks for all these resources
@harshvardhansinghchauhan231
@harshvardhansinghchauhan231 6 лет назад
And also can you make some videos on kernel development and operating systems
@bornbydawn
@bornbydawn 6 лет назад
For design patterns, I would really recommend 'Head First Design Patterns'. It's an interesting read also :)
@azadalishah2966
@azadalishah2966 4 года назад
🧐In publisher/subscriber, don’t subscriber send message to publisher as well? Or is it one way communication?
@gkcs
@gkcs 4 года назад
That would defeat the purpose.
@mangeshtrimbake3170
@mangeshtrimbake3170 3 года назад
I have been researching these kind of topics, and everywhere people explaining applied knowledge of pub/sub ie what/how/where to implement pub/sub (already implemented tools/stacks). I want to implement my own pub/sub from scratch then afterward I would like to go for how I gonna use it.
@enggchakshu
@enggchakshu 4 года назад
Hello, can you make a video on Kafka use cases in MS architecture!
@vishnuvardhannayakam2991
@vishnuvardhannayakam2991 6 лет назад
Bro i want to ask something suppose i have site called Amazon.com, In this we need to dump lot of code. I think they use micro services like home page served by one machine, log in by another and add to bag and checkout by other server right. then those servers are remotely connected right . if we click on add to bag the request goes to add to bag server(i mean the code related to this is present in that server) right ? then if one server gets failed the dependency servers are not works right in micro services. If we use monolithic that may works but no use of working those pages example with out add to bag page there is no use of checkout page right. Is this is the way the system would be. thats what i understood, is it fine ?
@guest8223
@guest8223 6 лет назад
How about this: S1 updates its local DB, then it fails to publish the message to the message broker. Now you have inconsistency in your microservices. Failure to publish can be caused by various reasons and it is very likely to happen, although not frequently.
@gkcs
@gkcs 6 лет назад
That's a good question. One solution would be to push the task to queue first.
@guest8223
@guest8223 6 лет назад
Yes, then updating local DB could fail. We have a similar problem now :)
@gkcs
@gkcs 6 лет назад
No, the queue has a responsibility to maintain the task status. At each step, it completes a job like persisting to local DB. At the end of each job, the status is updated. All the jobs to be done have to be idempotent for this to work.
@guest8223
@guest8223 6 лет назад
Then you would follow if the local DB has been updated, plus if it has been published to the message Broker right?
@guest8223
@guest8223 6 лет назад
There is a good pattern with Message broker to solve this problem. Some call it "Listen to yourself". The idea is S1 just publishes the message to the Message Broker and returns success Ack if it succeeds. S1 also has subscribed to this message and it updates its local DB only when digesting that message from the Message Broker. The disadvantage of this pattern is S1 has to deal with eventual consistency. When it returns success Ack it is only saying that it successfully received the client's request and being processed. In other words, the request has not been rejected.
@bhupendrabisht6951
@bhupendrabisht6951 4 года назад
can we do bidirectional communications between microservices?
@gkcs
@gkcs 4 года назад
Yes
@vedantraval7066
@vedantraval7066 4 года назад
is it duplex,simplex or half duplex?
@kp8607
@kp8607 4 года назад
In this model, how do we know to retry since we don’t even know if there’s an error
@gkcs
@gkcs 4 года назад
We do on publishing. The queue sends an acknowledgement on message push.
@balla4real358
@balla4real358 6 лет назад
Is a message broker the same as aws sqs?
@gkcs
@gkcs 6 лет назад
Amazon SQS can be used as a the message broker. We could also use RabbitMQ or Kafka. A message broker is something which takes the responsibility of delivering messages to it's subscribers. You could have a look at the video here: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-oUJbuFMyBDk.html
@avinashdevadhars6817
@avinashdevadhars6817 2 года назад
if i buy the course on interview ready website, whats the validity of course ?
@gkcs
@gkcs 2 года назад
It's a one time purchase with no access deadline :)
@dominicktunac9562
@dominicktunac9562 6 лет назад
Hi Gaurev, could you publish also a video for useful shortcuts/tools you are using for IntelliJ? Thanks!
@gkcs
@gkcs 6 лет назад
I'll try and do that :)
@mp4_sachin
@mp4_sachin 4 года назад
Was is just me or the fund transfer example was so confusing that I started doubting that it was hypothetical?
@jacobmoore8734
@jacobmoore8734 Год назад
Could you add some numbers/ordering to your videos? I watched it after event driven architecture because this video came afterwards in your System Design playlist.
@lakshminarayanansairam2739
@lakshminarayanansairam2739 4 года назад
Buddy, can u post the algo exprert discount link.. i am planning to get the system design..
@gkcs
@gkcs 4 года назад
The discount code is 'gaurav'. You can also check out my system design video course at: get.interviewready.io/courses/system-design-interview-prep Use 'earlybird' for a 20% discount :)
@lakshminarayanansairam2739
@lakshminarayanansairam2739 4 года назад
@@gkcs is your course link for one year or unlimited.
@lakshminarayanansairam2739
@lakshminarayanansairam2739 4 года назад
@@gkcs i am preparing TPM in amazon/google.. not sure if this course helps but i am desperately wanted to join such big companies..
@yangsong4839
@yangsong4839 6 лет назад
Can u make a video of how to design autocomplete ?
@gkcs
@gkcs 6 лет назад
I'll try to get to this sometime :)
@rramsen
@rramsen 6 лет назад
www.tutre.com/index.php/2015/11/02/autocomplete-implementation-using-tries/
@samuelh5
@samuelh5 3 года назад
you're the f'ing man
@rajnishtiwari1344
@rajnishtiwari1344 2 года назад
Hi Gaurav, is it fine to mention kafka in a system design interview if i have no prior experience in working with kafka
@ShaanGola
@ShaanGola 4 года назад
Hey @gaurav, I've watched your previous videos and also subscribed ur channel ..I need your help to just have a look what I made so far based on knowledge from your videos.
@sonybravia7485
@sonybravia7485 5 лет назад
who is this guy trying to send Rs. 1750 even though they have Rs. 1000 in their account. Put them behind bars
@gkcs
@gkcs 5 лет назад
Hahaha
@f135ta
@f135ta 2 года назад
Horrendous. Thanks.
Далее
What's an Event Driven System?
14:59
Просмотров 314 тыс.
What is a MESSAGE QUEUE and Where is it used?
9:59
Просмотров 969 тыс.
Самое неинтересное видео
00:32
Просмотров 1,2 млн
Нарвался на сотрудника ФСБ⚡️
01:00
Publish-Subscribe Architecture (Explained by Example)
30:03
What is an API and how do you design it? 🗒️✅
15:26
Why do Databases fail? AntiPatterns to avoid!
8:27
Просмотров 114 тыс.
What is DATABASE SHARDING?
8:56
Просмотров 923 тыс.
Самое неинтересное видео
00:32
Просмотров 1,2 млн