What's an Event Driven System?

SdĂ­let
VloĆŸit
  • čas pƙidĂĄn 27. 07. 2024
  • Event Driven Systems pass and persist events. They have evolved from the publisher-subscriber model, and the design has some advantages. Events are immutable and can be replayed to allow the systems to take snapshots of their behavior. This allows services to 'self heal' as explained in the video.
    A lot of transaction issues are alleviated once idempotency and retrial logic is added to a system. The system can retry messages an infinite number of times to the recipient till there is a message acceptance and acknowledgment from the receiver.
    Event-driven systems are closely related to event sources and CQRS. Greg Young and Martin Fowler have been talking about these systems for a while. Events are persisted in something like a message queue, and hence the responsibility for retrial and persistence is moved to it.
    These abstractions enable the programmer to focus on the business logic of a system and add subscribers to events with minimum coupling with other services. Decoupling the system is one of the advantages of event-driven systems.
    One major disadvantage of this system is that it is difficult to reason about the flow of a request. Services can independently register for an event and consume it without the publisher being aware of it.
    We talk about different applications using an event-driven architecture such as Git and Gaming Systems. We then discuss the advantages and disadvantages of such an architecture (Event Sourcing).
    Code:
    github.com/coding-parrot/Low-...
    Looking to ace your next interview? Try this System Design video course! đŸ”„
    interviewready.io
    00:00 Event-Driven Systems
    01:17 Examples of EDA
    03:42 Features
    04:09 Advantages
    04:19 Availability
    06:14 Roll back
    06:50 Replacements
    07:30 Transactions
    09:00 Drawbacks
    12:32 When should you use it?
    14:24 Real World Examples
    14:40 Thank you!
    References:
    Martin Fowler: ‱ The Many Meanings of E...
    Martin Fowler Blog: martinfowler.com/articles/201...
    Wikipedia: en.wikipedia.org/wiki/Event-d...
    Chris Richardson: microservices.io/patterns/data... (I will be talking about this soon! )
    You can find me at:
    / gkcs0
    www.quora.com/profile/Gaurav-...
    / gaurav-sen-56b6a941

