<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lalit Kale</title>
    <description>The latest articles on DEV Community by Lalit Kale (@lalitkale).</description>
    <link>https://dev.to/lalitkale</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F106547%2F5475b20c-ac16-4474-96d4-4ec14717f40e.jpg</url>
      <title>DEV Community: Lalit Kale</title>
      <link>https://dev.to/lalitkale</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lalitkale"/>
    <language>en</language>
    <item>
      <title>Modeling Shared Entities Across Bounded Contexts in Domain-Driven Design</title>
      <dc:creator>Lalit Kale</dc:creator>
      <pubDate>Sun, 25 May 2025 14:12:56 +0000</pubDate>
      <link>https://dev.to/aws-builders/modeling-shared-entities-across-bounded-contexts-in-domain-driven-design-5hih</link>
      <guid>https://dev.to/aws-builders/modeling-shared-entities-across-bounded-contexts-in-domain-driven-design-5hih</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;When modeling complex systems using &lt;strong&gt;Domain-Driven Design (DDD)&lt;/strong&gt;, one of the most common dilemmas architects and engineers face is:  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“If two bounded contexts use the same concept — like a &lt;code&gt;Customer&lt;/code&gt; — should they share a common model or have separate ones?”&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Take, for example, &lt;strong&gt;Sales&lt;/strong&gt; and &lt;strong&gt;Support&lt;/strong&gt; systems within an organization. Both deal with a &lt;code&gt;Customer&lt;/code&gt;, but they use that concept differently. So what’s the right way to model this scenario in line with DDD principles?&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fax8f996efd0s61g8y37w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fax8f996efd0s61g8y37w.png" alt="Bounded Context of Sales and Support" width="772" height="478"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;original context map image courtesy: &lt;a href="https://martinfowler.com/bliki/BoundedContext.html" rel="noopener noreferrer"&gt;https://martinfowler.com/bliki/BoundedContext.html&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let’s explore.&lt;/p&gt;




&lt;h2&gt;
  
  
  Understanding the Problem: Shared Concepts, Divergent Needs
&lt;/h2&gt;

&lt;p&gt;In many organizations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The &lt;strong&gt;Sales&lt;/strong&gt; team cares about a customer's &lt;em&gt;lead score&lt;/em&gt;, &lt;em&gt;purchase intent&lt;/em&gt;, and &lt;em&gt;assigned sales rep&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;The &lt;strong&gt;Support&lt;/strong&gt; team, on the other hand, is focused on &lt;em&gt;support ticket history&lt;/em&gt;, &lt;em&gt;SLA agreements&lt;/em&gt;, and &lt;em&gt;incident timelines&lt;/em&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Clearly, while the term "Customer" is shared, its &lt;strong&gt;meaning&lt;/strong&gt; and &lt;strong&gt;usage&lt;/strong&gt; diverge across these contexts. This is a textbook case of &lt;strong&gt;polysemy&lt;/strong&gt; in DDD — the same term having multiple meanings in different bounded contexts.&lt;/p&gt;




&lt;h2&gt;
  
  
  What Does DDD Recommend?
&lt;/h2&gt;

&lt;h3&gt;
  
  
  ✅ Model Each Bounded Context Independently
&lt;/h3&gt;

&lt;p&gt;Rather than forcing a single &lt;code&gt;Customer&lt;/code&gt; entity to serve multiple masters, DDD encourages modeling the concept &lt;strong&gt;according to the specific domain's needs&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;This means creating:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;SalesCustomer&lt;/code&gt; in the Sales context.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SupportCustomer&lt;/code&gt; in the Support context.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each entity will only contain the attributes and behavior relevant to its respective domain. They can be kept in sync using &lt;strong&gt;integration events&lt;/strong&gt; or APIs.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Not Share a Single Customer Entity?
&lt;/h2&gt;

&lt;p&gt;Sharing a single customer model across contexts may seem DRY and clean at first, but it introduces tight coupling, cross-team dependencies, and often leads to bloated models full of irrelevant attributes.&lt;/p&gt;

&lt;h3&gt;
  
  
  Problems with a Shared Model:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Code becomes harder to maintain.&lt;/li&gt;
&lt;li&gt;Changes in one context impact others.&lt;/li&gt;
&lt;li&gt;The model becomes a compromise that satisfies no one well.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Integration Through Events: The DDD Way
&lt;/h2&gt;

&lt;p&gt;In a properly decoupled system, Sales might &lt;strong&gt;publish domain events&lt;/strong&gt; such as &lt;code&gt;CustomerCreated&lt;/code&gt;, &lt;code&gt;CustomerUpdated&lt;/code&gt;, or &lt;code&gt;LeadConverted&lt;/code&gt;.&lt;br&gt;&lt;br&gt;
Support consumes these events and updates its own &lt;code&gt;SupportCustomer&lt;/code&gt; read model.&lt;/p&gt;

