My TOP Patterns for Event Driven Architecture

Поделиться
HTML-код
  • Опубликовано: 24 ноя 2024

Комментарии • 59

  • @tomasjablonskis6053
    @tomasjablonskis6053 3 года назад +5

    Loving the content so far. Would be nice to see more videos about ES + CQRS Query side of things: how they are usually implemented; types of queries (single get; subscribing to projection updates; etc.); where are projections cached for query handlers to consume and how query handlers access them; and in general it would be nice to see the whole orchestration between UI and projections (UI getting notified because of persisted projection change (Command -> Handler -> Rebuild aggregate from repo -> Change aggregate -> Aggregate publishes event -> Projection updates (persisted? in-memory?) -> UI gets new data update through some sort of stream/subscription -> ...), etc.).

    • @CodeOpinion
      @CodeOpinion  3 года назад +1

      So basically the full cycle/loop 😀

    • @tomasjablonskis6053
      @tomasjablonskis6053 3 года назад

      @@CodeOpinion Yeah, basically that. Would be interesting to see one simple cycle through whole system with lets say 2 stores/DBs (1 for events, 1 for projections) and how the syncing process works and where that logic goes, etc. Maybe even show why eventual consistency could be a problem and how to fix it (that could even be a separate video).

  • @toxicitysocks
    @toxicitysocks Год назад

    Thank you for sharing these! I am trying to really tackle event driven system design and these are some of the best quality discussions I’ve found.

  • @glaydersen
    @glaydersen 3 года назад +1

    Thanks for this video! This is the kind of video that everybody should rewatch every other week! :D

  • @LuisRuizHalo
    @LuisRuizHalo 3 года назад +1

    I’ve been following you since earlier this year. Still amazed by your content. Thank you!

  • @driden1987
    @driden1987 Год назад

    What a great video, the amount of info in this one is awesome.
    Congratulations and thank you for posting it!

  • @b7otato
    @b7otato Год назад

    Underrated channel.

  • @willl0014
    @willl0014 Год назад

    This is golden knowledge destilled!

  • @jameshickey84
    @jameshickey84 3 года назад

    Great overview Derek!

  • @guydan-guri2204
    @guydan-guri2204 3 года назад

    Thanks! really helpful

  • @ndev92
    @ndev92 Месяц назад

    How do you implement the outbox pattern with Event Store DB? In EF Core, the DbContext acts as a unit of work, but in Event Store DB, events are saved as streams. Do you append outbox messages to the same stream in the same transaction? And then, do you use strategies like snapshotting or stream truncation to manage the stream over time?

    • @CodeOpinion
      @CodeOpinion  Месяц назад

      You don't need an outbox because you're point of truth is the event store that's already storing events. Typically you wouldn't publish those events directly but rather transform them into something more meaningful for consumers. Events for persistence (event sourcing) aren't the same events for communication.

  • @saranshd.3347
    @saranshd.3347 Год назад +1

    I have a questions regarding the outbox pattern. If the publisher is constantly checking for new messages stored in the database, wouldn't it become similar to polling as in a request/response system? What would be the benefit of event driven architecture there?
    Very informative video btw.

    • @CodeOpinion
      @CodeOpinion  Год назад

      Depends how the publisher is implemented. You're still using the publish/subscribe pattern and processing events asynchronously. Check out this video specifically on the outbox pattern. ruclips.net/video/u8fOnxAxKHk/видео.html

  • @jppatter92
    @jppatter92 3 года назад

    Fantastic summary video and your separate videos on each topic have all been very helpful.
    What are your thoughts on MassTransits implementation of the outbox pattern being in memory only? Is it a viable solution for this problem?

    • @CodeOpinion
      @CodeOpinion  3 года назад

      I guess it depends on if you want it to be durable or not. If the process crashes and you have events that weren't published to the Broker, how big of an issue is that for your system? If its not, then it's fine. If it's a serious issue that you miss publishing events, then I guess that answers that!

  • @dennismatveyev9794
    @dennismatveyev9794 Год назад

    could you pls tell how is the consumer supposed to be reading from some storage when we have inbox pattern ? thank you!

  • @ryanelfman3520
    @ryanelfman3520 3 года назад +2

    The inbox/outbox pattern seems very chatty. Have you ever run into perf/scalability issues with this? It seems a bit redundant writing the message to the database as well as the broker, but I get why (at least once delivery). Why not write to the broker and the consumer then writes the state to the database after the message has been picked up?

    • @ЕвгенийМальцев-ш6в
      @ЕвгенийМальцев-ш6в 3 года назад

      Imho, most often there is no need for outbox pattern. But in some cases (finance systems for example) we need to meet the requirements of fault tolerance: make atomic(!) operation "save to db" + "publish to broker". This is where the outbox comes to the rescue.

    • @CodeOpinion
      @CodeOpinion  3 года назад +1

      Yes, it really depends if you can afford to "lose" publishing a message when a state change occurs.

  • @prasadhkumarjadhav4066
    @prasadhkumarjadhav4066 3 года назад +1

    Hey Derek first of all thanks for all your efforts i enjoy your videos content. I request an clarification from you. I would like hear from you about how to design asynchronous microservice system, a little direction about what patterns or tools are involved would help, for e.g how does. An ecommerce system does order processing there should be lot of large background procesing involved like user order validation, inventory checks, logistics processes all happening together when we simply click on place order ...how does one design an microservice system which involves large background processings

    • @CodeOpinion
      @CodeOpinion  3 года назад

      Event choreography or orchestration is probably the place to start looking at. ruclips.net/video/rO9BXsl4AMQ/видео.html

    • @prasadhkumarjadhav4066
      @prasadhkumarjadhav4066 3 года назад

      @@CodeOpinion wow didnt expect reply in an instant 😃,huge thanks will check on it right away 👍

  • @Ukyron
    @Ukyron 3 года назад

    Amazing channel.

  • @imranhussain8700
    @imranhussain8700 3 года назад

    Thank you vey much for posting an amazing content and most importantly to the point and with demo.
    I am watching your videos for coupe of weeks now, I am really enjoying.
    One question, on Outbox and Inbox pattern. Sine we are introducing Database (to store and check duplicate messages), I guess
    there will be an impact on throughput?
    since consumer need to check the MessageId in same transaction, our business logic will have dependency on the messaging system?
    Thanks

    • @CodeOpinion
      @CodeOpinion  3 года назад +1

      Correct, you're going to put more load on your database. I don't necessarily think you always need to use the outbox unless you absolutely need reliability of sending out a message. Same goes for the inbox if trying to create idempotent consumers. Some messages are naturally idempotent and you don't need to know if you processed it already.

  • @mayureshs80
    @mayureshs80 3 года назад +1

    Informative video! Are there any recommended messaging libraries that provide such patterns.

    • @CodeOpinion
      @CodeOpinion  3 года назад +1

      What platform/language are you on? If you're in .NET: NServiceBus, MassTransit, Brighter.

    • @Keptains
      @Keptains 3 года назад

      @@CodeOpinion Loved this Video, thanks alot! Any suggestions/recomendations for Java maybe? Or does MQ maybe makes sense together with Java or am i missunderstanding something

  • @penaplaster
    @penaplaster Год назад

    Does it make sense to have an “inbox” component for each service that will ingest incoming messages, deduplicate those and pass to consumers in the service?
    Or perhaps this job can be done by a middleware that is called before executing a message handler. Also, can a sidecar be a deduplicator?

    • @CodeOpinion
      @CodeOpinion  Год назад +1

      I've found making your consumers be idempotent is key. You can do this a variety of ways, one of them being an inbox. However, some consumers are naturally idempotent and others you can keep track of a message ID (or something similar) to identify which messages you've processed. How you do that depends on if you're processing messages concurrently.

    • @penaplaster
      @penaplaster Год назад

      @@CodeOpinion Thanks for the reply. Also thanks a lot for great videos. Your channel is one of the best channels on the topic.

  • @MerrionGT6
    @MerrionGT6 3 года назад +1

    Orchestration example and the Saga pattern seem very similar - is there a difference between them?

    • @CodeOpinion
      @CodeOpinion  3 года назад +1

      I'm more and more hesitant to use the term "Saga" and "Process Manager" because folks have very similar definitions between the two.

  • @ilyahryapko
    @ilyahryapko 3 года назад

    Hey! Cool video! Could you please make video comparison of popular dotnet libraries for messaging? CAP, Brighter, Rebus, Masstransit, NServiceBus, MediatR (joking). I want to start my own pet project with ES but I'm struggling to choose.
    Also for the guys here. What's the purpose of Kafka, do I need separate event persistence technology with that? or this is RabbitMQ and EventstoreDB combined?
    I only know mediatr and its send/publish scheme of working, is the only difference between this and mentioned before libraries is out process handling? I also quite fear manually serializing and deserializing of my querries and commands and sending them through some sort of message bus, is it normal?

    • @CodeOpinion
      @CodeOpinion  3 года назад +1

      They all support various levels of features so it really comes down to reading the docs and seeing which features you absolutely require and if it supports it. If it doesn't, does it have extensibility for you to support it yourself (if you choose). Check out this post on the differences between Kafka and EventStoreDB domaincentric.net/blog/eventstoredb-vs-kafka

  • @ayushgorya1940
    @ayushgorya1940 3 года назад +1

    In outbox pattern, what if the database is not responding then we have the same issue as broker not available ,right?

    • @CodeOpinion
      @CodeOpinion  3 года назад +1

      Well if the database isn't available when you initially persist your state and message, then nothings happening anyways. There would be no reason to publish an event if nothing happened (state change).

  • @kopiking352
    @kopiking352 3 года назад

    clear

  • @lucianothomagini231
    @lucianothomagini231 2 года назад

    Have you sny recomendation for C# MediatR to make the Publish(INotification) with some Kafka or RabbitMQ final implementation? I search over your Channel but the near thing was HangFire, but It is not enough cause we are trying implement EDA over the services

    • @CodeOpinion
      @CodeOpinion  2 года назад +1

      MediatR is intended to be in-process. If you want to move out of process, look towards something like Brighter, NServiceBus, MassTransit.

  • @Ukyron
    @Ukyron 3 года назад

    Question about event driven applications: Do you storage your events as JSON or do you minify it to reduce its size? do you have any video about it?

    • @CodeOpinion
      @CodeOpinion  3 года назад +2

      Don't have any video related but that will often be related to some abstraction or library handling that for you generally. But to answer yes, JSON usually for me.

  • @MrSpyTubes
    @MrSpyTubes 2 года назад

    Would you suggest some messaging libraries?

    • @CodeOpinion
      @CodeOpinion  2 года назад

      In the .NET Space, NServiceBus, MassTransit, Brighter.

  • @GavSaysPogMoThoin
    @GavSaysPogMoThoin 2 года назад

    Great video as always Derek.
    I'm a fan of the orchestration pattern; what tech have you used yourself to implement this? All bespoke or any tech in particular?
    Others have mentioned MassTransit in the comments. Its concept of Sagas is an implementation of the orchestrator patten, particularly suited to long-running transactions. I've not used it myself but it looks like a great option. Keen to hear your thoughts. Cheers.

    • @CodeOpinion
      @CodeOpinion  2 года назад +1

      Yes in the .NET Space, MassTransit and NServiceBus Sagas come to mind. Also, something like Temporal.io I want to jump into more.

  • @SL-1701
    @SL-1701 3 года назад

    The captions are really messed up for this video, can you please check them out and fix? I need them to watch content. Thanks

    • @CodeOpinion
      @CodeOpinion  3 года назад +1

      Apologies, unfortunately they are generated by RUclips. I'll see what I can do to get them fixed.

    • @SL-1701
      @SL-1701 3 года назад

      @@CodeOpinion you can manually edit them. I’d consider getting another program to generate updated captions and then edit those in.