{"id":5421,"date":"2025-09-03T22:51:14","date_gmt":"2025-09-03T22:51:14","guid":{"rendered":"https:\/\/lockitsoft.com\/?p=5421"},"modified":"2025-09-03T22:51:14","modified_gmt":"2025-09-03T22:51:14","slug":"event-driven-architectures-in-regulated-industries-foundations-benefits-and-challenges","status":"publish","type":"post","link":"https:\/\/lockitsoft.com\/?p=5421","title":{"rendered":"Event-Driven Architectures in Regulated Industries: Foundations, Benefits, and Challenges"},"content":{"rendered":"<p>Chris Tacey-Green, speaking at a recent industry event, delved into the intricacies of implementing event-driven architectures (EDAs) within highly regulated sectors such as banking and aviation. His presentation, &quot;Event-Driven, Cloud Native, Banking,&quot; aimed to demystify EDAs for those new to the concept while offering valuable insights for experienced practitioners, particularly concerning their application in environments demanding stringent compliance and robust reliability.<\/p>\n<h3>Understanding the Core Components of Event-Driven Architectures<\/h3>\n<p>Tacey-Green began by dissecting the fundamental elements of an event-driven architecture. At its heart, an &quot;event&quot; is defined as a change in the state of a system. This change can be triggered by various sources, including user actions, asynchronous background processes, or external systems. Events can either carry data, referred to as &quot;fat events,&quot; or serve as simple notifications, termed &quot;thin events.&quot; Tacey-Green advocated for &quot;lean&quot; events, suggesting that events should carry all pertinent data without extraneous information, drawing a parallel to a well-known paper advocating for &quot;putting your events on a diet.&quot;<\/p>\n<p>A crucial distinction was drawn between &quot;events&quot; and &quot;commands.&quot; Tacey-Green emphasized that while commands represent a direct instruction to perform an action, often with an expectation of a result, events are declarations that something has already happened. &quot;An event is me shouting into the world saying that something happened,&quot; he explained. &quot;I&#8217;m not expecting anything to happen off the back of that. I&#8217;m not necessarily expecting anyone to be listening to me.&quot; This clear differentiation, he noted, is vital for avoiding common pitfalls that can undermine the benefits of an EDA.<\/p>\n<p>An event-driven architecture, therefore, is an ecosystem where multiple systems react to these emitted events. These systems typically comprise &quot;producers,&quot; which publish events, and &quot;consumers,&quot; which subscribe to and process them.<\/p>\n<p>Tacey-Green also clarified the relationship between EDAs and &quot;event sourcing.&quot; While often discussed in the same context, they are not interchangeable. Event sourcing is a specific pattern for representing the state of an application as an immutable sequence of events. For instance, in a shopping cart scenario, instead of storing the state as &quot;4 hats,&quot; event sourcing would record four individual events: &quot;add hat,&quot; &quot;add hat,&quot; &quot;add hat,&quot; &quot;add hat.&quot; While event sourcing can complement EDAs, it is not a prerequisite. He cautioned that event sourcing can be a complex pattern to implement, and teams should understand that an EDA can be achieved without adopting it.<\/p>\n<p>The &quot;cloud-native&quot; aspect of the title refers to the design, construction, and operation of workloads in the cloud using modern engineering practices, emphasizing scalability and DevOps principles like CI\/CD. Finally, &quot;banking,&quot; as Tacey-Green described it, involves large, traditionally slow-moving, and highly regulated organizations. He contrasted the cautious nature of many traditional banks with the modern, agile approach adopted by his employer, Investec, which is actively embracing these advanced architectural patterns.<\/p>\n<h3>The Compelling Rationale for Eventing in Regulated Environments<\/h3>\n<p>The presentation then transitioned to the &quot;why&quot; behind adopting EDAs, especially in high-stakes environments like banking. Tacey-Green highlighted several key benefits derived from real-world use cases:<\/p>\n<h4>Decoupling for Enhanced Agility and Reliability<\/h4>\n<p>A primary advantage is decoupling, which significantly enhances system independence and resilience. Tacey-Green illustrated this with the example of transaction monitoring at a bank. Traditionally, integrating a payment system with a transaction monitoring service could lead to tight coupling. This could involve payments directly calling a transaction monitoring API or vice-versa. Such coupling creates dependencies that can impact reliability and slow down development, especially when systems have different reliability expectations or operational requirements.<\/p>\n<p>By adopting an EDA, payments systems can publish events like &quot;payment initiated&quot; or &quot;payment processed&quot; without any knowledge of transaction monitoring. Transaction monitoring, as an independent consumer, can subscribe to these events, extract the necessary data, and perform its analysis. This decoupling means that if the transaction monitoring system experiences downtime, it does not affect the core payment processing flow. Conversely, the payment system can evolve without directly impacting the transaction monitoring service. This separation is critical in regulated industries where core functions like payments must remain highly available, while auxiliary services may have different uptime SLAs.<\/p>\n<h4>An Immutable Activity Log for Enhanced Auditability<\/h4>\n<p>EDAs naturally create an immutable log of all system activities, which is invaluable for auditability and traceability in regulated sectors. Before implementing an EDA for payments, Tacey-Green explained, understanding the precise journey of a payment through various checkpoints (fraud checks, sanctions screening, gateway selection) was challenging. With an EDA, each step generates a distinct event, forming a comprehensive and trusted record. This is not a separate audit log but the very record of how the system operated. Business-oriented event names, like &quot;payment initiated&quot; or &quot;fraud check completed,&quot; provide clear visibility into the payment lifecycle, aiding in investigations and compliance reporting.<\/p>\n<h4>Fan-Out Capabilities for Efficient Workflow Management<\/h4>\n<p>The &quot;fan-out&quot; pattern, where a single event triggers multiple independent downstream actions, is another significant benefit. Consider a payment processing event. This single event can simultaneously trigger updates to customer payment limits and initiate customer communications (e.g., push notifications, SMS, email). In a traditional, tightly coupled system, coordinating these actions and handling failures in one could be complex. With an EDA, the &quot;payment processed&quot; event can be published once, and independent services for payment limit updates and customer communications can consume it. This allows each service to manage its own fault tolerance and retries without impacting the others, promoting greater system robustness.<\/p>\n<h4>Robust Fault Tolerance for Critical Operations<\/h4>\n<p>In regulated industries, fault tolerance is not a luxury but a necessity. EDAs offer multiple layers of fault tolerance. Tacey-Green outlined three tiers:<\/p>\n<ol>\n<li><strong>Transient Retries:<\/strong> Similar to in-process retries (e.g., using libraries like Polly in .NET), these handle temporary network glitches or service unavailability by retrying operations with a configurable delay and jitter. In an asynchronous EDA, these retries can potentially be extended.<\/li>\n<li><strong>Eventing Technology Retries\/Back-off:<\/strong> If transient retries fail, the underlying eventing infrastructure (e.g., Kafka, Kinesis, Azure Event Hubs) can be configured for more extended retries with a back-off strategy.<\/li>\n<li><strong>Dead-Lettering and Human Intervention:<\/strong> For persistent issues or &quot;poisonous messages&quot; (events that break contracts or contain unprocessable data), a dead-letter queue is essential. This mechanism diverts problematic events, preventing them from endlessly retrying and corrupting the system. It also allows for human intervention to investigate and replay these events if deemed necessary, ensuring critical operations are eventually completed.<\/li>\n<\/ol>\n<h4>Plug-and-Play Capability for New Features<\/h4>\n<p>As EDAs mature, they enable a &quot;plug-and-play&quot; approach for introducing new capabilities. If core systems like payments or accounts publish well-defined domain events, new services, such as a rewards program, can be built by simply subscribing to these existing events. This eliminates the need for direct integrations with the core systems, accelerating development and reducing dependencies. For example, a new rewards service could automatically know when a client is onboarded, an account is created, or a payment is processed, simply by consuming the relevant events.<\/p>\n<h3>Navigating the Challenges: What Hurts and What Helps<\/h3>\n<p>While the benefits are substantial, Tacey-Green candidly addressed the inherent challenges of implementing EDAs, particularly in a regulated context.<\/p>\n<h4>Human and Organizational Hurdles<\/h4>\n<p>The most significant challenge, he noted, is not technological but human. &quot;Event-driven architectures are hard for people, mainly people who have not yet worked on those architectures before,&quot; he stated. This learning curve can impact the speed of delivery, with new team members potentially taking months to reach parity with experienced engineers. The shift in paradigm requires architects and developers to think differently, moving from imperative to declarative programming models and embracing concepts like eventual consistency.<\/p>\n<p><strong>What helps:<\/strong><\/p>\n<ul>\n<li><strong>Developer Platforms and Paved Roads:<\/strong> Establishing a robust developer platform with pre-built service templates and application modules can significantly ease the adoption of EDAs. These &quot;paved roads&quot; provide developers with standardized, well-architected starting points, abstracting away much of the complexity.<\/li>\n<li><strong>Comprehensive Training and Enablement:<\/strong> Investing in dedicated training programs is crucial. Tacey-Green recounted an effective approach where an enablement team worked intensively with a delivery team for a week, combining theoretical training with hands-on design and development of a small, production-ready EDA system. This immersive approach fosters confidence and practical understanding.<\/li>\n<li><strong>Aligning on Standards and Principles:<\/strong> Early standardization of event contracts, permission models, and technology choices across the organization is vital. This ensures consistency and interoperability, preventing teams from encountering vastly different eventing paradigms when consuming events from other domains.<\/li>\n<\/ul>\n<h4>The Perils of Duplicated or Lost Events<\/h4>\n<p>In regulated industries like banking and aviation, the loss or duplication of events can have severe financial and compliance consequences. For example, a lost payment event could mean a landlord never receives rent, while a duplicated payment could lead to customer disputes and financial penalties.<\/p>\n<p><strong>What helps:<\/strong><\/p>\n<ul>\n<li><strong>Inbox and Outbox Patterns:<\/strong> Tacey-Green strongly advocated for the implementation of the outbox pattern for producers and the inbox pattern for consumers.\n<ul>\n<li><strong>Outbox Pattern:<\/strong> This pattern ensures that when an event is published, it is saved to a dedicated &quot;outbox&quot; table within the same transactional boundary as the data modification. A separate dispatcher then publishes the event to the event stream. This prevents event loss if the publishing mechanism fails after the data is saved.<\/li>\n<li><strong>Inbox Pattern:<\/strong> On the consumer side, the inbox pattern ensures that events are not processed multiple times. Incoming events are first recorded in an inbox table. The business logic then processes events based on their unique identifiers from this inbox. This protects against duplicate events delivered by eventing technologies (which often guarantee &quot;at-least-once&quot; delivery).<\/li>\n<\/ul>\n<\/li>\n<li><strong>Developer Platform Integration:<\/strong> Building these patterns directly into the developer platform ensures that all teams benefit from this crucial protection without needing to reimplement complex logic themselves.<\/li>\n<\/ul>\n<h4>The Challenge of Breaking Event Contracts<\/h4>\n<p>Events form a contract between producers and consumers. Once an event is published to an immutable event stream, it cannot be easily altered. Breaking these contracts by changing event structures or data can lead to cascading failures in consumer systems.<\/p>\n<p><strong>What helps:<\/strong><\/p>\n<ul>\n<li><strong>Treating Events as API Contracts:<\/strong> Tacey-Green advised treating event contracts with the same care as API contracts. This involves designing events thoughtfully and avoiding breaking changes whenever possible.<\/li>\n<li><strong>Versioning Events:<\/strong> When breaking changes are unavoidable, versioning events, similar to API versioning (e.g., <code>v1<\/code>, <code>v2<\/code>), is essential. A <code>data_version<\/code> property within the event metadata allows consumers to handle different versions gracefully.<\/li>\n<li><strong>Separating Domain and Integration Events:<\/strong> Differentiating between internal &quot;domain events&quot; (specific to a single bounded context) and external &quot;integration events&quot; (used to communicate between domains) is critical. This prevents the accidental exposure and contractual commitment of internal domain concepts that might need to change later. Integration events should be carefully curated and transformed from domain events before being published externally.<\/li>\n<\/ul>\n<h4>Event Ordering and Its Implications<\/h4>\n<p>Cloud-native eventing technologies are often optimized for scale and may not guarantee event order. In scenarios where order is critical (e.g., processing a series of transactions for a single account), this can lead to issues like allowing duplicate high-value payments if the balance update event hasn&#8217;t been processed yet.<\/p>\n<p><strong>What helps:<\/strong><\/p>\n<ul>\n<li><strong>Explicit Ordering with Versioning:<\/strong> Events can be stamped with sequence numbers or version identifiers. Consumers can then enforce order by only processing events in the expected sequence, backing off if an earlier event in the sequence has not yet arrived. This approach, while effective, can impact scalability.<\/li>\n<li><strong>Implicit Ordering through Domain Logic:<\/strong> Alternatively, domain logic can implicitly enforce ordering. For instance, a system might be designed to only process a payment event if a &quot;beneficiary created&quot; event has already been processed. This leverages inherent domain rules to manage order without explicit event stamps, often proving more scalable.<\/li>\n<\/ul>\n<h3>A Holistic View: The Payments and Communications Example<\/h3>\n<p>Tacey-Green concluded by illustrating these concepts with a detailed diagram depicting the flow of events between &quot;payments&quot; and &quot;communications&quot; domains within a banking context. The diagram showcased the journey of a payment from an API call, through the outbox pattern for event publishing, into the event stream, and then consumed by the communications domain via an inbox pattern. It highlighted the transformation of domain events into integration events, the role of publishers in filtering, aggregating, and transforming events, and the overall protection mechanisms implemented to ensure reliability and compliance. This visual representation underscored how these architectural patterns, when integrated into a developer platform, can empower teams to build robust and scalable EDAs in regulated environments.<\/p>\n<p>The discussion also touched upon key questions from the audience, including defining event versions, proving completeness of event streams for auditors (SOX compliance), managing the cost of deduplication, handling a large number of integration events, and the trade-offs between lean and fat events. Tacey-Green&#8217;s responses emphasized practical solutions and the importance of careful design and trade-off analysis.<\/p>\n<p>Ultimately, Tacey-Green&#8217;s presentation offered a comprehensive guide to navigating the complexities of event-driven architectures in highly regulated industries, underscoring that with careful planning, robust tooling, and a focus on human factors, these powerful architectural patterns can be successfully implemented to drive innovation and efficiency.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Chris Tacey-Green, speaking at a recent industry event, delved into the intricacies of implementing event-driven architectures (EDAs) within highly regulated sectors such as banking and aviation. His presentation, &quot;Event-Driven, Cloud Native, Banking,&quot; aimed to demystify EDAs for those new to the concept while offering valuable insights for experienced practitioners, particularly concerning their application in environments &hellip;<\/p>\n","protected":false},"author":9,"featured_media":5420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[136],"tags":[905,909,910,138,258,904,908,907,139,906,137],"class_list":["post-5421","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development","tag-architectures","tag-benefits","tag-challenges","tag-coding","tag-driven","tag-event","tag-foundations","tag-industries","tag-programming","tag-regulated","tag-software"],"_links":{"self":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts\/5421","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5421"}],"version-history":[{"count":0,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/posts\/5421\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=\/wp\/v2\/media\/5420"}],"wp:attachment":[{"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lockitsoft.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}