&lt;p&gt;This keeps the systems loosely coupled and allows each to evolve independently.&lt;/p&gt;




&lt;h2&gt;
  
  
  Diagram: Visualizing the Pattern
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo466y53t24l2i97zagod.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo466y53t24l2i97zagod.png" alt="DDD Context Map of Sales and Support" width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Each &lt;strong&gt;bounded context&lt;/strong&gt; maintains its own &lt;code&gt;Customer&lt;/code&gt; model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration events&lt;/strong&gt; (via Kafka, EventBridge, etc.) keep the models in sync.&lt;/li&gt;
&lt;li&gt;The system respects &lt;strong&gt;context boundaries&lt;/strong&gt; and encourages &lt;strong&gt;autonomy&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Other Modeling Strategies
&lt;/h2&gt;

&lt;p&gt;In DDD, this scenario can also be approached through different integration patterns depending on organizational and technical constraints:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Pattern&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;strong&gt;Shared Kernel&lt;/strong&gt;  (discouraged but still valid in rare scenarios)&lt;/td&gt;
&lt;td&gt;Shared subset of the model agreed upon and versioned by both teams&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Customer-as-a-Service&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;One context exposes an API or event feed; others consume with translation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Anti-Corruption Layer&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Context-specific adapter to isolate internal models from external contracts&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  Practical Guidelines
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Avoid modeling based on database schemas&lt;/strong&gt;. Model based on domain &lt;strong&gt;semantics&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treat duplication as an acceptable trade-off&lt;/strong&gt; for autonomy and clarity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use ubiquitous language&lt;/strong&gt; in each context; don’t force uniform terminology.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Synchronize data through events&lt;/strong&gt;, not shared objects.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;In Domain-Driven Design, &lt;strong&gt;context is king&lt;/strong&gt;. Just because different domains refer to a &lt;code&gt;Customer&lt;/code&gt; doesn’t mean they are talking about the same concept. Forcing a unified model creates fragility and limits agility.&lt;/p&gt;

&lt;p&gt;Instead, &lt;strong&gt;embrace duplication&lt;/strong&gt;, &lt;strong&gt;model explicitly&lt;/strong&gt;, and &lt;strong&gt;integrate intentionally&lt;/strong&gt;. That’s how you build robust, evolvable systems.&lt;/p&gt;

