{"id":613532,"date":"2023-03-02T08:49:24","date_gmt":"2023-03-02T14:49:24","guid":{"rendered":"https:\/\/news.sellorbuyhomefast.com\/index.php\/2023\/03\/02\/dont-let-event-driven-architecture-buzzwords-fool-you\/"},"modified":"2023-03-02T08:49:24","modified_gmt":"2023-03-02T14:49:24","slug":"dont-let-event-driven-architecture-buzzwords-fool-you","status":"publish","type":"post","link":"https:\/\/newsycanuse.com\/index.php\/2023\/03\/02\/dont-let-event-driven-architecture-buzzwords-fool-you\/","title":{"rendered":"Don&#x27;t let Event-Driven Architecture buzzwords fool you"},"content":{"rendered":"<div>\n<p><span><br \/>\n      <a href=\"http:\/\/event-driven.io\/static\/4335effe772a6a8306330ad60ff10809\/5a190\/2023-02-26-cover.png\" target=\"_blank\" rel=\"noopener\"><br \/>\n    <span><\/span><br \/>\n  <img alt=\"cover\" title=\"cover\" src=\"http:\/\/event-driven.io\/static\/4335effe772a6a8306330ad60ff10809\/5a190\/2023-02-26-cover.png\" srcset=\"\/static\/4335effe772a6a8306330ad60ff10809\/772e8\/2023-02-26-cover.png 200w,\n\/static\/4335effe772a6a8306330ad60ff10809\/e17e5\/2023-02-26-cover.png 400w,\n\/static\/4335effe772a6a8306330ad60ff10809\/5a190\/2023-02-26-cover.png 800w\"  loading=\"lazy\" decoding=\"async\"><br \/>\n  <\/a><br \/>\n    <\/span><\/p>\n<p><strong>I see a lot of new terms like <a href=\"https:\/\/web.archive.org\/web\/20220816202019\/https:\/\/developer.confluent.io\/patterns\/event\/command-event\/\">Command-Event<\/a>, <a href=\"https:\/\/www.alexdebrie.com\/posts\/event-driven-vs-event-based\/\">Event-Based Compute<\/a>, etc., presented around Event-Driven Architecture. Let me clear that up because there are no such things.<\/strong><\/p>\n<p>The real split is Event-Driven Architecture vs Messaging.<\/p>\n<p><strong>Event-Driven Architecture (<em>EDA<\/em>) is about the logical composition of our workflow.<\/strong> We\u2019re using events as the glue checkpoints of our workflow.<\/p>\n<p>Contrary to the traditional approach, we focus on verbs instead of nouns. So behaviours in our systems, interactions between them, reactions about new information and data in motion.<\/p>\n<p><strong>Events are excellent workflow facilitators.<\/strong> They represent facts on what has happened. We\u2019re inverting the classical flow; instead of requesting everything, we\u2019re notifying all interested parties. Then others can react and publish new information through events. <a href=\"http:\/\/event-driven.io\/en\/how_events_can_help_on_making_state_based_approach_efficient\/\">That helps to build decoupled and autonomous components<\/a>.<\/p>\n<p><strong>Events are messages, but they\u2019re not the only message type. The second most important is <em>command<\/em>. They differ by intention.<\/strong> I wrote about it longer in <a href=\"http:\/\/event-driven.io\/en\/whats_the_difference_between_event_and_command\/\">What\u2019s the difference between a command and an event?<\/a>. TLDR:<\/p>\n<p>A command is an intent to do something. It\u2019s directed, and the handler may reject it.<\/p>\n<p>Events are facts; they can (and should) have multiple receivers. Yet, the event producers shouldn\u2019t assume getting a response.<\/p>\n<p><strong>Understanding this split is essential for proper workflow composition.<\/strong> As much as we\u2019d like our flow to be fire and forget, sometimes we need to have an explicit request to do something. Suppose we model workflow so that we always expect a particular event back as a follow-up. Is our event really broadcasted information or just an implicit command?<\/p>\n<p><strong>Events and commands do not differ by definition in terms of how they\u2019re delivered, whether synchronous or asynchronous.<\/strong> The difference is in intention. The event doesn\u2019t have to be asynchronous or use tooling like Kafka, Rabbit, SQS, etc. It\u2019s about the composition of our flows, modelling conversation and structuring our architecture. It\u2019s close to the <a href=\"https:\/\/wiki.c2.com\/?AlanKaysDefinitionOfObjectOriented\">original Alan Kay\u2019s definition of Object Oriented Programming<\/a>.<\/p>\n<p><strong>Now, here we got to Messaging.<\/strong> It\u2019s a set of patterns like Outbox, Inbox, Competing Consumers etc., focused on integration between our boundaries (modules, services etc.).<\/p>\n<p><strong>EDA and Messaging are different design perspectives.<\/strong> With EDA, you\u2019re shaping your application\u2019s conceptual\/logical split, interactions, and how the flow looks.<\/p>\n<p>Knowing what we\u2019d like to achieve, we can go one layer down and define how to do it. For instance, how to achieve guarantees like at-least-once delivery, strict ordering, and idempotent handlers. That\u2019s Messaging; it tells how to handle communication efficiently and is part of the solution space. Yet it\u2019s still agnostic to a specific technical solution. We should select the messaging tooling based on the design and whether it supports the Messaging patterns we have chosen to fulfil it.<\/p>\n<p><strong>The design flow should look like this:<\/strong><\/p>\n<ol>\n<li><strong>WHAT?<\/strong> Describe the business workflow and model it using Event-Driven Architecture. That includes communication flow between components, boundaries, etc. Great tools for that are <a href=\"https:\/\/www.eventstorming.com\/\">EventStorming<\/a> and <a href=\"https:\/\/eventmodeling.org\">Event Modeling<\/a>.<\/li>\n<li><strong>HOW?<\/strong> Design how to get guarantees and define the expected technical flow using Messaging patterns. They\u2019re already established; no need to reinvent the wheel. Gregor Hohpe curated most of them in <a href=\"https:\/\/www.goodreads.com\/book\/show\/85012.Enterprise_Integration_Patterns\">Enterprise Integration Patterns: Designing, Building, and Deploying Messaging Solutions<\/a> 20 years ago.<\/li>\n<li><strong>WITH.<\/strong> Select messaging toolings like RabbitMQ, Kafka, SQS or others that match your requirements. As you see, this is the last phase and outcome of the previous steps.<\/li>\n<\/ol>\n<p><strong>Please do not mix them, or you\u2019ll end up with a hangover!<\/strong><\/p>\n<p>If we flatten all that into a single perspective, we won\u2019t be able to do a proper design. Without shaping the proper APIs based on intentions, we\u2019ll end up with synchronous, direct communication but made implicitly in an asynchronous way. It is a nightmare to run on production as it\u2019s hard to trace the processes and reason what and why went wrong. That usually ends up as distributed monolith. It\u2019s a dark place with all cons of monolith and microservices but no pros.<\/p>\n<p><strong>Still not convinced? Let\u2019s get back to asynchronous commands, then.<\/strong><\/p>\n<p>Some people claim that they\u2019re not commands then but events. In my world, how we send commands between modules is part of technical design, so choosing our messaging patterns, tech stack and protocols.<\/p>\n<p>If we\u2019re okay with in-proc handling, we can just use in-memory processing and call it a day.<\/p>\n<p>If we have a distributed system (e.g., service-oriented architecture, Kubernetes, multiple instances for scaling needs, etc.), we may need better delivery guarantees to ensure that our state is consistent. We may need <a href=\"http:\/\/event-driven.io\/en\/outbox_inbox_patterns_and_delivery_guarantees_explained\/\">Outbox Pattern<\/a> or use a durable messaging queue.<\/p>\n<p><strong>Still, that choice doesn\u2019t change the message semantics; the intention remains the same.<\/strong> We can use <a href=\"https:\/\/www.enterpriseintegrationpatterns.com\/patterns\/messaging\/RequestReply.html\">Request\/Reply pattern<\/a> to get the result of the processing. All of the mature messaging toolings like <a href=\"https:\/\/wolverine.netlify.app\/guide\/messaging\/message-bus.html#request-reply\">Wolverine<\/a>, <a href=\"https:\/\/docs.nats.io\/using-nats\/developer\/sending\/request_reply\">NATS JetStream<\/a> or <a href=\"https:\/\/docs.particular.net\/nservicebus\/messaging\/reply-to-a-message\">NServiceBus<\/a> provide that out of the box.<\/p>\n<p><strong>So why we\u2019re getting terms like Command-Event, and Event-Based Compute?<\/strong> Because some companies were pushing the EDA buzzwords, Messaging didn\u2019t sound sexy enough.<\/p>\n<p>They didn\u2019t embrace semantics or teach their users existing patterns because the tooling didn\u2019t support them out of the box. But that doesn\u2019t change the fact that, eventually, their users need to understand that to succeed.<\/p>\n<p>Yet, if companies pushed all marketing into event-based terms ignoring existing patterns, how to tell now that they were wrong?<\/p>\n<p><strong>The easiest is to reinvent the wheel and introduce new gibberish terms.<\/strong><\/p>\n<p><strong>Curtain.<\/strong><\/p>\n<p>So, as architects, developers, we should remember to differentiate patterns from implementations. Be critical of what we read.<\/p>\n<p>That\u2019s why I want to highlight how it\u2019s important to break our design into multiple layers:<\/p>\n<ul>\n<li>logical,<\/li>\n<li>technical,<\/li>\n<li>implementation.<\/li>\n<\/ul>\n<p>That also plays well with tools like <a href=\"https:\/\/www.eventstorming.com\/\">EventStorming<\/a>, <a href=\"https:\/\/eventmodeling.org\">Event Modeling<\/a> and the <a href=\"https:\/\/c4model.com\/\">C4 Model<\/a>. All of them embrace that we have and should be able to zoom in and out.<\/p>\n<p>I know that it sounds like 4D Chess, but that\u2019s our role. We need to train our abstract and critical thinking, as <a href=\"http:\/\/event-driven.io\/en\/the_magic_is_that_there_is_no_magic\/\">the magic is that there\u2019s no magic<\/a>.<\/p>\n<p><strong>Don\u2019t let the buzzwords and marketing fool you. Think for yourself, and question authorities.<\/strong><\/p>\n<p>Cheers!<\/p>\n<p>Oskar<\/p>\n<p>p.s. <strong>Ukraine is still under brutal Russian invasion. A lot of Ukrainian people are hurt, without shelter and need help.<\/strong> You can help in various ways, for instance, directly helping refugees, spreading awareness, putting pressure on your local government or companies. You can also support Ukraine by donating e.g. to <a href=\"https:\/\/www.icrc.org\/en\/donate\/ukraine\">Red Cross<\/a>, <a href=\"https:\/\/savelife.in.ua\/en\/donate\/\">Ukraine humanitarian organisation<\/a> or <a href=\"https:\/\/www.gofundme.com\/f\/help-to-save-the-lives-of-civilians-in-a-war-zone\">donate Ambulances for Ukraine<\/a>.<\/p>\n<\/div>\n<p><a href=\"https:\/\/event-driven.io\/en\/dont_let_event_driven_architecture_buzzwords_fool_you\/\" class=\"button purchase\" rel=\"nofollow noopener\" target=\"_blank\">Read More<\/a><br \/>\n Arden Ramage<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I see a lot of new terms like Command-Event, Event-Based Compute, etc., presented around Event-Driven Architecture. Let me clear that up because there are no such things. The real split is Event-Driven Architecture vs Messaging. Event-Driven Architecture (EDA) is about the logical composition of our workflow. We\u2019re using events as the glue checkpoints of our<\/p>\n","protected":false},"author":1,"featured_media":613533,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[640,102360,46],"tags":[],"class_list":{"0":"post-613532","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-dont","8":"category-event-driven","9":"category-technology"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/posts\/613532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/comments?post=613532"}],"version-history":[{"count":0,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/posts\/613532\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/media\/613533"}],"wp:attachment":[{"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/media?parent=613532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/categories?post=613532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/newsycanuse.com\/index.php\/wp-json\/wp\/v2\/tags?post=613532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}