Komentáƙe • 184

  • @gkcs
    @gkcs  Pƙed 3 lety +17

    If you are preparing for a system design interview, try get.interviewready.io.
    All the best 😁

    • @okeyD90232
      @okeyD90232 Pƙed 2 lety +4

      If i subscribe, I will start listening to new events produced by your channel :)

  • @venkatkrishna3774
    @venkatkrishna3774 Pƙed 2 lety +4

    One good thing about your videos is that you smile often, I feel that is much needed for the audience to be engaged through out your videos.

  • @Chorizzosoup
    @Chorizzosoup Pƙed 4 lety +55

    Interviewer: what's the most important thing you want in your system design?
    Me after watching this vid: You want headshots!

  • @pavithrae874
    @pavithrae874 Pƙed 6 lety +8

    Thank you so much for the rich content.

  • @sebastianwardana1527
    @sebastianwardana1527 Pƙed 5 lety +18

    Its pretty cool of you to put this out! I might not pick up everything the first time, but its really elluminating and I really think about trying out new tech... thanks for that.

    • @gkcs
      @gkcs  Pƙed 5 lety

      Thank you!

  • @MaxPicAxe
    @MaxPicAxe Pƙed 5 lety +4

    Wow your explanations are absolutely brilliant!

  • @Cookie82772
    @Cookie82772 Pƙed 2 lety +2

    This channel is a gold mine.

  • @zillionvolts
    @zillionvolts Pƙed 3 lety +73

    You have mixed Event-Driven and Event-Sourcing!

    • @SalgatAustin
      @SalgatAustin Pƙed 2 lety +2

      Event sourcing utilizes event driven architectures. He was simply giving a use case for it.

    • @asg3hb
      @asg3hb Pƙed 2 lety +1

      To explain event-driven architecture.... Would be helpful to not add in another layer on top in the example one is providing. That's what event sourcing does.

  • @souravkabiraj5060
    @souravkabiraj5060 Pƙed 4 lety

    Great video.. nicely explained.. you are best youtuber of this genre..

  • @JM_utube
    @JM_utube Pƙed 4 lety +11

    great video thanks so much. you could talk at length, endlessly, about event driven architecture, and this video actually was the perfect level of depth.
    event driven architecture, or subsets of it, are absolutely used in just about every single tech company these days. however, one of the hardest parts is figuring out what happens downstream after a message is published. can require major logging tools on top of entire systems like splunk or ELK to trace what happens through your systems, which is complex on it's own. i've spent days or weeks tracing transactions through microservice queues trying to solve bugs. Also, enforcing message schemas is another huge problem. rabbitMQ / kafka + nodeJS is a particularly nasty combination when it comes to debugging LOL. but i suppose thats why we get paid the big bucks ;)

  • @stormarrow2120
    @stormarrow2120 Pƙed 2 lety

    I love your content! Thank you for sharing your videos!

  • @adipratapsinghaps
    @adipratapsinghaps Pƙed 4 lety

    This is a great video. Thankyou so much gaurav.

  • @learnandsharelive
    @learnandsharelive Pƙed 4 lety +2

    Hi Gaurav,
    First of all, thank you so much for the content which you have highlighted on the "Event-Driver Architecture".
    One of the disadvantages which you have highlighted was "unable to track the end-2-end flow" in this architecture. So to answer that we can use the "Orchestration" pattern and you might be aware. So, basically, design the "workflow-orchestration" as soon as you get the service response so that we'll come to know where it hangs in case of any failure. We're using "CAMUNDA" for the same.
    Thanks!

  • @anildangol
    @anildangol Pƙed 5 lety +4

    These videos are really good. More better, your excitement explaining things. There are lot of videos in youtube which may be better than your but man they are boring like hell that I get sleepy. Keep up the good work!

  • @phanikumar278
    @phanikumar278 Pƙed 4 lety

    I believe why people like your video's is the way you enjoy the concepts and complete involve and explain them.. we can see in your eyes ( joy of happiness ) ... It could be great if you can show a video to community .. system design discussion with in group of people .. like everyone present their idea and how will you figure out the best in that room ...

    • @gkcs
      @gkcs  Pƙed 4 lety

      A design discussion? That sounds like a good idea 🙂

  • @stoneshou
    @stoneshou Pƙed 4 lety

    The way you described persisting events in the service makes it sound like an append file rather than database

  • @stiupidboy
    @stiupidboy Pƙed 3 lety +3

    the title is soooo confusing!! The cover photo says "Event Sourcing" and the title says "Event Driven". I believe they are quite different things. Now you helped me mixed them up, thank you :)

    • @Saiyugi16
      @Saiyugi16 Pƙed 3 lety +3

      So not exactly, his architecture diagram depicts a service that captures the events in an event store as it's dispatched on the bus which is event sourcing.
      Event driven architecture version, is just the process of using events to communicate between services via event bus whether internally or externally and have each service subscribing to that event to later process it.
      What he hasn't covered in depth was replaying events, but he briefly mentioned stream processing when he mentioned rollback when he gave examples and advantages.
      Guys this is an overview video not an in-depth one. I believe he did a great job. Good man keep it up!

  • @saamtech
    @saamtech Pƙed 3 lety +16

    I think this is more of event sourcing architecture (which is sub category of event driven) than event driven itself. In event driven architecture, my understanding is that there is no "replay" function nor there is implementation to support the replay functionality. A good example of it is almost all front end frameworks use event driven archs and they don't store any state

    • @vishalkaushik6169
      @vishalkaushik6169 Pƙed 2 lety +3

      There is feature of replay subjects in Rxjs( Angular uses this) . It stores the previous States if I am not wrong đŸ€”

    • @generationgap416
      @generationgap416 Pƙed rokem

      Observables is event-driven and it has replaying abilities.

  • @MayankAggarwal
    @MayankAggarwal Pƙed 4 lety +2

    Very interesting point you mentioned is that there is problem in understanding the flow of the code. I too faced myself this issue.

    • @gkcs
      @gkcs  Pƙed 4 lety +2

      It's magic!

  • @nilanjanmukherjee4219
    @nilanjanmukherjee4219 Pƙed 5 lety +4

    Hey Gaurav! First up... awesome video. So actually I work in the front office for an investment banking firm. So this architecture forms the whole core system of how we interact with things. If you would like to maybe we could have a conversation regarding the same it might help us both gain more perspective. Anyway. Cheerios! Keep posting

  • @anastasianaumko923
    @anastasianaumko923 Pƙed rokem

    Great explanation, thank you! 😌

  • @yashmirashi2956
    @yashmirashi2956 Pƙed 5 lety +1

    i like presentation skills!! 👌

  • @sonambhardwaj785
    @sonambhardwaj785 Pƙed 3 lety

    @gaurav sen- enjoy watching your videos. You are very knowledgeable. Not many recent videos. you should do more. all the best

  • @dantewhite1818
    @dantewhite1818 Pƙed 4 lety

    You have the best content

  • @yashmirashi2956
    @yashmirashi2956 Pƙed 5 lety +13

    i like your presentation skills!👌

    • @gkcs
      @gkcs  Pƙed 5 lety

      Thank you!

  • @AmulyaSahoo349
    @AmulyaSahoo349 Pƙed 5 lety +3

    Hey Gaurav, Thanks a lot for this awesome video. The examples you give to explain something are awesome like counter strike, It so simplified the whole system. Thanks a lot :)
    Btw, is the event bus a message queue or any pubsub like Kafka?

    • @gkcs
      @gkcs  Pƙed 5 lety +1

      Thanks!
      A pubsub like kafka is how I look at it. Although a message queue will also do.

    • @neshant89
      @neshant89 Pƙed 5 lety +2

      "In Kafka message can be subscribed by multi consumers, means, many consumer types not many instances of same one.
      In a typical messaging queue like Rabbit a message can be consumed only once, and when consumed, the message disappears and isn’t accessible anymore."
      and as said in the video replicate and replay of messages is a feature of event driven architecture.

    • @AmulyaSahoo349
      @AmulyaSahoo349 Pƙed 5 lety

      @@neshant89 Got the difference. Thanks :)
      Suppose in Kafka, for a single topic there are multiple subscribers ready to consume. When a message comes to the topic, all the consumers will receive the same message (copies) or any one of the consumers will only receive that message?

    • @jagatsastry
      @jagatsastry Pƙed 4 lety

      @@AmulyaSahoo349 All the consumers will receive the same set of messages

  • @Bulleteerism
    @Bulleteerism Pƙed 4 lety

    Hi Gaurav , likewise for gaming scenario , how i can test and verify that a user has joined the request event created by me to join the playroom ?

  • @pradipnitw
    @pradipnitw Pƙed 6 lety +7

    u are getting better each day :) loving your videos ....
    I would love to understand form you. How to do come up with a design solution in a system design?
    What are the factors you evaluate to add/optimize a system etc while designing a software system?

    • @gkcs
      @gkcs  Pƙed 6 lety +2

      Thanks Pradip! Most of it comes from experience through work and projects. The interviewer focuses on certain points like consistency and availability, and we think of ways to achieve them. I'll try more detailed approaches in the videos 🙂

  • @vinayaka1234
    @vinayaka1234 Pƙed 4 lety +16

    Hi Gaurav, can you please explain what is the difference between message queues and event driven system.

    • @nemanja.tonic87
      @nemanja.tonic87 Pƙed rokem

      This might help: www.techtarget.com/searchapparchitecture/tip/Event-driven-vs-message-driven-It-comes-down-to-complexity
      Basically, a message has a pre-defined receiver, while events are just published and multiple components can subscribe to them.

  • @samarthsharma9019
    @samarthsharma9019 Pƙed 3 lety

    Great content!

  • @awadheshamar6012
    @awadheshamar6012 Pƙed 5 lety +1

    great job Gaurav

  • @sankalparora9374
    @sankalparora9374 Pƙed rokem

    Great explanation - thank you!

    • @gkcs
      @gkcs  Pƙed rokem

      You are welcome!

  • @Thannimodu
    @Thannimodu Pƙed 5 lety +1

    thanks for this video

  • @anujvohra7904
    @anujvohra7904 Pƙed 4 lety +3

    Thanks Gaurav. NIce video. May I also point out a few advantages of event driven architectures?
    1. It is the only way in which you can implement SEDA and hence scale individual stages as load increases. As the EDA works in eventual consistency model, the scale up times are not as relevant (or as relevant as they may be in req/resp paradigm)
    2. This is necessary if you are implementing a CQRS based system.
    3. Lambda architecture is only supported with events (allowing us to arguably beat the CAPs theoren)
    4. In container world, where a container can be evicted any time (in the middle of a transaction etc), we either need all services to be idempotent or have an event driven architecture in place. Idempotency is not always possible.
    Regards

  • @bbharathkumarreddy1936
    @bbharathkumarreddy1936 Pƙed 5 lety

    Hi Sir, If suppose I have an invoice app & I want to check stock, and invoice it, email the pdf. At last, the user wants to know the invoice is created or rejected due to low stock all the response should be sent to the front end for showing it after clicking invoice immediately. In this case, what is the best way to split as event-driven?

  • @anmol23narang41
    @anmol23narang41 Pƙed 3 lety +3

    Could someone please highlight the main difference between Pub-Sub and Event-Driven Architecture?

  • @inversemetric
    @inversemetric Pƙed 3 lety

    Thanks, great work

  • @mageshkumar547
    @mageshkumar547 Pƙed 4 lety

    does event poll accepts multiple requests at a same time. I mean will it process multiple requests in concurrent?

  • @spicytuna08
    @spicytuna08 Pƙed 5 lety +3

    i didn't know react uses this architecture. thanks.

    • @MaxPicAxe
      @MaxPicAxe Pƙed 5 lety

      I don't think react specifically uses this architecture? I know redux does and many react apps use redux

    • @bibek8284
      @bibek8284 Pƙed 4 lety

      MaxPicAxe I think react use it on Reactdom features

  • @dfghjcvbh
    @dfghjcvbh Pƙed 6 lety +4

    Hi Gaurav, Thanks for the awesome videos....They are really helping to understand system designing. Can you please tell from where can I study more about System Designing. What all topics a good Software Engineer should know?

    • @gkcs
      @gkcs  Pƙed 6 lety +4

      Hey Ashish, thanks! You could try the highscalability blog and tech conference videos on CZcams 😁

  • @swatigojra7904
    @swatigojra7904 Pƙed 4 lety +1

    Really awesome video, thanks ..:), just a ques : Is Kafka also following event driven architecture, what's the difference btw pub sub and this architecture ?

    • @gkcs
      @gkcs  Pƙed 4 lety

      I made a video on publisher subscriber architectures here:
      czcams.com/video/FMhbR_kQeHw/video.html

  • @rajeevchaturvedi2007
    @rajeevchaturvedi2007 Pƙed 2 lety

    Good diagram - it is very well explain

  • @abhishekrathod4713
    @abhishekrathod4713 Pƙed 2 lety

    What is event consumer and event consumer buffer size? There is a use of this in circuitbreaker design pattern but it is not clear what this does

  • @ziyijiang4050
    @ziyijiang4050 Pƙed 4 lety +3

    great video, thanks for sharing. One thing I fee like might improve this is to show other similar or comparable systems. Some of benefits you are showing here is hard to be closely associated with event driven system, without comparing with other system, even briefly. I guess it is more due to the popularity of even driven system, I don't even know or say did not come up with other systems immediately when watching this video, then I thought isn't these benefits are from other system as well?

    • @gkcs
      @gkcs  Pƙed 4 lety +1

      Good point :)

  • @parvezmulla3324
    @parvezmulla3324 Pƙed 6 lety +3

    I never miss your system design videos! I always wait for ur next video on system design.

    • @gkcs
      @gkcs  Pƙed 6 lety

      Thanks!

  • @SuperEmilia1969
    @SuperEmilia1969 Pƙed 4 lety

    You are too good with your explanation Gaurav.

    • @gkcs
      @gkcs  Pƙed 4 lety

      Thank you!

  • @mohsanabbas8787
    @mohsanabbas8787 Pƙed 3 lety

    what if service A needs to know something that only service B knows or Process, Like repricing of a product in shopping cart. or availability check which can be an external gateway. Does this architecture poses lot of flaws in this particular case?

  • @pankhurigupta8623
    @pankhurigupta8623 Pƙed rokem +3

    Great conetent! It would be more helpful if you explain with examples of real-world applications.

  • @TheWeekendYogi
    @TheWeekendYogi Pƙed 5 lety

    Is it better to maintain a event router service or every service runs its own instance of the subscriber service. ?

    • @gkcs
      @gkcs  Pƙed 5 lety +2

      Have a look at what a service mesh is. I will be speaking about this in detail sometime soon :)

  • @SamuelKarani
    @SamuelKarani Pƙed 4 lety +15

    "I''ll cache you next time"

  • @SanthoshKumar-or7wd
    @SanthoshKumar-or7wd Pƙed 3 lety

    Need more videos with real time examples with micro service architecture

  • @spicytuna08
    @spicytuna08 Pƙed 5 lety +1

    Hey thanks again for another amazing video. Isn't reading/writing from DB time consuming? In gaming example where a millisecond is critical, I can see that DB access can be a bottle neck. Using CACHE memory from DB makes more sense.

    • @gkcs
      @gkcs  Pƙed 5 lety +2

      Yes, caches are extensively used in low latency apps. The requests for a game will all probably map to a single server, so that the cache is consistent.

    • @B4nks
      @B4nks Pƙed 5 lety +1

      This is why Redis is so popular. It's an: "in-memory data structure store, used as a database, cache and message broker."

    • @MaxPicAxe
      @MaxPicAxe Pƙed 5 lety +1

      It's likely all the game state will just be stored on the game server. Just because you have this event system and microservices, doesn't mean you are communicating with them on the internet using ip, they could just be local sockets or files or direct RAM access or function calls etc.

  • @lordstoneShi
    @lordstoneShi Pƙed 3 lety

    Wait. FPS games use UDP and P2P protocols for fast communications, right? I wonder does event-driven model on server side will have low enough latency for such checks.

  • @ShubhamSharma-gs3lm
    @ShubhamSharma-gs3lm Pƙed 6 lety +2

    Hi Gaurav, Can you please explain how Git uses the event driven architecture or provide some material for that? One of my friends was asked this question in an interview recently.

    • @gkcs
      @gkcs  Pƙed 6 lety +2

      I'll get this out soon. Try the git internals book, although it's very large...

    • @surajchandgude5856
      @surajchandgude5856 Pƙed 5 lety

      @@gkcs Hi Gaurav, This is an awesome video but I think you can do it more comprehensive & Please make it more realistic with an example like u delivered the API video. Hope you will release it soon. All the Best thank you!

  • @eshikagupta6616
    @eshikagupta6616 Pƙed 9 měsĂ­ci

    Hey Gaurav! Your videos are great. Every topic has been explained to the perfect depth without making it boring. Just a minor concern I have, can you please order your videos correctly like sometimes a video that's coming up next is something that I don't know anything about which I know you have explained in some other video but don't know which one. It'll be great if you do that! Otherwise everything's great!

    • @gkcs
      @gkcs  Pƙed 9 měsĂ­ci

      Thanks Eshika, noted!

  • @The8merp
    @The8merp Pƙed 3 lety +3

    I would def like to see a video that explains the event driven architecture behind React, Git etc.

  • @seemaprajapati964
    @seemaprajapati964 Pƙed 4 lety

    It's Kind of broadcasting which I come to know by any publisher side but tell me one thing .... Consumer will register itself somewhere or not?

  • @murike
    @murike Pƙed 5 lety

    I see that you described event sourcing here. Does event driven architecture always comes with event sourcing?

    • @gkcs
      @gkcs  Pƙed 5 lety +2

      From what I understand, yes.

  • @santhoshm9193
    @santhoshm9193 Pƙed 5 lety

    Nice.. I need a example for database table structure in event driven architecture.

  • @khurram650
    @khurram650 Pƙed 5 lety

    Hi Gaurav, I'm trying to design Online-shoping with Event-driven Architecture but can't understand about message queue. How should I implement and why? E.g. If any customer orders a product, then a REST service would be called, which may or may not call other serivces like shipping, warehouse etc. then where comes message queue and how and where to implement this?

  • @niranjantiwari4987
    @niranjantiwari4987 Pƙed rokem

    Do we have any hands on code example for this architecture on youtube ??

  • @songs4enjoy
    @songs4enjoy Pƙed 5 lety +5

    Gaurav,
    Multiple observations
    1. You seemed to have confused event log with local db for each service. The micro service's local datastore *in general* is its materialized view, which is used to serve its requests, not to persist event log. There are message brokers which provide you with the event log directly with customizable retention polices (sure, you can use database as event log aswell, again whats the point of putting load on your DB which needs to serve requests when broker already stored this information previously and allows you to set retention policies which can be replayed later at any time?)
    2. It is not true that migrating a message flow -> Request-response paradigm is hard. Its infact quiet easy as you are making simple RPC calls. Sure, you will not have the same resiliency guarantees as in messaging as we are moving to request-response paradigm
    3. Its not true that event log is mandatory. You might want to keep it if the business requires it. Else, easiest option is to use broker as a task distributor & consume the messages

    • @gkcs
      @gkcs  Pƙed 5 lety +3

      Excellent points, thanks for posting them 👍

    • @songs4enjoy
      @songs4enjoy Pƙed 5 lety +1

      ​@@gkcs That was quick :) . Again, Thanks for your effort in creating these videos. As an introductory videos, they are great

  • @jaydeeproysarkar4754
    @jaydeeproysarkar4754 Pƙed 5 lety +1

    Hi gaurav , i like the architech and i appreciate that, could you please share a architecture model of e-commerce order management micro service

  • @YGorillAY
    @YGorillAY Pƙed 3 lety +1

    Great Videos!
    BTW you can maybe think of doing a series of reviews of popular pieces of software and software systems in terms of architecture and maybe classifying them on certain criterias (e.g. microservice vs monolith, request-response vs event-driven, etc.). I couldn't find a good source of such info on the Internet, so it is definitely a niche ;) Something similar to your "Design *insert popular app*" videos, but focused more on how and why it was done, comparison to other similar systems (for example Viber vs Whatsapp vs Messenger) and what the pros and cons are (for example in terms of scalability, performance, etc.)

  • @m13m
    @m13m Pƙed 5 lety +1

    Kafka is great building event driven system

  • @ronquan3730
    @ronquan3730 Pƙed 4 lety +10

    WE WANT HEADSHOTS!!!!!

  • @MayureshKadu
    @MayureshKadu Pƙed 5 lety

    Re. 1:19 another application to add your list is Algorithm trading

  • @rohitkrishnan5456
    @rohitkrishnan5456 Pƙed 3 lety

    Hi, nice video Gaurav!
    Just to be clear FPS doesn't work like that right? I know you just used it as an example.. but there must be some problem implementing EDD for FPS. If there is none..I don't know why I still have to suffer from latency issues in 2021. Am I missing something?

    • @rohitkrishnan5456
      @rohitkrishnan5456 Pƙed 3 lety

      Why not just keep a server synchronised time counter in each client?

  • @stoneshou
    @stoneshou Pƙed 4 lety

    Followed from the previous video with the invoice example but this doesn’t give a solution to the distributed transaction across service boundary, I assume that’s just not possible to do here?

    • @gkcs
      @gkcs  Pƙed 4 lety

      It is, but it needs consensus. Have a look at Raft.

  • @kaushikdas417
    @kaushikdas417 Pƙed 6 lety +6

    What is an event bus? Is it a message queue?

    • @gkcs
      @gkcs  Pƙed 6 lety +1

      Yes 😁

  • @sumeshtc9542
    @sumeshtc9542 Pƙed rokem

    HI , Assume like we have one topic and two subscribers to that topic, How will the subscriber know that the message in the topic is already consumed or not , Will the message in the topic will be cleared after all the consumers consumed the message

  • @prateekgogia8310
    @prateekgogia8310 Pƙed 6 lety +2

    I am still new to learn all this. But from my experience, I've implemented some similar scenarios in my projects. So, my question is if I am a JavaScript Developer and my code is mostly written in Angular, then Reactive JS or RxJS is a event based library? Because I believe I can simply create Observables, Observer, Subject and Subscribe to them? I guess that's a event based system. Right?

    • @gkcs
      @gkcs  Pƙed 6 lety +1

      Hey Prateek! That is true... at least at the code level.
      Event driven systems produce and consume events across microservices too.

    • @prateekgogia8310
      @prateekgogia8310 Pƙed 6 lety

      Wow! I was thinking of implementing a notification service. Maybe after watching this video I'm closer to what i want to achieve.

  • @AarshSharma
    @AarshSharma Pƙed 4 lety

    Can you make a video explaining event loop in node

  • @pyalgoGPT
    @pyalgoGPT Pƙed rokem

    2023, still awesome,

    • @gkcs
      @gkcs  Pƙed rokem

      Thank you!

  • @manojamrutharaj9071
    @manojamrutharaj9071 Pƙed 4 lety

    Thank you for all of your videos Gaurav. Great energy and excellent presentation skills. Keep it up. Although am newbie to distributed systems, I can see that the event-driven system is somewhat similar to saving snapshots in a file system or transaction journals in database which provides a point in time copy or state of it so that, user can later restore to any PIT if he needs. Correct me if my assumption is wrong.

    • @gkcs
      @gkcs  Pƙed 4 lety

      Thanks!
      Somewhat, yes. The persistence is of commands/events instead of the snapshot though

    • @manojamrutharaj9071
      @manojamrutharaj9071 Pƙed 4 lety

      @@gkcs Oh I see. Gaurav, one humble request. Can you please include Minutes of your presentation in the comments, summarizing topics covered with time in all of your videos, just as the events are timestamped in this system :) It will be of great help and time saver to jump to particular topic while reviewing or to refresh a particular topic, and, I am pretty sure everyone would want to watch these videos more than once.

  • @shubhamagrawal8478
    @shubhamagrawal8478 Pƙed 5 lety +1

    What if the subscriber goes offline, and producer keeps sending events then the event bus will be overflowing and this might events loss. Looks like a disadvantage of event-based architecture.

    • @gkcs
      @gkcs  Pƙed 5 lety

      And how would you avoid this with the request response model?

    • @shubhamagrawal8478
      @shubhamagrawal8478 Pƙed 5 lety +1

      @@gkcs we have timeout in req-resp model. If a service doesn't respond within timeout limits then we fail our request and handle it differently. But here, if a common event bus is used and one service(listener) is offline then the events of that service would fill the queue and block it for other services.

    • @gkcs
      @gkcs  Pƙed 5 lety +1

      @@shubhamagrawal8478 Distribute and scale the queue.

  • @rambo4014
    @rambo4014 Pƙed 2 lety

    This is more of event sourcing. Event notifications can however work without event sources IMO

  • @shrutikamboj4607
    @shrutikamboj4607 Pƙed 2 lety

    Wondering if Jenkins uses event-driven arch

  • @Dawat-E-Ghurba
    @Dawat-E-Ghurba Pƙed 2 lety

    Java vertex also uses evenbus architectures

  • @d-kz
    @d-kz Pƙed 4 lety

    I’m a bit confused about the difference between an event-driven vs a request-response architecture. Can’t you frame a “request“ as an “event”? So then you “publish” a request, pass it through to event bus, etc.

    • @neerpatel4647
      @neerpatel4647 Pƙed 4 lety +1

      in request response you will have to wait for response... but in event-driven, you don't. you just assume, that once you have published an event, all the subscribers listening to it, will eventually finish up the task.
      but, There is no Guarantee in event-driven system. we can make the system fail-safe by adding up lots of fallback cases, but still, it doesn't always guarantee... and the fun part is, you will never know, if it failed ot succeeded...
      But, in the case of requst-response architecture, we will always know, if our request was success of failure.
      d

    • @d-kz
      @d-kz Pƙed 4 lety

      @@neerpatel4647 ahh cool makes sense, thank you!

  • @upcomingprogrammer6244
    @upcomingprogrammer6244 Pƙed 6 lety

    Hi, I'm three-year experience professional. I want to prepare for Amazon. What short of knowledge is required to get in.

    • @qwarlockz8017
      @qwarlockz8017 Pƙed 3 lety

      leet code... they are heavy on it.. pick up the book Cracking the Coding Interview.

  • @ayanpatel_98
    @ayanpatel_98 Pƙed rokem

    how React and node js use event driven architecture?

  • @hjklmn9526
    @hjklmn9526 Pƙed 3 lety +2

    Hey Gaurav,
    Great Video. Good work :)
    Some questions that confused me..
    1. You mentioned about transactional guarantees in the advantages. You mentioned that it provides utmost-once and at-least once. How can a distributed system cannot guarantee utmost-once semantics unless your application handles it?
    2. Some of the examples (Event log) that you gave especially described an event sourcing pattern where an application state is described as a series of events. Event sourcing is a specialized case, right?
    3. "Difficult to know what people what to consume and what people don't wish to consume". Well, I did'nt get this at all. Can you give may be a simpler example of what you wish to convey by this? I think services can simply subscribe to topics they are interested in consuming and don't subscribe to the rest.
    Thanks and keep posting great content :)

    • @gkcs
      @gkcs  Pƙed 3 lety +6

      Thanks Hjk!
      1. At most once delivery is a natural consequence of distributed systems, yes. We use retries for at least once delivery.
      2. Event driven means the events *drive* the behaviour of the system (events are sent as messages to other services). Event sourcing is more about storing all of the incremental changes in a system as a series of corresponding events.
      3. Let's say you want to remove an API in your system, since you don't think other services are calling it. You find the number of times the API is hit, and make a decision (probably go to the callers and ask why they need the API).
      With events, it is hard to track who is consuming the event. The point of the system is to remove coupling between two services. But that also removes visibility of usage.

    • @hjklmn9526
      @hjklmn9526 Pƙed 3 lety

      @@gkcs Quick reply, Thank you. Makes sense :)

  • @digisecureagent7679
    @digisecureagent7679 Pƙed 3 lety

    It is called chronical event sourcing
    It has many cons and one pros
    I hope no one consider to implement it into production instead take it as an option to takle mostly

  • @vaishalijain3266
    @vaishalijain3266 Pƙed 2 lety

    amazing

  • @kennethcarvalho3684
    @kennethcarvalho3684 Pƙed 3 lety

    Kind of State design pattern partly.. You seem very happy though

  • @456avijit
    @456avijit Pƙed 11 měsĂ­ci

    Is there any role of msg broker in this architecture

  • @Rokazz2
    @Rokazz2 Pƙed 3 lety +1

    love example with CS and headshot hahaha

  • @Salvalfoceadominguez
    @Salvalfoceadominguez Pƙed 5 lety +1

    Great explain but i need listen video at 0.75 speed 😬

    • @MaxPicAxe
      @MaxPicAxe Pƙed 5 lety

      Lol I watch at 1.75 speed :)

  • @HarshTibrewal123
    @HarshTibrewal123 Pƙed 4 lety

    Event logs replaying is actually what event sourcing architecture is.

  • @conqrLife
    @conqrLife Pƙed 5 lety

    Can you recommend a book for system design for beginners?

    • @gkcs
      @gkcs  Pƙed 5 lety

      Nope. Don't know any.

    • @jagatsastry
      @jagatsastry Pƙed 4 lety +1

      The closest you can get is 'Designing data intensive applications', but that's not a book for beginners.

  • @luisarellano1522
    @luisarellano1522 Pƙed 5 lety

    would this be a good architecture for a Customer Ticket System?

    • @gkcs
      @gkcs  Pƙed 5 lety +1

      It depends on the requirements, but this is a useful component in many ticketing systems.
      Ticket creation, status updates, resolving and deletion can be modelled as events. JIRA internally uses Git, which is an event driven system 😁

    • @luisarellano1522
      @luisarellano1522 Pƙed 5 lety

      @@gkcs or would it be better to use a messaging queue system? I guess the main requirements would be transaction guarantee, assign tasks to multiple types of work queues, be able to create new types of queues if needed, and be able to quickly search across all tickets.. would love to hear some suggestions :)

    • @gkcs
      @gkcs  Pƙed 5 lety

      @@luisarellano1522 This is an offshoot of the message queuing system.
      The events are effectively messages.

  • @hrithikbabbar5721
    @hrithikbabbar5721 Pƙed rokem

    Why do we need to replay events while replacing service we could have just copied all the data

  • @blunderfoxbeta
    @blunderfoxbeta Pƙed 5 lety +1

    Bro where do you work?

  • @soheet12
    @soheet12 Pƙed 2 lety

    just for Counter strike example. I understood it :)

  • @Selftaught_ai
    @Selftaught_ai Pƙed 2 lety

    "You want headshots" 😂

  • @Oswee
    @Oswee Pƙed 4 lety

    React is event-driven!? How about Redux?

    • @GabrielVasile
      @GabrielVasile Pƙed 4 lety

      Javascript is an event driven language. React is in Javascript, Redux is in Javascript. If you're wondering how is React event driven, think about how your component re-renders when you change the state or how do you respond when the user submits a form or changes an input and you do validation.

  • @supriya.mallick
    @supriya.mallick Pƙed 2 lety

    Event bus may be MQ, right???

  • @sagarverma55
    @sagarverma55 Pƙed 5 lety

    bro can you system design on zomato

  • @krishind99
    @krishind99 Pƙed 3 lety

    Couple more points
    Your last few lines were “Node JS supports it”. Architecture has nothing to do with language/framework. One can use NodeJS, Python, Golang, java anything that supports EventBus tool (Kafka, Redis, etc)
    With this architecture, (micro)scalability can be a problem. Unless there’s a way to handle race-conditions between multiple subscribers to a channel, you may end up with duplicate data & processing. Or else, you are struck with single instances of a micro service for the rest of your life.