</description>
      <category>domaindrivendesign</category>
      <category>entitymodeling</category>
    </item>
    <item>
      <title>#aws #eventdrivenarchitectures #eda</title>
      <dc:creator>Lalit Kale</dc:creator>
      <pubDate>Tue, 01 Apr 2025 04:38:47 +0000</pubDate>
      <link>https://dev.to/lalitkale/aws-eventdrivenarchitectures-eda-17ac</link>
      <guid>https://dev.to/lalitkale/aws-eventdrivenarchitectures-eda-17ac</guid>
      <description>&lt;div class="ltag__link--embedded"&gt;
  &lt;div class="crayons-story "&gt;
  &lt;a href="https://dev.to/aws-builders/a-socio-technical-maturity-model-for-large-scale-event-driven-architectural-systems-4gg8" class="crayons-story__hidden-navigation-link"&gt;A Socio-Technical Maturity Model for Large-Scale Event-Driven Architectural Systems&lt;/a&gt;


  &lt;div class="crayons-story__body crayons-story__body-full_post"&gt;
    &lt;div class="crayons-story__top"&gt;
      &lt;div class="crayons-story__meta"&gt;
        &lt;div class="crayons-story__author-pic"&gt;
          &lt;a class="crayons-logo crayons-logo--l" href="/aws-builders"&gt;
            &lt;img alt="AWS Community Builders  logo" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F2794%2F88da75b6-aadd-4ea1-8083-ae2dfca8be94.png" class="crayons-logo__image"&gt;
          &lt;/a&gt;

          &lt;a href="/lalitkale" class="crayons-avatar  crayons-avatar--s absolute -right-2 -bottom-2 border-solid border-2 border-base-inverted  "&gt;
            &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F106547%2F5475b20c-ac16-4474-96d4-4ec14717f40e.jpg" alt="lalitkale profile" class="crayons-avatar__image"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
        &lt;div&gt;
          &lt;div&gt;
            &lt;a href="/lalitkale" class="crayons-story__secondary fw-medium m:hidden"&gt;
              Lalit Kale
            &lt;/a&gt;
            &lt;div class="profile-preview-card relative mb-4 s:mb-0 fw-medium hidden m:inline-block"&gt;
              
                Lalit Kale
                
              
              &lt;div id="story-author-preview-content-2354137" class="profile-preview-card__content crayons-dropdown branded-7 p-4 pt-0"&gt;
                &lt;div class="gap-4 grid"&gt;
                  &lt;div class="-mt-4"&gt;
                    &lt;a href="/lalitkale" class="flex"&gt;
                      &lt;span class="crayons-avatar crayons-avatar--xl mr-2 shrink-0"&gt;
                        &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F106547%2F5475b20c-ac16-4474-96d4-4ec14717f40e.jpg" class="crayons-avatar__image" alt=""&gt;
                      &lt;/span&gt;
                      &lt;span class="crayons-link crayons-subtitle-2 mt-5"&gt;Lalit Kale&lt;/span&gt;
                    &lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="print-hidden"&gt;
                    
                      Follow
                    
                  &lt;/div&gt;
                  &lt;div class="author-preview-metadata-container"&gt;&lt;/div&gt;
                &lt;/div&gt;
              &lt;/div&gt;
            &lt;/div&gt;

            &lt;span&gt;
              &lt;span class="crayons-story__tertiary fw-normal"&gt; for &lt;/span&gt;&lt;a href="/aws-builders" class="crayons-story__secondary fw-medium"&gt;AWS Community Builders &lt;/a&gt;
            &lt;/span&gt;
          &lt;/div&gt;
          &lt;a href="https://dev.to/aws-builders/a-socio-technical-maturity-model-for-large-scale-event-driven-architectural-systems-4gg8" class="crayons-story__tertiary fs-xs"&gt;&lt;time&gt;Mar 24 '25&lt;/time&gt;&lt;span class="time-ago-indicator-initial-placeholder"&gt;&lt;/span&gt;&lt;/a&gt;
        &lt;/div&gt;
      &lt;/div&gt;

    &lt;/div&gt;

    &lt;div class="crayons-story__indention"&gt;
      &lt;h2 class="crayons-story__title crayons-story__title-full_post"&gt;
        &lt;a href="https://dev.to/aws-builders/a-socio-technical-maturity-model-for-large-scale-event-driven-architectural-systems-4gg8" id="article-link-2354137"&gt;
          A Socio-Technical Maturity Model for Large-Scale Event-Driven Architectural Systems
        &lt;/a&gt;
      &lt;/h2&gt;
        &lt;div class="crayons-story__tags"&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/eventdriven"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;eventdriven&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/aws"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;aws&lt;/a&gt;
            &lt;a class="crayons-tag  crayons-tag--monochrome " href="/t/organizationalpatterns"&gt;&lt;span class="crayons-tag__prefix"&gt;#&lt;/span&gt;organizationalpatterns&lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="crayons-story__bottom"&gt;
        &lt;div class="crayons-story__details"&gt;
          &lt;a href="https://dev.to/aws-builders/a-socio-technical-maturity-model-for-large-scale-event-driven-architectural-systems-4gg8" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left"&gt;
            &lt;div class="multiple_reactions_aggregate"&gt;
              &lt;span class="multiple_reactions_icons_container"&gt;
                  &lt;span class="crayons_icon_container"&gt;
                    &lt;img src="https://assets.dev.to/assets/sparkle-heart-5f9bee3767e18deb1bb725290cb151c25234768a0e9a2bd39370c382d02920cf.svg" width="18" height="18"&gt;
                  &lt;/span&gt;
              &lt;/span&gt;
              &lt;span class="aggregate_reactions_counter"&gt;2&lt;span class="hidden s:inline"&gt; reactions&lt;/span&gt;&lt;/span&gt;
            &lt;/div&gt;
          &lt;/a&gt;
            &lt;a href="https://dev.to/aws-builders/a-socio-technical-maturity-model-for-large-scale-event-driven-architectural-systems-4gg8#comments" class="crayons-btn crayons-btn--s crayons-btn--ghost crayons-btn--icon-left flex items-center"&gt;
              Comments


              &lt;span class="hidden s:inline"&gt;Add Comment&lt;/span&gt;
            &lt;/a&gt;
        &lt;/div&gt;
        &lt;div class="crayons-story__save"&gt;
          &lt;small class="crayons-story__tertiary fs-xs mr-2"&gt;
            4 min read
          &lt;/small&gt;
            
              &lt;span class="bm-initial"&gt;
                

              &lt;/span&gt;
              &lt;span class="bm-success"&gt;
                

              &lt;/span&gt;
            
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/div&gt;

&lt;/div&gt;


</description>
      <category>eventdriven</category>
      <category>aws</category>
    </item>
    <item>
      <title>A Socio-Technical Maturity Model for Large-Scale Event-Driven Architectural Systems</title>
      <dc:creator>Lalit Kale</dc:creator>
      <pubDate>Mon, 24 Mar 2025 17:39:05 +0000</pubDate>
      <link>https://dev.to/aws-builders/a-socio-technical-maturity-model-for-large-scale-event-driven-architectural-systems-4gg8</link>
      <guid>https://dev.to/aws-builders/a-socio-technical-maturity-model-for-large-scale-event-driven-architectural-systems-4gg8</guid>
      <description>&lt;p&gt;In modern enterprises like Amazon, Netflix, and JD.com, success hinges on building scalable, decoupled, and resilient systems. Event-Driven Architecture (EDA) paired with Domain-Driven Design (DDD) is no longer just a pattern—it's the architectural backbone of modern digital platforms. But EDA adoption is not just technical; it’s a socio-technical transformation.&lt;/p&gt;

