{
    "componentChunkName": "component---src-pages-blog-post-tsx",
    "path": "/blog/2021-02-09/event-driven-architecture",
    "result": {"data":{"site":{"siteMetadata":{"siteUrl":"https://www.architect.io"}},"allMdx":{"edges":[{"node":{"body":"var _excluded = [\"components\"];\n\nfunction _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\n/* @jsxRuntime classic */\n\n/* @jsx mdx */\nvar _frontmatter = {\n  \"title\": \"What the Heck is Event-Driven Architecture?\",\n  \"description\": \"Prevent APIs from wreaking havoc by preparing your application for failure with event-driven architecture\",\n  \"keywords\": \"event driven architecture\",\n  \"slug\": \"event-driven-architecture\",\n  \"date\": \"2021-02-09T00:00:00.000Z\",\n  \"author\": \"David Thor\",\n  \"image\": \"./featured-image.png\"\n};\nvar layoutProps = {\n  _frontmatter: _frontmatter\n};\nvar MDXLayout = \"wrapper\";\nreturn function MDXContent(_ref) {\n  var components = _ref.components,\n      props = _objectWithoutProperties(_ref, _excluded);\n\n  return mdx(MDXLayout, _extends({}, layoutProps, props, {\n    components: components,\n    mdxType: \"MDXLayout\"\n  }), mdx(\"p\", null, \"Applications have quickly become complex webs of interconnected microservices. Failures in the API\\ncalls between microservices grow more common and far more dastardly \\u2013 wreaking havoc throughout\\napplications in unforeseen ways. Accidents and errors can happen even with the most brilliant\\nengineers and most controlled environments in the world. Unfortunately, this means that outright\\nelimination of API call failures is not an option. Instead, we have to prepare our applications for\\nfailure, and this is where event-driven architecture comes into play.\"), mdx(\"p\", null, \"If you\\u2019ve worked with or researched microservices in the last decade, chances are you\\u2019ve heard of\\nand probably implemented event-driven architecture. The pattern has become extraordinarily popular\\namongst cloud-native and distributed teams in recent years as it solves some very real problems with\\nfault tolerance, availability, and coupling of microservices. Instead of communicating directly with\\none another through API calls, services publish and subscribe to events. In doing so, both the\\npublisher and subscriber can exist and perform their work regardless of the other\\u2019s availability,\\nthus achieving the fault tolerance needed for the application to support a growing number of users.\"), mdx(\"p\", null, \"This all sounds like a nice silver bullet on the surface, but what even is an event, and do you\\nleverage event-driven design in an application? In this article, I\\u2019ll discuss the different uses of\\nevents, the various technologies and practices that can broker events, and the risks involved with\\nevent-driven architecture. I\\u2019ll even debunk a few myths about event-driven design to boot!\"), mdx(\"h2\", {\n    \"id\": \"types-of-events\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Types of events\", mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#types-of-events\",\n    \"aria-label\": \"types of events permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"Events are used to communicate with other applications and services \\u2013 it\\u2019s that simple. There\\u2019s a\\nlot of thought that can go into which events you publish, who subscribes to them, and what contents\\ngo inside the event, but none of that matters when it comes to describing what an event is and what\\nit can be used for. What matters is whether or not your event needs a response. Is your event just\\nmiscellaneous information that you\\u2019re making available for other applications to do whatever they\\nwant with, or are you using your event to request additional information from a peer app or service?\"), mdx(\"h3\", {\n    \"id\": \"broadcast-notifications\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Broadcast notifications\", mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#broadcast-notifications\",\n    \"aria-label\": \"broadcast notifications permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"For those of you who still watch live TV, you\\u2019re probably aware of the fact that others can tune\\ninto and out of the same channel as you at the same time, and they\\u2019ll see the same content you do.\\nIn fact, the content doesn\\u2019t change, no matter how many people tune in or out of the channel.\\nWhether a hundred or a million people are watching, your favorite sportscaster is still going to be\\nsaying the same thing to everyone who tunes in.\"), mdx(\"p\", null, \"Broadcast application events work the same way as broadcast media \\u2013 the event gets published by a\\nsingle entity but can be received by unlimited subscribers. Since the publisher isn\\u2019t expecting any\\nkind of response from subscribers, they can continue their broadcast regardless of the number of\\nviewers on the other end.\"), mdx(\"p\", null, mdx(\"span\", {\n    parentName: \"p\",\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1000px\"\n    }\n  }, \"\\n      \", mdx(\"a\", {\n    parentName: \"span\",\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/ab68b26f520b2c16b77aa4a05695f607/d6a46/broadcast-event.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }, \"\\n    \", mdx(\"span\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"78.4%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAQCAYAAAAWGF8bAAAACXBIWXMAAAsTAAALEwEAmpwYAAACm0lEQVQ4y62U3UtTcRjHnyS66KqLSK0VCF11kbcRvXhhl/UfdFOQXRhJpBtqlGWpYEnh5oWyqZRhooT5NmvWNrfj8TidLZ2uzXPO3s7rJroktekT5+gUQ2VCB778eODHB57z/f6+APt82iq9qoc1BigzvjvUiAglLsexcjdxRjtqO6Wj7BrtqE1TNu7UlLtHThdS1iOQDrCqol6dHTM+6A7TBqfEIRkXf5ExcZmMi8ukLCxZhQg2+aevpAUsrjEcfvrGdO7Sjds5A0G6bUzgsNvlWjFP/Uj2ut1JB0uvuuIitga8eZDdaVJ1ssu4cXYat+bC2gbQVhsUZVbWN59FROgLM+2ULCDBhXGEjyDBR5CSeCQkDk0B7zUgJR4QMWM3jU37Mp68bARdtSHr0avGTNPgV2gJeK92h+miXi54pyfK3lUVYQo6g4HCOq87G0hZBe6pCzfvQckLfVbx8/os5Td8T8yDvPIbEoiwsL4Gi7gGC2t/ILyUgI+hOYAGn+e8Ocpav4nRfntcMNtjgtkqcX0WLkR0sP6iDpsTKg2tx5/pW068H7JDB+t/MMSHqeG4MGiTeYs9JlhsEvfZHA06GnyeXGWFfComIsVH8cvsDA799KEjyKB7Xsb+4Fw7AGQ8rmu6XPHamAsARwdCzIcxiVfvWuf86n1niEUqJiim5O8AWnyzaQBpFWhJAf3/ALdXjvyflQ9qikc1ZRkSuA6LW6Ykt03ZBB4oNp8izP1ejt2OTZQp6ErFJrvLtKf2CjYpckhwG6FWzlFlljhsVoJ9kKd38fqtHHOIaRtmaeyZmFgZ8HiSfZOTSVvAv6q8nrf0bN6+QF21HnS7lAMh8zvLIZYqh6n0yiFVX02b9VU67thRX6Uuh6bMTaj19RcvKs+ww8D/NgAAAABJRU5ErkJggg==')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  }), \"\\n  \", mdx(\"img\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"broadcast notifications\",\n    \"title\": \"broadcast notifications\",\n    \"src\": \"/static/ab68b26f520b2c16b77aa4a05695f607/00d43/broadcast-event.png\",\n    \"srcSet\": [\"/static/ab68b26f520b2c16b77aa4a05695f607/63868/broadcast-event.png 250w\", \"/static/ab68b26f520b2c16b77aa4a05695f607/0b533/broadcast-event.png 500w\", \"/static/ab68b26f520b2c16b77aa4a05695f607/00d43/broadcast-event.png 1000w\", \"/static/ab68b26f520b2c16b77aa4a05695f607/d6a46/broadcast-event.png 1008w\"],\n    \"sizes\": \"(max-width: 1000px) 100vw, 1000px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\",\n    \"decoding\": \"async\"\n  }), \"\\n  \"), \"\\n    \")), mdx(\"p\", null, \"Broadcast events play a critical role in distributed applications, especially for core services like\\nidentity management and payments services. These services use events to communicate with the rest of\\nthe application whenever actions are taken, or important state changes are made. A reporting service\\nmay want to forecast new financial projections whenever payments are processed, or a shipping\\nservice may wish to change delivery targets whenever a user updates their primary residence. The\\nidentity and payments services don\\u2019t care what others do with the information, but they know that\\nother services may want to tune in for updates to act on critical information for themselves.\"), mdx(\"h3\", {\n    \"id\": \"actionresponse-events\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Action/Response events\", mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#actionresponse-events\",\n    \"aria-label\": \"actionresponse events permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"Broadcast events are great when we don\\u2019t care who the subscribers are or what they intend to do with\\nthe event information, but they don\\u2019t help us make regular API calls more fault-tolerant, as\\ndescribed earlier. Many direct API calls not only know which service it is being made to, but the\\nresponse from the service they are connecting to is of great importance. Maybe we need to check the\\nidentity service to make sure the user has 2FA enabled before they can wire money, or maybe we need\\nto query the product catalog for the latest prices before adding an item to the shopping cart. These\\nare pervasive and intuitive thoughts and workflows for developers and applications, but how would a\\ndeveloper go about instrumenting this flow using event-driven architecture?\"), mdx(\"p\", null, \"The answer lies with\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://martinfowler.com/bliki/CQRS.html\"\n  }, \"Command Query Responsibility Segregation (CQRS)\"), \" \\u2013 a\\npattern involving the separation of workflows and data structures for reading and writing\\ninformation respectively. Instead of relying on a single event, which is limited to sharing\\ninformation from publisher to subscriber, developers would use two events to replicate their API\\ncalls using event-driven design: one for the upstream service to trigger an action and another for\\nthe downstream service to respond. As long as the downstream knows the name of the action event and\\nthe upstream knows the name of the response event, they can subscribe to each other to fulfill the\\nbi-directional request.\"), mdx(\"p\", null, mdx(\"span\", {\n    parentName: \"p\",\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1000px\"\n    }\n  }, \"\\n      \", mdx(\"a\", {\n    parentName: \"span\",\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/acc344342b4ec3aec57e790d76451f20/e9d87/action-response-event.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }, \"\\n    \", mdx(\"span\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"23.2%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAFCAYAAABFA8wzAAAACXBIWXMAAAsTAAALEwEAmpwYAAABlklEQVQY02NIObFPKv3kfpk0JJxycr90+qKlXJUNEzidwpJYVIwdmGW0LZgj86pY6+smcqRuWs+fcmq/TPqpA2D1UFo28fgeMYajr54/P/3m5fdTb15+OvXm5efTb15+PfHmxcfO/fvdc3IapewDY2XUzZzllY3sJcIyS+TCA7LFF184X3Xy7cs/p16/AOsB0affvPyz5/njkwxn373+fvLp4/97blz/v+/Wzf/Hnzz6f+7d6//THt7Q79m4jQEEVIwdGOT1rMHs+YeOMmx++iDt/PvX/w/fv/t/17WrYL3nXr/4f+jVs+sMx14/f3Xq9Yufx18++3ri5bNvp149/3Hy7ctPHbt2B2Rm18uZugdLa5i7SKqaOMgFpOTL+TrFiyy7drnoxJuX/0++ev7l+Iun346/fPblzJuX//c8f3yaoer8caX6y6dUm66dU2m6dlal4fJp1eqLJ5Rzl67gq6qbwKnv5MemYe7CrmriyOEamcpRU9bNXrhnh1D1xROqDVdOqzRfP6fSeO2sSt3Fk2pl547KAgAHA+fGXyH3RAAAAABJRU5ErkJggg==')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  }), \"\\n  \", mdx(\"img\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"action/response notifications\",\n    \"title\": \"action/response notifications\",\n    \"src\": \"/static/acc344342b4ec3aec57e790d76451f20/00d43/action-response-event.png\",\n    \"srcSet\": [\"/static/acc344342b4ec3aec57e790d76451f20/63868/action-response-event.png 250w\", \"/static/acc344342b4ec3aec57e790d76451f20/0b533/action-response-event.png 500w\", \"/static/acc344342b4ec3aec57e790d76451f20/00d43/action-response-event.png 1000w\", \"/static/acc344342b4ec3aec57e790d76451f20/e9d87/action-response-event.png 1176w\"],\n    \"sizes\": \"(max-width: 1000px) 100vw, 1000px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\",\n    \"decoding\": \"async\"\n  }), \"\\n  \"), \"\\n    \")), mdx(\"p\", null, \"This action/response event style has become increasingly popular in recent years. It allows\\ndevelopers to replace API call flows with near-identical event-driven flows, but swapping to events\\noutright comes with its own set of hurdles. With direct API calls, developers get to store\\napplication state in memory while they await a response from the downstream API. Events, on the\\nother hand, require state to be stored and accessible in a more persistent manner. With events,\\nthere\\u2019s no guarantee that the same instance that published the action event will receive the\\nresponse event. As a result, event-driven architectures often demand more thought around session\\nmanagement and persistence to maintain state between action/response events.\"), mdx(\"h2\", {\n    \"id\": \"event-driven-application-brokers\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Event-driven application brokers\", mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#event-driven-application-brokers\",\n    \"aria-label\": \"event driven application brokers permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"We\\u2019ve talked a lot about how events make applications fault-tolerant since they don\\u2019t have to wait\\nfor subscribers, but how does that functionally work? What magic is it that allows these events to\\n\\u201Ccomplete\\u201D even when the subscribers are down or otherwise unavailable? The answer is surprisingly\\nsimple \\u2013 events get stored in a database.\"), mdx(\"p\", null, \"Yes, you really can store your events in just about anything that can persist the events. It\\u2019s the\\nfact that the events are persisted that enables fault-tolerance. If a subscriber isn\\u2019t ready for the\\nevent just yet, either because it's busy handling another event or it crashed, the event remains in\\nthe database until the subscriber comes back up.\"), mdx(\"p\", null, \"This database could be something as raw as the filesystem, or you can dump them right into a MySQL\\nor PostgreSQL database you already have available. That said, there is an abundance of database\\nsoftware explicitly designed to handle events. These database solutions are often referred to as\\nbrokers due to the way they mediate the relationship between event publishers and subscribers. There\\nare several different brands and solutions you can select, but before you dive right into the brands\\nthemselves, you\\u2019ll need to decide which brokering style is best for your application:\"), mdx(\"h3\", {\n    \"id\": \"queue-backed-brokers\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Queue-backed brokers\", mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#queue-backed-brokers\",\n    \"aria-label\": \"queue backed brokers permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"If you\\u2019ve done any research into event-driven architecture, you\\u2019ve probably also heard of the word\\n\\u201Cmessage queue.\\u201D Message queues are one of the two ways that event brokers can store and enable\\nsubscription to published events. Publishers simply write their event to a queue, and a subscriber\\ncan pop the events off of said queue when it's ready to be processed. Action/response events are\\nstraightforward to operate and integrate with: events don\\u2019t stay on the queue forever, which means\\nthat the database can remain generally small, and integration with it is relatively intuitive to\\ndevelopers who already understand the concept of a queue.\"), mdx(\"p\", null, \"The downside of queue-backed brokers, however, is that multiple subscribers can\\u2019t consume messages.\\nOnce a subscriber claims a message from a queue, the message is gone and unable to be consumed by a\\ndifferent subscriber. This means that to distribute a notification to multiple subscribers, a\\npublisher has to write the message to multiple queues \\u2013 one for each subscriber.\"), mdx(\"p\", null, \"Fortunately, this isn\\u2019t as difficult as it sounds with modern brokers. Some solutions, like\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.rabbitmq.com/\"\n  }, \"RabbitMQ\"), \", natively support the notion of\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://www.rabbitmq.com/tutorials/tutorial-five-python.html\"\n  }, \"topics\"), \" which allow you to publish\\nonce and have the broker handle the writing to multiple queues. Other solutions, like\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://aws.amazon.com/sqs/\"\n  }, \"AWS SQS\"), \", have sister services like \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://aws.amazon.com/sns/\"\n  }, \"SNS\"), \"\\nthat can connect to SQS to write to multiple queues as well.\"), mdx(\"p\", null, mdx(\"span\", {\n    parentName: \"p\",\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1000px\"\n    }\n  }, \"\\n      \", mdx(\"a\", {\n    parentName: \"span\",\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/925e83f2b946e32d5a547ae9f39affe3/1df5b/queue-backed-brokers.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }, \"\\n    \", mdx(\"span\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"32.4%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAGCAYAAADDl76dAAAACXBIWXMAAAsTAAALEwEAmpwYAAAByElEQVQY002RP2gTUQDGX4ibStFBBXERoeDkJoLuBYU6OGSom1q0qLjURexiwaXiJogOFVpFqYmlrebyt8lkB2Mw6Z3v3t17lzuvNb177957F7G5xJO0KB0++KYPft8PVNtuQlHXk0UEk2moJepNPRHH8SBgkF6/nwQAAMblfS7kZ8p4gQtZFjIsYeKeXMZosmKTxqpNmoVN+waotl2gqOugiCDI6BqoNeDOUNT/czaUcqePjN0d8mgwuuXTJ5ttb9rz2WOfBY++Q3I0g7SUYuovFIxeZl3rIlDc1ngOo48Fy1xZxCg1+/zd/t/b3bmw8yuOer2FbHXt1PFzo0OBCK/4LHjW9uiMR9lTxsUMQq1jaaRdzWE0n8Xo9YpDLoP8hj1ZtMx6ySZfl4hx7e2rxQPb3SjnUxZ3o6hSWaufBkfOHOSyc50G/INH2Rxl/E0g5LxF3BMZA07kiVnOWebqpx/W2B5kHaShBhqqsYvc61/692Nq4sEhxuUFLuQ9yvgtFojbIuzcrNXUw++RNpJv4YeKZUwtO/g82CtlAaoJFZL/QpqGM5Cxb1eKmGZcII+yLyzgdS7kN8f5Obxk6lNlYjoly3QLG/advx4QWgF48v75AAAAAElFTkSuQmCC')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  }), \"\\n  \", mdx(\"img\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"queue-backed brokers\",\n    \"title\": \"queue-backed brokers\",\n    \"src\": \"/static/925e83f2b946e32d5a547ae9f39affe3/00d43/queue-backed-brokers.png\",\n    \"srcSet\": [\"/static/925e83f2b946e32d5a547ae9f39affe3/63868/queue-backed-brokers.png 250w\", \"/static/925e83f2b946e32d5a547ae9f39affe3/0b533/queue-backed-brokers.png 500w\", \"/static/925e83f2b946e32d5a547ae9f39affe3/00d43/queue-backed-brokers.png 1000w\", \"/static/925e83f2b946e32d5a547ae9f39affe3/aa440/queue-backed-brokers.png 1500w\", \"/static/925e83f2b946e32d5a547ae9f39affe3/1df5b/queue-backed-brokers.png 1999w\"],\n    \"sizes\": \"(max-width: 1000px) 100vw, 1000px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\",\n    \"decoding\": \"async\"\n  }), \"\\n  \"), \"\\n    \")), mdx(\"h3\", {\n    \"id\": \"event-streams\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Event streams\", mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#event-streams\",\n    \"aria-label\": \"event streams permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"The competitive methodology for storing and subscribing to events is through a persistent event\\nstream, like that seen in \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://kafka.apache.org/\"\n  }, \"Apache Kafka\"), \". In this model, events are\\nstored permanently in an ordered list and are never popped off like a queuing system. This means\\nthat multiple subscribers can read the same message. It also means that it\\u2019s up to subscribers to\\nkeep track of which event was the last one they read in. Subscribers can join the stream at\\ndifferent times, reprocess historical events, and generally control their destiny. This can also\\nplace more responsibility on each subscriber, making it more difficult for developers to\\nrationalize.\"), mdx(\"p\", null, mdx(\"span\", {\n    parentName: \"p\",\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1000px\"\n    }\n  }, \"\\n      \", mdx(\"a\", {\n    parentName: \"span\",\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/43c184880d9bf4e7c32c3632874e9980/5a791/event-stream.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }, \"\\n    \", mdx(\"span\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"52.400000000000006%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAKCAYAAAC0VX7mAAAACXBIWXMAAAsTAAALEwEAmpwYAAACjElEQVQoz22Rz0sUYRjHH7NbQUXgKSrCQ4FBdIsORX+AUZAeJA8KQV4K6uISeOsguJVIVIIWaUah+ONi2KqpqIckCW0Zc3ZnZ3be2Xfe2dnfuzM777xPzLpdogc+PLcP3+/zwAd1H1Z0FTZTOmxSAhtGEhYNDU7KSyBppIGms2DauRZJVvrkhNYryUqIMjvkVr1Q2XFDFacaqrjV3nLF7cvkSxdgWP51fj6pzESIOvuVqNMRos7PafHBs5HPjYh4KJPJQ75Y7tZ0A4lBMaHpmMsXMBjfFyjEAb7vY6nidMCnZOzGmq5iZE/CBSmKa4k4rlDCesKvmp8+GznXfO1OkxRTH1NmIUmZVYMyTyMGVzSde5xzXwjP94XLuY/FstMGz6PbTVOa3DWbjHdPa7GuuWT83kdl79bFiZFDmCs3Oo4bJOxkaRuttM1Z2hbMskWwue+L+vB6wnYYj0nw3TZh22bwI23Cz4wFqyaBq+OjkCmUGrP5IuQKpU6DMjRSJjeoKYyUicEJOOdBXeELwesJ2+G9HIWtDINoOQ+7pRzsFrKwSglgyxNQU+xwqeLUhJSlkTKLmywtgvopk2Eg+ZuQ+3Vh/87WiYnE79Ypotyc1OOtk8n47bdy9DoefwSI2KARE4rlyl1m2cgsm5tWTSgMykTtgv8Kg6esEw1XYjIuy/u4riq4SnV6f/DN6f4Xo6fgzJVjckJ/GAgps6qUWV4N0/I8zj0hRIBbF7bBu7jUsqirywtx+duCIi8uacrGF5IY6Xw5fHRsbOYIIoKZzvYENal5QFA32PXKNerCjqDWf3kQfl3bO1IMsoXSZY3QIY2kBjSSCqu6Ed5X1HC54oadqhd23OpAxXGHsoXSpT/6AX455HHTEgAAAABJRU5ErkJggg==')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  }), \"\\n  \", mdx(\"img\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"event streams\",\n    \"title\": \"event streams\",\n    \"src\": \"/static/43c184880d9bf4e7c32c3632874e9980/00d43/event-stream.png\",\n    \"srcSet\": [\"/static/43c184880d9bf4e7c32c3632874e9980/63868/event-stream.png 250w\", \"/static/43c184880d9bf4e7c32c3632874e9980/0b533/event-stream.png 500w\", \"/static/43c184880d9bf4e7c32c3632874e9980/00d43/event-stream.png 1000w\", \"/static/43c184880d9bf4e7c32c3632874e9980/5a791/event-stream.png 1248w\"],\n    \"sizes\": \"(max-width: 1000px) 100vw, 1000px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\",\n    \"decoding\": \"async\"\n  }), \"\\n  \"), \"\\n    \")), mdx(\"h2\", {\n    \"id\": \"myths-about-event-driven-architecture\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Myths about event-driven architecture\", mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#myths-about-event-driven-architecture\",\n    \"aria-label\": \"myths about event driven architecture permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"Event-driven architecture is clearly a powerful way to protect distributed systems from inevitable\\nfailure. Still, there\\u2019s a lot of misunderstanding about what an event is and what value it provides\\nback to an application.\"), mdx(\"h3\", {\n    \"id\": \"event-driven-architecture-decouples-microservices\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Event-driven architecture decouples microservices\", mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#event-driven-architecture-decouples-microservices\",\n    \"aria-label\": \"event driven architecture decouples microservices permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"Developers are readily taught that event-driven architecture \\u201Cdecouples\\u201D microservices from one\\nanother, allowing each service to run separately from each other without crashing. While it\\u2019s true\\nthat these services can now run without crashing, is a subscriber of an event doing anything of\\nsubstance if the publisher isn\\u2019t running or isn\\u2019t available?\"), mdx(\"p\", null, mdx(\"span\", {\n    parentName: \"p\",\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1000px\"\n    }\n  }, \"\\n      \", mdx(\"a\", {\n    parentName: \"span\",\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/8cece0f5920e289e04aad6b868acd7a2/e9d87/decoupling-myth.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }, \"\\n    \", mdx(\"span\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"22.400000000000002%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA/UlEQVQY02N48+GzytfvP4q/fv+Z9/3nr/yv33/mfv3+o+zT1+/6uw+dZAABLUs3BnUzZzB7+tZdDEse3HTf8vRB6a43z3J3vn6at/Plk/xVD27nTb55iY/h89fvUf/+/fsPAr9+//4PY7/7+LmegYGB1TUwRlTbyp1Xw9xFwC0sQZCBQZZr99OHO8+8ev7/wN07/w/ev/v/+JNH/4+9fvF/yd3rykQZqGXpBjUwUZCBQQa/gW8/fNb89uNnw7cfP6t//Ppd8+3Hz6pvP362fPr63XT/sTMYXp61Yy/D8ge3ArY/e9S8583zqt2vn9XsfvW0Zu3DO9VTb10WAADTIMt8PFyy1QAAAABJRU5ErkJggg==')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  }), \"\\n  \", mdx(\"img\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"decoupling myth\",\n    \"title\": \"decoupling myth\",\n    \"src\": \"/static/8cece0f5920e289e04aad6b868acd7a2/00d43/decoupling-myth.png\",\n    \"srcSet\": [\"/static/8cece0f5920e289e04aad6b868acd7a2/63868/decoupling-myth.png 250w\", \"/static/8cece0f5920e289e04aad6b868acd7a2/0b533/decoupling-myth.png 500w\", \"/static/8cece0f5920e289e04aad6b868acd7a2/00d43/decoupling-myth.png 1000w\", \"/static/8cece0f5920e289e04aad6b868acd7a2/e9d87/decoupling-myth.png 1176w\"],\n    \"sizes\": \"(max-width: 1000px) 100vw, 1000px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\",\n    \"decoding\": \"async\"\n  }), \"\\n  \"), \"\\n    \")), mdx(\"p\", null, \"Without the events being published, a subscribing service is generally left idling, burning compute\\npower waiting for an event to come in. It may not crash, but it certainly isn\\u2019t doing anything\\nuseful. Don\\u2019t get me wrong, the fact that it\\u2019s not crashing is enormously important for fault\\ntolerance in production environments. However, the application architecture still has dependencies \\u2013\\nsubscribing services are still dependent on event publishers to do meaningful work and provide value\\nback to end-users.\"), mdx(\"p\", null, \"It\\u2019s essential to capture these events and relationships if teams are to better understand what\\ntheir applications are doing. This understanding helps with tracing and debugging requests and\\nallows for topology maps to be generated, analyzed, and used to educate developers on where and how\\nto contribute new features effectively.\"), mdx(\"h3\", {\n    \"id\": \"events-are-asynchronous\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Events are asynchronous\", mdx(\"a\", {\n    parentName: \"h3\",\n    \"href\": \"#events-are-asynchronous\",\n    \"aria-label\": \"events are asynchronous permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"Another myth about events is that they are de facto asynchronous \\u2013 publishers don\\u2019t wait for\\nsubscribers and vice-versa and will begin processing if and when they eventually hear from each\\nother. While this is true of the two types of \", mdx(\"em\", {\n    parentName: \"p\"\n  }, \"brokers\"), \" we outlined in this article, which are the\\ntwo main types used in event-driven architectures, it is not the nature of an event that makes this\\ntrue, but rather the fact that we are using databases to persist events and broker the\\nrelationships.\"), mdx(\"p\", null, \"The usage of a database to broker events is not a requirement. You\\u2019ve most certainly heard of an\\nevent type that does \", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"not\"), \" use a database to broker events,\\n\", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://sendgrid.com/blog/whats-webhook/\"\n  }, \"webhooks\"), \". Webhooks involve subscribers registering\\nthemselves with event publishers directly, and events that the publisher ships out are done using\\ndirect, synchronous API calls. This is identical to a \\u201Cbroadcast\\u201D event like we described earlier\\nbut highlights that it's the database usage that provides fault tolerance rather than event-driven\\narchitecture itself.\"), mdx(\"p\", null, \"You could even intercept synchronous API calls and force the calls onto a message broker to get this\\nsame fault tolerance for direct API calls between microservices. Instrumentation of this is\\n\", mdx(\"strong\", {\n    parentName: \"p\"\n  }, \"wildly\"), \" impractical, which is why it\\u2019s seldom done, but even its possibility further highlights\\nthat persistence is the secret sauce behind event-driven architecture.\"), mdx(\"p\", null, mdx(\"span\", {\n    parentName: \"p\",\n    \"className\": \"gatsby-resp-image-wrapper\",\n    \"style\": {\n      \"position\": \"relative\",\n      \"display\": \"block\",\n      \"marginLeft\": \"auto\",\n      \"marginRight\": \"auto\",\n      \"maxWidth\": \"1000px\"\n    }\n  }, \"\\n      \", mdx(\"a\", {\n    parentName: \"span\",\n    \"className\": \"gatsby-resp-image-link\",\n    \"href\": \"/static/25efbd7ac1cc59b1136ff99664c269cb/1df5b/async-myth.png\",\n    \"style\": {\n      \"display\": \"block\"\n    },\n    \"target\": \"_blank\",\n    \"rel\": \"noopener\"\n  }, \"\\n    \", mdx(\"span\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-background-image\",\n    \"style\": {\n      \"paddingBottom\": \"17.6%\",\n      \"position\": \"relative\",\n      \"bottom\": \"0\",\n      \"left\": \"0\",\n      \"backgroundImage\": \"url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAECAYAAACOXx+WAAAACXBIWXMAAAsTAAALEwEAmpwYAAABKElEQVQY0z2PzSpEYQCG3x2uABs2NmRJGjursZKbkCguwEJRIkoZEdGUhb0FYcrgKKbhFibOd/7mzDlzvvP9z8LM6MzCu3+e3gdR1ATVGkubO8gWNim0UoiiCO1OB0nK81LpByFVSUi92u124QUhjJLgUveYsak51IVAoxEDbx6pWIF7tXx8Mghg4McLR5Q2N9q07u5fKuM14uWk0gXK+CmXanFj/2yIS3WpjfmgXM5kDID+sk92LY+8w3LsLytwr9fOL3pCJ4xHmZC3QqrHklWdrNnetDatQ6VNgTKxsH1UHE65KHIhPxMmcpkMQF/ZJwevjl1F4PpIhMTK1l7vfpQwUEpBiIPfdgdxks43afoUJ/Q5Sdl6lvxNXMRR4z95YjaPOuPwHB9/BdPKHwcSJZUAAAAASUVORK5CYII=')\",\n      \"backgroundSize\": \"cover\",\n      \"display\": \"block\"\n    }\n  }), \"\\n  \", mdx(\"img\", {\n    parentName: \"a\",\n    \"className\": \"gatsby-resp-image-image\",\n    \"alt\": \"async myth\",\n    \"title\": \"async myth\",\n    \"src\": \"/static/25efbd7ac1cc59b1136ff99664c269cb/00d43/async-myth.png\",\n    \"srcSet\": [\"/static/25efbd7ac1cc59b1136ff99664c269cb/63868/async-myth.png 250w\", \"/static/25efbd7ac1cc59b1136ff99664c269cb/0b533/async-myth.png 500w\", \"/static/25efbd7ac1cc59b1136ff99664c269cb/00d43/async-myth.png 1000w\", \"/static/25efbd7ac1cc59b1136ff99664c269cb/aa440/async-myth.png 1500w\", \"/static/25efbd7ac1cc59b1136ff99664c269cb/1df5b/async-myth.png 1999w\"],\n    \"sizes\": \"(max-width: 1000px) 100vw, 1000px\",\n    \"style\": {\n      \"width\": \"100%\",\n      \"height\": \"100%\",\n      \"margin\": \"0\",\n      \"verticalAlign\": \"middle\",\n      \"position\": \"absolute\",\n      \"top\": \"0\",\n      \"left\": \"0\"\n    },\n    \"loading\": \"lazy\",\n    \"decoding\": \"async\"\n  }), \"\\n  \"), \"\\n    \")), mdx(\"h2\", {\n    \"id\": \"enabling-event-driven-architecture-for-your-application\",\n    \"style\": {\n      \"position\": \"relative\"\n    }\n  }, \"Enabling event-driven architecture for your application\", mdx(\"a\", {\n    parentName: \"h2\",\n    \"href\": \"#enabling-event-driven-architecture-for-your-application\",\n    \"aria-label\": \"enabling event driven architecture for your application permalink\",\n    \"className\": \"anchor after\"\n  }, mdx(\"svg\", {\n    parentName: \"a\",\n    \"aria-hidden\": \"true\",\n    \"focusable\": \"false\",\n    \"height\": \"16\",\n    \"version\": \"1.1\",\n    \"viewBox\": \"0 0 16 16\",\n    \"width\": \"16\"\n  }, mdx(\"path\", {\n    parentName: \"svg\",\n    \"fillRule\": \"evenodd\",\n    \"d\": \"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"\n  })))), mdx(\"p\", null, \"Event-driven architecture is powerful, but implementation leaves a lot to be desired \\u2013 specifically\\nwhen it comes to understanding the relationships between services whose communication is managed by\\na message broker or event stream. At Architect.io, we strive to make it as easy as possible for\\ndevelopers to incorporate best-in-breed architecture, like event streaming, into their everyday\\nworkflows. By automating service discovery and network security with each deployment, developers can\\nmore easily and more safely build event-driven design into their applications. Check out some of our\\nother articles to learn more:\"), mdx(\"ul\", null, mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://www.architect.io/blog/gitops-developers-guide\"\n  }, \"A Developer\\u2019s Guide to GitOps\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://www.architect.io/blog/why-distributed-apps-need-dependency-management\"\n  }, \"Why distributed apps need dependency management\")), mdx(\"li\", {\n    parentName: \"ul\"\n  }, mdx(\"a\", {\n    parentName: \"li\",\n    \"href\": \"https://www.architect.io/docs/\"\n  }, \"Our product docs!\"))), mdx(\"p\", null, \"Or \", mdx(\"a\", {\n    parentName: \"p\",\n    \"href\": \"https://cloud.architect.io/signup\"\n  }, \"sign up\"), \" and try Architect yourself today!\"));\n}\n;\nMDXContent.isMDXComponent = true;","excerpt":"Applications have quickly become complex webs of interconnected microservices. Failures in the API\ncalls between microservices grow more common and far more dastardly – wreaking havoc throughout…","tableOfContents":{"items":[{"url":"#types-of-events","title":"Types of events","items":[{"url":"#broadcast-notifications","title":"Broadcast notifications"},{"url":"#actionresponse-events","title":"Action/Response events"}]},{"url":"#event-driven-application-brokers","title":"Event-driven application brokers","items":[{"url":"#queue-backed-brokers","title":"Queue-backed brokers"},{"url":"#event-streams","title":"Event streams"}]},{"url":"#myths-about-event-driven-architecture","title":"Myths about event-driven architecture","items":[{"url":"#event-driven-architecture-decouples-microservices","title":"Event-driven architecture decouples microservices"},{"url":"#events-are-asynchronous","title":"Events are asynchronous"}]},{"url":"#enabling-event-driven-architecture-for-your-application","title":"Enabling event-driven architecture for your application"}]},"frontmatter":{"title":"What the Heck is Event-Driven Architecture?","description":"Prevent APIs from wreaking havoc by preparing your application for failure with event-driven architecture","author":"David Thor","date":"2021-02-09","image":{"childImageSharp":{"gatsbyImageData":{"layout":"constrained","images":{"fallback":{"src":"/static/00e00c02ab8858267ed2329beb4fecc2/7a23e/featured-image.png","srcSet":"/static/00e00c02ab8858267ed2329beb4fecc2/4ca58/featured-image.png 250w,\n/static/00e00c02ab8858267ed2329beb4fecc2/0251a/featured-image.png 500w,\n/static/00e00c02ab8858267ed2329beb4fecc2/7a23e/featured-image.png 1000w","sizes":"(min-width: 1000px) 1000px, 100vw"},"sources":[{"srcSet":"/static/00e00c02ab8858267ed2329beb4fecc2/002ed/featured-image.webp 250w,\n/static/00e00c02ab8858267ed2329beb4fecc2/15bdf/featured-image.webp 500w,\n/static/00e00c02ab8858267ed2329beb4fecc2/27c85/featured-image.webp 1000w","type":"image/webp","sizes":"(min-width: 1000px) 1000px, 100vw"}]},"width":1000,"height":563}}}}},"next":null,"previous":null}]}},"pageContext":{"slug":"event-driven-architecture"}},
    "staticQueryHashes": ["764694655"]}