&lt;p&gt;This guide introduces a comprehensive EDA Maturity Model for enterprise-scale systems, including engineering roles, DDD alignment, team evolution, and hiring strategies. It is structured to be useful for engineering managers, principal engineers, and staff engineers who are driving the adoption of EDA within large global teams.&lt;/p&gt;

&lt;h2&gt;
  
  
  📊 The 4A EDA Maturity Model: "Awaken, Align, Amplify, Automate"
&lt;/h2&gt;

&lt;blockquote&gt;
&lt;p&gt;Transitioning to an Event-Driven Architecture is not a one-time event; it’s a journey that unfolds in stages.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To simplify this transformation, we have developed the 4A Model, representing four progressive stages: Awaken, Align, Amplify, and Automate. Each stage addresses the evolving needs and capabilities of teams, helping them move from basic awareness to fully automated, AI-driven systems.&lt;/p&gt;

&lt;p&gt;1.🔥 Awaken — Reactive &amp;amp; Exploratory&lt;/p&gt;

&lt;p&gt;In the Awaken stage, teams are just starting their journey with EDA. They might still be predominantly API-centric, with little awareness of event-driven patterns. This stage is characterized by experimentation and a lack of standardized practices.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Focus:&lt;/strong&gt; Building awareness and creating foundational event-driven workflows. Teams should begin with EventStorming workshops to map out business events and domain boundaries. At this stage, it's essential to adopt structured logging practices, using identifiers like logLevel: EVENT, correlationId, and traceId to make event logs easily traceable.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Practices:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start EventStorming workshops to identify key domain events.&lt;/li&gt;
&lt;li&gt;Use structured logging to ensure event traceability and consistency.&lt;/li&gt;
&lt;li&gt;Build a simple EDA flow using SNS and Lambda to demonstrate basic event processing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Pitfalls:&lt;/strong&gt; Teams often mistake commands for events or treat event processing as synchronous. Educate teams on the difference between commands (requests to perform an action) and events (facts of something that has happened).&lt;/p&gt;

&lt;p&gt;2.🌍 Align — Standardized &amp;amp; Stable&lt;/p&gt;

&lt;p&gt;In the Align stage, teams start treating events as first-class citizens. There is a conscious effort to standardize schemas, enable observability, and ensure fault tolerance through dead-letter queues (DLQs) and retries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Focus:&lt;/strong&gt; Establishing consistency and operational stability. Teams should develop a schema registry and enforce idempotency strategies for event processing. Monitoring and observability practices should be robust, allowing teams to detect and troubleshoot failures efficiently.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Practices:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use AWS EventBridge Schema Registry to standardize event definitions.&lt;/li&gt;
&lt;li&gt;Enable DLQs to handle unprocessed or failed messages.&lt;/li&gt;
&lt;li&gt;Implement distributed tracing with AWS X-Ray and OpenTelemetry for complete event visibility.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Pitfalls:&lt;/strong&gt; Engineers may overlook the need for idempotency, leading to duplicate processing. Implement clear guidelines on ensuring idempotent event consumers.&lt;/p&gt;

&lt;p&gt;3.🚀 Amplify — Scalable, Global &amp;amp; Performant&lt;/p&gt;

&lt;p&gt;As EDA adoption matures, the focus shifts to scalability and global distribution. Teams build resilient, multi-region systems with optimized performance for high-traffic scenarios.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Focus:&lt;/strong&gt; Implementing multi-region routing and ensuring the system can handle high-volume event traffic efficiently. Teams should differentiate between real-time and batch processing to optimize resource use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Practices:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Use EventBridge Global Endpoints to route events based on latency or regional availability.&lt;/li&gt;
&lt;li&gt;Implement multi-tiered event processing with Kinesis for real-time data and SQS for asynchronous tasks.&lt;/li&gt;
&lt;li&gt;Automate failure recovery and cost optimization using DLQs and Lambda tuning.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Pitfalls:&lt;/strong&gt; Teams may struggle with global consistency and latency. Prioritize regional processing for latency-sensitive events.&lt;/p&gt;

&lt;p&gt;4.🤖 Automate — AI-Driven &amp;amp; Self-Healing&lt;/p&gt;

&lt;p&gt;In the final stage, the EDA system is fully automated and capable of self-optimization. AI-driven monitoring and predictive scaling ensure the system adapts to changing conditions without manual intervention.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Focus:&lt;/strong&gt; Enabling AI-based anomaly detection, predictive scaling, and autonomous recovery. The goal is to build a self-healing architecture that requires minimal human oversight.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Best Practices:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Train AI models with AWS SageMaker to detect anomalies in event patterns.&lt;/li&gt;
&lt;li&gt;Use AWS Systems Manager to automate incident response.&lt;/li&gt;
&lt;li&gt;Implement event-driven FinOps to optimize operational costs continuously.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Common Pitfalls:&lt;/strong&gt; Over-reliance on automation without proper monitoring can lead to undetected issues. Balance AI-driven responses with human oversight when necessary.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88ank72b3720igl8gi88.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F88ank72b3720igl8gi88.png" alt="4A Model for Event Driven Architectures" width="744" height="516"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🌟 Hiring Practices and Skills for EDA Adoption
&lt;/h2&gt;

&lt;p&gt;Hiring engineers who can adapt to the 4A Model requires a clear understanding of the skills needed at each stage. Here’s how to hire and build teams for each phase:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Awaken Stage: Look for engineers with a basic understanding of microservices and asynchronous programming. Ideal candidates have worked with REST APIs and have an interest in event-driven patterns.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Align Stage:&lt;/strong&gt; Seek candidates with experience in message brokers (e.g., SNS, Kafka) and schema management. They should understand idempotency and distributed tracing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Amplify Stage:&lt;/strong&gt; Focus on engineers who have managed multi-region systems and have experience in performance tuning. Skills in AWS EventBridge, Lambda optimization, and global traffic management are key.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Automate Stage:&lt;/strong&gt; Hire engineers with experience in AI/ML integration for anomaly detection. They should be familiar with AWS SageMaker and how to implement self-healing workflows.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Interview Tips:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Ask about their experience with event-driven failures and recovery.&lt;/li&gt;
&lt;li&gt;Pose scenarios involving multi-region event consistency.&lt;/li&gt;
&lt;li&gt;Challenge them to design an autonomous EDA system that can self-heal.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🌟 Conclusion&lt;/p&gt;

&lt;p&gt;Mastering Event-Driven Architecture in large enterprises requires more than technical proficiency. It demands a cultural shift in how teams think about events, data flow, and system autonomy. By following the 4A Maturity Model—Awaken, Align, Amplify, Automate—teams can progressively enhance their capabilities, leading to scalable, resilient, and self-healing systems.&lt;/p&gt;

&lt;p&gt;By fostering the right mindset, equipping teams with the proper tools, and hiring engineers who understand EDA and DDD principles, organizations can transform their architectures to meet modern demands. Embrace the journey, build iteratively, and let your events do the talking.&lt;/p&gt;

&lt;p&gt;Ready to elevate your EDA strategy? Let’s make the transition together!&lt;/p&gt;

</description>
      <category>eventdriven</category>
      <category>aws</category>
      <category>organizationalpatterns</category>
    </item>
    <item>
      <title>Setup business metrics with Amazon CloudWatch and AWS Lambda at lower cost</title>
      <dc:creator>Lalit Kale</dc:creator>
      <pubDate>Fri, 28 Oct 2022 13:01:39 +0000</pubDate>
      <link>https://dev.to/aws-builders/setup-business-metrics-with-amazon-cloudwatch-and-aws-lambda-at-lower-cost-42id</link>
      <guid>https://dev.to/aws-builders/setup-business-metrics-with-amazon-cloudwatch-and-aws-lambda-at-lower-cost-42id</guid>
      <description>&lt;p&gt;Any good business runs with goals and key performance indicators (KPIs) that are monitored and managed. These can be user signups, or Subscriptions sale trend, or customer churn. Any Cloud-born or cloud-native business is no exception to this.&lt;/p&gt;

&lt;p&gt;This post provides how to guide for creating business metrics using Amazon CloudWatch and AWS Lambda services.&lt;/p&gt;

&lt;p&gt;Readers, familiar with EMF format for CloudWatch, can jump to the Implementation section.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Before we dive deeper, let's have a tweet size introduction to AWS CloudWatch and AWS Lambda service. &lt;/p&gt;

&lt;p&gt;Amazon CloudWatch helps to observe and monitor AWS resources and applications in the cloud and on premises. &lt;/p&gt;

&lt;p&gt;AWS Lambda is a serverless, event-driven compute service that lets you run code for any type of application or backend service without provisioning or managing servers. AWS Lambda helps to focus on delivering customer value.&lt;/p&gt;

&lt;p&gt;Any AWS service publish metrics in Amazon CloudWatch. Amazon CloudWatch can also publish your own application specific metrics. These metrics are called as custom metrics. The number of third-party API calls, or the count of status codes returned by an API, etc are a few examples. Based on these metrics, you can build your own dashboards or alert notifications etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ways to add Amazon CloudWatch custom metrics
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html" rel="noopener noreferrer"&gt;PutMetricData API&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Amazon CloudWatch provides an API through which you can put the custom metrics. But, sending the API request is a synchronous process. For high-volume applications, you have to batch up the requests for CloudWatch API – "PutMetricData" API. Otherwise, your requests will be throttled by CloudWatch API. CloudWatch API usage for adding custom metrics also incurs cost.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CreateMetricFilterProcedure.html" rel="noopener noreferrer"&gt;Metric Log Filters&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Metric log filters are another way to create CloudWatch custom metrics. The Metric log filters can search and filter data points needed to create metrics from CloudWatch log groups. It's a better option as compared to using CloudWatch API since it's asynchronous.  The drawback of this method is, every time you need to create a new metric, you have to create the metric log filters.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch_Embedded_Metric_Format_Specification.html" rel="noopener noreferrer"&gt;EMF For CloudWatch&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;A third option is using Amazon CloudWatch specification for Embedded Metric Format (EMF). It's again an asynchronous way to create custom metrics. But with EMF format, there are no incurring charges for customer. There are no prerequisites as previous method of log filters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Implementation
&lt;/h2&gt;

&lt;p&gt;This walkthrough assumes familiarity with AWS Lambda and AWS CloudWatch services. It also assumes that you can deploy AWS lambda in your own AWS account.&lt;/p&gt;

&lt;p&gt;The implementation uses AWS Lambda and Amazon CloudWatch. But, you can use Amazon CloudWatch EMF format with any other AWS compute services such as Amazon ECS, Amazon EKS and AWS Fargate.&lt;/p&gt;

&lt;p&gt;Let's create AWS Lambda function to log custom metrics. In our example, below, the lambda function &lt;code&gt;orderservice&lt;/code&gt; represents a fictitious order service.  In this service, we would be creating metrics for average order value amount trend.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For order service lambda function, first create a directory and initialize npm.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; mkdir orderservice &amp;amp;&amp;amp; cd orderservice &amp;amp;&amp;amp; npm init -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now, install &lt;a href="https://github.com/awslabs/aws-embedded-metrics-node" rel="noopener noreferrer"&gt;aws-embedded-metrics&lt;/a&gt; library in the &lt;code&gt;orderservice&lt;/code&gt; project directory. &lt;code&gt;aws-embedded-metrics&lt;/code&gt; library handles logging custom metrics in Amazon CloudWatch EMF format.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  npm install aws-embedded-metrics
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a &lt;code&gt;node_modules&lt;/code&gt; directory with the required dependencies.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once you have installed the dependencies, create a new file in the project directory and name it &lt;code&gt;index.js&lt;/code&gt;. In &lt;code&gt;index.js&lt;/code&gt;, export the function as shown below.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;metricScope&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;aws-embedded-metrics&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;orderMetrics&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;metricScope&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;metrics&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;
  &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;// ...&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;orderMetrics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Now, within the function, you have to create your own metric namespace and select the dimensions for the metrics. For high cardinality values, you can use property rather than dimensions. So, complete &lt;code&gt;orderMetrics&lt;/code&gt; function is as follows
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;metricScope&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;aws-embedded-metrics&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;orderMetrics&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;metricScope&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;metrics&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="nx"&gt;event&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="c1"&gt;//define the namespace for custom metrics &lt;/span&gt;
  &lt;span class="nx"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setNamespace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;OrderManagement&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;//set the dimentions &lt;/span&gt;
  &lt;span class="nx"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;putDimensions&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;Service&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;OrderService&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;CustomerId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;26102022&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="c1"&gt;// write the metric value to cloudwatch&lt;/span&gt;
  &lt;span class="nx"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;putMetric&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Avg. Order Value&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;None&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// add context as properties to build cloudwatch log insights queries&lt;/span&gt;
  &lt;span class="nx"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;AccountId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;123456789012&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;RequestId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;45b7d3b0-ca99-44a2-93ad-05e29c9d40e6&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;OrderId&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;7b125931-7898-4eab-bf16-78b8dc87707d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;metrics&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;setProperty&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Payload&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;sampleTime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
    &lt;span class="na"&gt;customerId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;26102022&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;handler&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;orderMetrics&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that, &lt;code&gt;putMetric&lt;/code&gt; parameter value is randomly generated for demo purposes. You have to replace it with your own metric value.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Now, you need to compress all the files in the project directory and upload the ZIP file to Lambda console.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;zip &lt;span class="nt"&gt;-r&lt;/span&gt; ../orderservice.zip &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;After uploading the &lt;code&gt;orderservice.zip&lt;/code&gt; to lambda function, you can test the lambda with test event. Since, we have randomized the &lt;code&gt;putMetric&lt;/code&gt; input value, we are expected to see the logs having the custom metric. There can be a couple of seconds of lag for reflecting values in Amazon CloudWatch metrics page and dashboard. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;To simulate real world traffic, you have to invoke orderservice lambda several times. You can use lambda function's &lt;code&gt;Test&lt;/code&gt; feature with sample event to simulate invocations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now, you will see the &lt;code&gt;ordermanagement&lt;/code&gt; metric as shown below under CloudWatch Metrics.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8x8tfsrqguvr9chm92fm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8x8tfsrqguvr9chm92fm.png" alt="orderservice custom metric" width="800" height="293"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Clicking on the &lt;code&gt;OrderManagement&lt;/code&gt; metric, you can see &lt;code&gt;CustomerId,Service,ServiceType and ServiceName&lt;/code&gt; metric. After small touch ups on the graph, the final output of custom metric looks as below.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbs62r5dmk0mg0twudkim.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbs62r5dmk0mg0twudkim.png" alt="orderservice final view of custom metric" width="800" height="282"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can consider this business metric of &lt;code&gt;Avg. Order Value&lt;/code&gt; as any other Amazon CloudWatch metric. Furthermore, you can create CloudWatch alerts based on CloudWatch custom metrics, for example – set up an alert when we receive an order of more than USD 50 million etc. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same business metrics can be utilized to create CloudWatch dashboards to better serve your customers. &lt;/p&gt;

&lt;p&gt;In summary, EMF format for Amazon CloudWatch is a great feature which can be utilized for creating the custom business metrics. Many customers have enjoyed up to 65% of cost reduction with using EMF format for Amazon CloudWatch, among other benefits. What you are waiting for? Now Go Build! &lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloudwatch</category>
      <category>lambda</category>
      <category>serverless</category>
    </item>
    <item>
      <title>AWS Architecture Diagrams Guidelines</title>
      <dc:creator>Lalit Kale</dc:creator>
      <pubDate>Tue, 25 Oct 2022 15:02:06 +0000</pubDate>
      <link>https://dev.to/aws-builders/aws-architecture-diagrams-guidelines-595d</link>
      <guid>https://dev.to/aws-builders/aws-architecture-diagrams-guidelines-595d</guid>
      <description>&lt;p&gt;AWS Architectural diagrams represents AWS resources and other significant objects and their relationships. AWS architectural diagrams communicate the exact blueprints of the solutions. Yet, many engineers and architects struggle to produce good diagrams. You will find many diagrams, over the internet, which do not represent the meaningful context.&lt;/p&gt;

&lt;p&gt;This article provides guidelines on how to draw the architectural diagrams. These guidelines came from my own experience and many in the AWS community.&lt;/p&gt;

&lt;h3&gt;
  
  
  Need for Architectural Diagrams
&lt;/h3&gt;

&lt;p&gt;On the surface, it may look simple to doodle a couple of boxes and arrows. But, it is critical activity from the system point of view. So, let's explore why architectural diagrams is even part of the skill set of any good architect. &lt;/p&gt;

&lt;p&gt;Conceptual integrity is one of the key factor for successful architecture. It is the quality of a system where all the concepts and their relationships with each other are consistently applied throughout the system. Even if many people work on the system, it would seem cohesive and consistent, as if only one mind was guiding the work. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I will contend that conceptual integrity is the most important consideration in system design. It is better to have a system omit certain anomalous features and improvements, but to reflect one set of design ideas, than to have one that contains many good but independent and uncoordinated ideas. — Frederick Brooks, The Mythical Man-Month: Essays on Software Engineering&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Many great technical people are not known for their communication skills. This simple fact hampers the communication of vision. Time is another big factor, due to which conceptual integrity faints away. This signifies the importance of having and maintaining the architectural diagrams. &lt;/p&gt;

&lt;h3&gt;
  
  
  Formal Architectural Documentation Models
&lt;/h3&gt;

&lt;p&gt;There is a no consensus on one single way or method in the wider software architecture community. But, there are some well-known software architecture documentation models exists. We will explore two of such models in this section. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://c4model.com/" rel="noopener noreferrer"&gt;C4 Model&lt;/a&gt;&lt;/strong&gt; &lt;br&gt;
Simon Brown came up with the C4 model. C4 model visualizes the architecture into a set of Context, Containers, Components, and Code. The C4 model comes with a recommended set of symbols indicating context, containers, components, and code. C4 model also encourages using a lot of text into the diagrams.&lt;br&gt;
I have not used C4 model myself, so could not comment much on it.&lt;br&gt;
I am not sure if C4 model may be enough to describe the whole cloud based architecture – which can meet all stakeholders. So, please do share your AWS architecture diagrams or ways with which you have used C4 model to describe the AWS architectures. This way, I and larger community can gain insights into C4 models and also use it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://www.cs.ubc.ca/~gregor/teaching/papers/4+1view-architecture.pdf" rel="noopener noreferrer"&gt;4+1 Views&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
Philippe Kruchten has described 4+1 views in his &lt;a href="https://www.cs.ubc.ca/~gregor/teaching/papers/4+1view-architecture.pdf" rel="noopener noreferrer"&gt;IEEE article&lt;/a&gt;. The views represent the system from the different stakeholders' standpoint. The four views of the model are logical, development, process and physical view. Each view is represented by different types of UML diagrams. &lt;/p&gt;

&lt;p&gt;I have been practising 4+1 views from long time. I also have few guidelines for depicting a logical view. Logical view should remain agnostic to any cloud provider or specific technology stack.&lt;/p&gt;

&lt;p&gt;I use the official AWS icon set to depict deployment view. AWS has published the &lt;a href="https://aws.amazon.com/architecture/icons/" rel="noopener noreferrer"&gt;official icon set &lt;/a&gt; to build architectural diagrams. Its use bring consistency among the different AWS cloud practitioners and users. You can explore the above link and see that the icon set is also made available for many diagramming tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  Logical View Diagrams Guidelines:
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Develop your mental model of the solution before making any drawings. Without having a mental model, you will fail to draw any diagram.&lt;/li&gt;
&lt;li&gt;Always think about maintaining conceptual integrity as solution architect. Does the system look like cohesive enough to serve its purpose? Does the system subcomponents are having single purpose of existence? These are some questions can help you to keep check on conceptual integrity.&lt;/li&gt;
&lt;li&gt;Use consistent shape and forms to communicate different  subsystems and components.&lt;/li&gt;
&lt;li&gt;You may find C4 model useful to depict the logical view.&lt;/li&gt;
&lt;li&gt;Use simple shapes to depict components across the system. Do not mix vendor specific symbols to represent the logical view. e.g. using of AWS icons to represent components in logical view diagrams. &lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Physical View Diagrams Guidelines (AWS Architectural Diagrams Guidelines):
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Network diagrams and deployment diagrams are like actual builds. You can test them before actually building the real infrastructure. It is a simple but effective method of testing your infrastructure. Data flows or packet flows traceability makes these diagrams a very valuable asset.&lt;/li&gt;
&lt;li&gt;Consistency in diagrams is key characteristics of a great diagram. e.g. Do not represent EC2 instance, with two different icons. Use the latest official AWS diagramming icon set. There has been three iterations of the icon sets. So if you select one version, please use it without mixing other version icon set symbols.&lt;/li&gt;
&lt;li&gt;Depict one or most two flows into one single diagram. Do not try to showcase every flow and every resource in one single diagram.&lt;/li&gt;
&lt;li&gt;AWS reference architectural diagrams &lt;a href="https://aws.amazon.com/architecture/reference-architecture-diagrams" rel="noopener noreferrer"&gt;reference architecture diagrams&lt;/a&gt; are one-pagers for conversations and having something handy. Your intention and usage purpose may vary, so do not copy these style of diagramming all the time.&lt;/li&gt;
&lt;li&gt;Put the title of the diagram on top. The title should be communicating the system and the diagram's purpose or intent.&lt;/li&gt;
&lt;li&gt;Depict the AWS account boundary, even if your solution has a single AWS account. For multi-account scenarios, show only  participating accounts of the system or subsystem. In such cases, it is better to prepare a separate multi-account diagram. &lt;/li&gt;
&lt;li&gt;Make sure the diagrams are representing global, regional and zonal AWS services as per their scopes. e.g. S3 is a global service, so it should live inside account but not within VPC. VPC is regional service, hence it should live in a region. &lt;/li&gt;
&lt;li&gt;Avoid too many lines to represent each relationship or data flow between resources.  In such cases, apply different strategy, e.g. representing lines with different colors or not drawing the connections or skipping the connection itself. e.g. blue line represents the traffic flowing from US-East-1 region and red line represents traffic flowing from EU-West-1 region.&lt;/li&gt;
&lt;li&gt;Do use standard conventions that are set by AWS or used in community. But, do not assume, everyone is aware of such conventions. e.g. private subnets shown with blue background and Public subnets in VPC are always depicted with green background.&lt;/li&gt;
&lt;li&gt;Architectural diagrams are part of the knowledge base of your organization. It has long-lasting value. Architectural diagrams can lose value, if implementation varies over the period of time. So, please ensure period review and invest time in maintaining the architectural diagrams.&lt;/li&gt;
&lt;li&gt;At least there should be one diagram representing the exact systems' production environment. If you work with development or test or other more environments, you can also have the diagrams representing them, but it is not necessary. &lt;/li&gt;
&lt;li&gt;Please do check the arrow directions that your flow is depicting.&lt;/li&gt;
&lt;li&gt;Show return traffic with intermittent arrows.&lt;/li&gt;
&lt;li&gt;Show logical grouping, e.g. group of lambdas representing services with a box with intermittent lines.&lt;/li&gt;
&lt;li&gt;Always do peer-review of system architecture and the diagrams. Make sure, your peers can understand and interpret the diagrams. 
If your peers have to ask a lot of questions or you need to describe some part of the system more, then you may think to revisit the diagrams. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;I am looking forward to enhancing this post and publish update based on the feedback I receive. So, feel free to share your views in comments. &lt;/p&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;a href="https://www.infoq.com/articles/crafting-architectural-diagrams/" rel="noopener noreferrer"&gt;https://www.infoq.com/articles/crafting-architectural-diagrams/&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;The Mythical Man-Month: Essays on Software Engineering, Frederick Brooks&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>architecture</category>
      <category>bestpractices</category>
      <category>diagrams</category>
    </item>
  </channel>
</rss>
