<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Magomed Chatuev on Medium]]></title>
        <description><![CDATA[Stories by Magomed Chatuev on Medium]]></description>
        <link>https://medium.com/@chatuev?source=rss-167cc85be6ac------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*D0MyOPLbnfwAEg4U.</url>
            <title>Stories by Magomed Chatuev on Medium</title>
            <link>https://medium.com/@chatuev?source=rss-167cc85be6ac------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 08:18:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@chatuev/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Big Picture Event Storming]]></title>
            <link>https://medium.com/@chatuev/big-picture-event-storming-7a1fe18ffabb?source=rss-167cc85be6ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a1fe18ffabb</guid>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[domain-driven-design]]></category>
            <category><![CDATA[ddd]]></category>
            <category><![CDATA[eventstorming]]></category>
            <dc:creator><![CDATA[Magomed Chatuev]]></dc:creator>
            <pubDate>Mon, 21 Sep 2020 11:36:46 GMT</pubDate>
            <atom:updated>2020-09-29T19:38:18.507Z</atom:updated>
            <content:encoded><![CDATA[<p>In the <a href="https://medium.com/@chatuev/ddd-for-microservices-4778a363c071">first article</a> in the series about using the Domain-Driven approach for microservices design, we made a dive into DDD and focused on Strategic Patterns. Following Vaughn Vernon, the core of Strategic Patterns is, <strong>“Ubiquitous Language in an explicitly defined Bounded Context”</strong>.</p><p>UL, being spoken by <strong>all parties</strong> involved in the software development process, reveals the evolution of the business domain and reflects its changes in Bounded Contexts. Rewording, the <strong>UL</strong> is what defines <strong>Bounded Contexts</strong>, and the evolving language shapes the business domain model.</p><p>In my experience, in order to utilize DDD efficiently, it is better to start with domain discovery, knowledge sharing, and collecting the UL.</p><p>In order to discover the domain in-depth and precisely collect the Ubiquitous Language, we need to create a shared pool of business-knowledge. In practice, the knowledge about Business Domain has a very diverse nature and is spread through multiple experts with different backgrounds and positions: stakeholders, Product Owner(s), UX/UI designers, Engineers, Sales, Customer Care managers, etc.</p><p>Fortunately, in the world of DDD, there’s an underappreciated brainstorming technique called <strong>Event Storming</strong>, which helps to manage knowledge about the current state and future opportunities of the business domain. Event storming was created by a DDD practitioner and consultant Alberto Brandolini and is now widely used to reach the use of DDD.</p><p>Event storming is a brainstorming workshop where product delivery participants with different expertise share their part of business knowledge expressing it on colorful sticky notes on a wide wall.</p><p>What makes Event storming so efficient, is that it is a rapid, lightweight, intense, and highly interactive and collaborative workshop. It’s a synthesis of facilitated group learning practices from <a href="http://gamestorming.com/">Gamestorming</a> and the principles of D<a href="https://medium.com/@chatuev/ddd-for-microservices-4778a363c071">omain-Driven design</a> (DDD). The event storming isn’t limited to software development and could be used to tackle any business domain.</p><p>There’re different types of event storming workshops. A Big Picture event is usually used to discover business domain and share knowledge and usually ran in total isolation from software design activities. The participants should mainly consist of businesspeople: stakeholders, product owners, customer care, sales, etc.<br>A Sofware Design event storming is more focused on system design and involves developers, product owners, UX/UI designers, and engineering managers.</p><p><strong>How to Event Storm?<br></strong>In this article, we focus on a Big Picture. <br>First of all, decide on the boundaries of the business domain you’re gonna discover. On a Big picture event storming, you may tackle the whole business, or narrow down your focus to specific subdomains. Understanding the scale will help you to define the invitee list.</p><p>The gems of any brainstorming are people and their knowledge. So, for a successful event storming, inviting the right people with appropriate knowledge is essential as well. The ideal number of participants could depend on the nature of your business, but I found 8–10 to be the optimal number. Try to diversify the participants by their knowledge areas and expertise, so the group together owns the business knowledge about the part of the business you are going to discover.</p><p><strong>Preparation<br></strong>Now, prepare the necessary supply. If you’re going to do an offline event storming, you need a room with an 8–10 meters-long wall, the bigger the better. You’ll also need a paper roll of the same length and 70–100 cm height and a <a href="http://here&/#39;re%20the%20sticky%20notes%20you%20need">bunch of sticky notes</a>. A cheap white plotter paper roll works perfectly. The roll is folded to the wall and the notes will be stuck there.</p><p>For online event storming, I found the <a href="https://miro.com/">Miro</a> to be a very convenient tool for it. The pic above is taken from a workshop I ran during the Coronavirus lockdown, which proves it’s convenient for online brainstorming. All the following examples in the article are done using the same tool.</p><p>As mentioned above, the knowledge is expressed on colorful sticky notes, so you’ll need them as well. Below is a picture from where you can get the color, size, and purpose of each. I’ll explain each type of artifact in detail later in the article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UahWpqNOu0pdlcuyoq9anQ.jpeg" /><figcaption><strong>Pic 1. Sticky notes</strong></figcaption></figure><p>And not least, prepare markers for each of the participants to write down on the sticky notes.</p><p><strong>Time<br></strong>The length of an event storming depends on the size of the subdomain you’re going to storm. It’s very useful to run a day-long big-picture session for the first time in order to understand the scope of your domain, its’ complexity, and the most challenging parts. Just make sure, to have necessary breaks and some food and drinks to keep the participants fresh.</p><p>For the future stormings, where you may focus on specific subdomains and discover particular problems, 2-3 hours-long sessions with a short break in the middle could be optimal.</p><p><strong>Let’s start<br></strong>The scenario of the technique is to assess the current state of business first, and then to discover the most effective areas for improvements. So keep focus on the current state of the business domain.<br>To understand event storming let’s get familiar with the key artifacts.</p><p><strong>Domain Event</strong></p><p>Any event storming starts with collecting the <em>knowledge</em> about your business, expressed in a form of <strong><em>Domain Events</em></strong>, which are stuck to the wall in time order from left to right.</p><p>A <strong><em>Domain Event</em></strong> is any event that is important for your business and makes an explicit impact on it. The event could happen inside or outside your business system. By convention, each event is expressed in a past term verb, written down on an <em>orange</em> sticky note.</p><p>To lower the entry threshold for participants, the facilitator usually makes the first step by sticking <em>pivotal events</em>, which emphasize the major happenings in the business from end-to-end.</p><p>Following the example of a hailing application from the <a href="https://medium.com/@chatuev/ddd-for-microservices-4778a363c071">first article</a>, the pivotal events could be: Booking is requested, Booking is accepted, Ride is started, Ride is finished. Bellow is how the pivotal events could be distributed on a 10 meters-long wall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VzK1AGzhkIc4Zl-J" /><figcaption><em>Picture 2. Pivotal events</em>.</figcaption></figure><p>Now the participants can start fulfilling the gaps between and around the pivotals.</p><p>It is the most important part of the whole storming, where the common goal is to share maximum domain knowledge from each of the participants.</p><p>Try to keep chaos, and facilitate knowledge holders to only write down the events and stick them to the wall straight away without validation from the others. Even if the events are expressed in long sentences and not in the past term, or duplicate each other, don’t interrupt the knowledge sharing flow, and let people brainstorm.</p><p>If you see discussion circles, then jump in and support by answering questions and solving struggles. Keep the process interactive by supporting the highest possible level of involvement of everyone for at least 20–30 mins.</p><p>Remember, that the events should be ordered in time from left to right. Reminding people to keep the order, at least partially, during the first phase, will help to build a more consistent event flow.</p><p>In about 30 minutes, depending on the size of your domain, the activity will slow down and people start just looking to the wall or run discussions without any outcome onto the wall. That is a sign to wrap up the first phase and go to the next one — a walkthrough.</p><p><strong>Walkthrough or Storytelling<br></strong>At this moment, the majority of domain knowledge is already on the wall. And your main goal is to clean up, order and structure it by walking through the wall from left to right and audibly reading the story written on the sticky notes, clarifying and asking questions to the authors — knowledge holders.</p><p>If the knowledge holders experience an event storming the first time, then the sticky notes are very likely to look like on the picture below. It represents just the part of the wall, and the pivotal events from the previous picture are circled here on Pic.3. All are enumerated only in order to easier reference them in the article.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JqE9TiP-TyHOUsFd" /><figcaption><em>Picture 3. Starting walkthrough</em></figcaption></figure><p>As you see, most of the formulations are not following the policy of the ideal domain event, to be a short statement in a past term verb. Also, some of them are duplicative by meaning and/or ordered incorrectly, and even grammatically incorrect. Let’s walk through the wall and fix it.</p><p>The 1 and 2 are duplicative, and the 2 has more sense within the domain. Also, the 2 is not fully correct, because not the Driver, but rather a Car is looked up for. It could be rewritten as “Cars are looked up” or “Cars are looked up by Passenger” or “Passenger looked up for Cars”. Mentioning the Passenger here is important, but not mandatory. So, let’s delete the 1 and replace the 2 with “Cars are looked up”.</p><p>The 3 and 4 are duplicative as well. Also, 3 is not correct. Passenger doesn’t request a particular driver, but rather just requests a Booking. So, let’s delete the 3 and leave 4.</p><p>After the cleanup entry, let’s ask the knowledge holders to zoom in to the two following sticky notes and validate the flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zdQtnrPUi8Y2zPt3" /></figure><p>If anything is missed or should be changed here? Well, no need to be an expert, to see missing events. And the Product Owner could correct you, that one event prior to the car lookup is “Pick Up Point address is entered”. And one after is “Car class is selected”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pT-uOERb2sri5iPO" /></figure><p>Another question, which could arise, is why we make a Booking, not a Car request, while Cars are looked up. It is a common case of ambiguity of entities in any business domain. And event storming sessions always benefit from such kind of discussions. In this particular case, someone, e.g. UX/UI designer, could have a strong opinion that from the Passenger’s perspective it is a Car to be requested. But, some of the stakeholders could object that the physical Car is complemented with a Driver, Customer Care support, Payment gateway, and many other details, that are packed into a service unit, which they get used to calling a Booking.</p><p>So, the settled terms of <strong><em>Car</em></strong> and <strong><em>Booking</em></strong> are important additions to the Ubiquitous Language, which I highly recommend to update after each event storming. The candidates for UL in this article are highlighted by <strong><em>bold italic</em></strong><em>, </em>and we will add them to Ubiquitous Language later in the article.</p><p>For now, let’s clarify the meaning of <strong><em>Booking</em></strong> with a <em>Definition </em>artifact, that is written down on a big white sticky note. You can see it on the Pic. 4 below. We’ll talk about <em>Definitions </em>in detail soon, but now let’s continue with the event flow.</p><p>Let’s continue audibly reading the story, written on the other sticky notes on the Pic. 3: “After Booking is requested, Passenger may cancel it”… sounds valid. Note #5 could be reworded to “Booking is canceled” event, which is performed by Passenger.</p><p>Let’s read the story again: “After Booking is requested, Passenger may cancel it”… sounds better.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*i_d5HV5InSXUVBZ7" /></figure><p>As you can see, the <em>Booking is Accepted </em>and <em>Booking is Canceled </em>are placed in parallel to reflect two possible event flows.</p><p><strong>And again, what about the order?<br></strong>What happens after the Booking is canceled?<br>If the cancelation is possible only after Booking is requested?<br>If no one raises a point, then maybe we could clarify it with an expert.</p><blockquote>- Sure! Passengers may cancel a Booking at any moment before a Driver arrives at <strong><em>Pick Up</em></strong> <strong><em>Point</em></strong>. In our current scope it means both before and after a Booking is accepted by a Driver.</blockquote><blockquote>- <strong><em>Pick Up Point</em></strong>? Sounds like a starting point of a Passenger’s journey. When it is selected? And have you just mentioned a <em>Driver is Arrived</em><strong> </strong>event?</blockquote><blockquote>- Yes, we forgot to add the <em>Pick Up Point is Selected </em>event after the <em>Car Class is Selected. Driver is Arrived </em>is happening after the <em>Booking is Accepted </em>and before another business-critical event, <em>Ride is Started</em>.</blockquote><p>Finally, if a Booking is canceled, then Passenger is returned to the very beginning of the booking flow.</p><p>Let’s reflect that business knowledge in the event flow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BCGbVdtHDGkD2djG" /><figcaption><em>Picture 4. Ordered booking flow events</em></figcaption></figure><p>And we continue to walk through the wall and read the business story:</p><blockquote>- After Booking is requested, it could be either accepted or canceled…</blockquote><blockquote>- “Wait!” — said the Sales Manager — “According to the definition, Booking is a system of services, requested by a Passenger, including Car, driver, CC support, etc. So, Driver doesn’t accept Bookings, but <strong><em>Offers</em></strong> — it is what we call it.”</blockquote><blockquote>- Could you please write down the definition of Offer on a big white sticky note and stick it to the wall? Also, please clarify when and how Offer appears.</blockquote><blockquote>- Creation of any <strong><em>Booking</em></strong> triggers creation of a new <strong><em>Offer</em></strong>.</blockquote><p><strong>Solving the intersection of sub-domains<br></strong>From the first article about DDD, <a href="https://medium.com/@chatuev/ddd-for-microservices-4778a363c071">Strategic Domain-Driven Design</a>, we know that “If a team starts using a new term to express an existing concept or an existing term is used to express a new meaning, then it is a red flag for the team that the subdomain’s boundaries are overlapping.”</p><p>Initially, in the hailing business domain, <strong><em>Booking </em></strong>was used as a universal term to mean a service unit in both Passenger and Driver subdomains. With the evolution of the domain, the term started to have more specific meanings for each of the Passenger and Driver subdomains, and thus was split into <strong><em>Booking</em></strong> and <strong><em>Offer</em></strong>.</p><p>An even more explicit example of how a concept is split by contextual meanings is the last <em>Booking is Canceled </em>event. There are two actors, who could trigger the event, Passenger and Driver. Obviously, a single unit of a hailing service has very different meanings for them. <br>Roughly:</p><ul><li>Using a booking interface, a Passenger orders a taxi to move from point A to point B, and pays for it some amount, consisting of the Driver’s revenue, Company’s margin, and additional tips. For passengers, it happens mostly from time to time, of necessity to move from A to B.</li><li>Using another interface, a Driver selects an offer from the list. The offer has only the revenue, pickup and dropoff points, and contact info about the passenger. For Driver it is a job, so he does it regularly.</li></ul><p>Thus, the last <em>Booking is Canceled </em>could be triggered only by Passenger, while Driver may trigger <em>Offer is Canceled. A </em>Driver doesn’t interact directly with Bookings, but via Offers only.</p><p>Let’s reflect this contextual splitting of the <strong><em>Booking</em></strong> and <strong><em>Offer </em></strong>on the wall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Qosm_1nGTyd4I_Qc" /></figure><p>Event storming is very useful to identify and document such contextual distinctions. Sometimes, experts in different domains discover the evolution of a concept during the session itself. While explaining the meaning of a concept, experts provide distinct definitions and surprisingly find out that they’re already giving the same concept different context-specific meanings. It happens due to growing silos between people working in different sub-domains, and event storming is a very powerful tool to foster alignment and knowledge-sharing.</p><p>To keep the storming consistent, add definitions one by one as they appear. Now, Let’s stick them to the wall and continue the walkthrough after…</p><p><strong>Definitions<br></strong>As mentioned above, big white Definitions sticky notes are used to highlight business terms. While orange Events are first-class citizens in event storming, Definitions constitute the Ubiquitous Language.</p><p>During an event storming session, whenever you see or hear a business-specific term, acronym, or even informal slang, ask someone who mentioned it to write it down and stick to the wall above the events. By asking others to do that, you’ll facilitate a deeper involvement in the storming process, and often raise new questions and discussions within the group of participants.</p><p>Make sure that the definitions are explicit, context-specific, and include conditions, roles, and dependencies if any.</p><p>After the session, always add new definitions to the Ubiquitous Language. Personally, I’m using Confluence pages to collect the UL for each subdomain. After copying the terms from the storming wall to the Confluence page, share the updates with appropriate users, ask to validate, and necessarily remind others to use the UL in conversations, other workshops, UX/UI mockups, code, and everywhere in the context of the business.</p><p>Below are the definitions we’ve met so far.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0EP-SRX1Iky_MvOc" /></figure><p><strong>… <em>Continuing the walkthrough</em></strong></p><blockquote>- After Offer is accepted, the ride starts… Something important is definitely missed here.</blockquote><blockquote>- The “Driver<em> is Arrived”, </em>for sure. Or, if he didn’t arrive, then we call it <em>No Show</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0yfajoCcwDhJq4VV" /></figure><p>It’s common for people, who hadn’t had prior experience with event storming, to focus mostly on the core subdomains, like Booking and Offer in the hailing service. In this case, direct knowledge holders to the supporting subdomains, for example, Notifications and Payments, and discover events happening there.</p><p>After <em>Offer is accepted </em>and/or <em>Offer is canceled, </em>we could add a <em>Passenger is notified </em>event. And after <em>Booking is canceled </em>we may add <em>Driver is notified </em>event, but only in the case of an appropriate Offer is being already accepted by Driver. Such conditions, are documented with a Policy artifact, which we’ll talk about a bit later.</p><p>Below are some examples of events happening in supporting subdomains.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sZy5eMeUTCY1z_ZD" /></figure><p>I’ll not include it to the whole picture in order not to overload the narrative. But at the end of the article, an example of a real event storming result will be provided.</p><p><strong>Commands<br></strong>After you feel that most of the domain knowledge is reflected in events on the wall, focus on the Commands that trigger appropriate Events. Write down Commands, important for the business, on a light blue note and place left to the Event they spawn.</p><p>A Command is a message that represents the intention of a user, and could be expressed as an action, like <em>Request Booking, Cancel Booking, Request refund, etc</em>.</p><p>Let’s add them to our wall.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gdZMaKvBetJArU0I" /></figure><p>Besides users, Commands might also be triggered by time, documents, or external events.</p><p>The most frequent Command triggers are users, and in Event Storming, they are modeled with Actors pattern.</p><p><strong>Actors<br></strong>The Actor artifact in event storming is mimicked by a small yellow sticky note and reflects a user, who triggers a particular command. The size of the sticky note is smaller than the other quadrants, e.g. orange events or blue commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EEDYcSWnA0C-Nklw" /><figcaption><em>Picture 5. Adding actors</em></figcaption></figure><p>We don’t need to overload the whole picture with pinning an Actor to every event, but just enough to eliminate ambiguities. E.g., the last <em>Cancel Offer </em>could be triggered by Driver, and the <em>Cancel Booking </em>by Passenger.</p><p><strong>Policy<br></strong>Policy<strong> </strong>artifact is used to document conditions and policies for events to happen. So, on a storming wall a policy stays between a Domain Event and a Command. Policies are formalized like “Whenever…X, then…Y” or “If…X, then…Y”.</p><p>In our case, it could sound simply as “Whenever Booking is created, then create Offer”.</p><p>We use a big lilac post-it for policies.</p><p>Let’s put to the wall the definition of <strong><em>Offer</em></strong>, policy, and appropriate “Offer is created” event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7uJKnf8VI5UT407z" /></figure><p>You may notice that before we named the event <em>Booking is requested </em>instead of <em>Booking is created. </em>Events collected during event storming should reflect the most significant happenings in the business. And since we have split to <strong><em>Booking</em></strong> and <strong><em>Offer</em></strong>, then <em>Booking is created </em>event sounds more business-oriented. And at the same time, it is general enough to highlight the big picture. If we’d have an event storming for an in-depth discovery of just the Booking subdomain, then a chain of events could look like <em>Booking is requested, Booking is validated, Booking is created, etc. </em>Such sessions focused on a specific subdomain, make sense to run after a big-picture storming, which we’re exploring an example of.</p><p>Often, especially when a workshop format is new for the participants, they could know, but unintentionally not share valuable knowledge. Anticipating knowledge existence and facilitating sharing is a skill. Try to gain it by focusing on the domain and asking questions.</p><blockquote>- If cancellation of a <strong><em>Booking </em></strong>is appropriately reflected in the <strong><em>Offer?</em></strong></blockquote><blockquote>- Yes, then the <strong><em>Offer </em></strong>is cancelled as well</blockquote><blockquote>- Could you please document the policy on a big green sticky note: “Whenever a Booking is canceled and the Ride is not started yet, then cancel the appropriate Offer”.<em><br></em>And what happens if a Driver cancels Offer?</blockquote><blockquote>- Then the Booking is canceled.</blockquote><p>Those two policies were easy. But what if we have complex business conditions?</p><p>According to our domain experts, the last <em>Booking is canceled </em>event could, unlike the other cancellations, cause a penalty for the Passenger. E.g. depending on the time passed after the <em>Offer is Accepted </em>event. A Driver may also be penalized when he cancels an offer.</p><p>In event storming, such conditions are expressed by a Policy artifact on a big green or salad sticky note.</p><p>Let’s ask our knowledge experts from each of the Passenger and Driver subdomains to explain the penalty policies in detail. Here they are below.</p><ul><li>For the Passenger: if the booking cancellation is done in more than a half time to the <strong><em>Pick Up Time</em></strong>, then charge the Passenger with 10% of the Booking price. <br>And, if it is the 3rd cancellation during the last 24 hours, then the penalty is 50%.</li><li>For the Driver: if the offer cancellation is done in more than a half time to the <strong><em>Pick Up Time</em></strong>, then penalize the Driver for 20% of the Offer price.</li></ul><p>With help from the invitees, let’s stick the Booking cancelation policies and new definitions to the wall. The Offer cancelation policies should also be added, but I omit it to keep the picture lighter to read.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*CAmvJJAz10kbZ-50" /><figcaption><em>Picture 6. Policies</em></figcaption></figure><p>When the event flow is branching like after the <em>Offer is Created</em>, it’s helpful to use arrows to keep flows visually split and eliminate a mess. In the case of the next branching, e.g. into <em>Ride is Started </em>and <em>Offer is Canceled, </em>the arrows are redundant.</p><p>It is very important to understand and clarify to others, that branched flows are independent and only one of them lives in a moment.</p><p>So, even though the <em>Booking is Canceled </em>is placed later than the <em>Ride is Started</em> on time ax, it doesn’t mean that they are happening one after another. Those are two independent flows, and only one of them is active after the <em>Offer is Accepted </em>event.</p><p><strong>Comments<br></strong>Sometimes you may need to add a description in a free form to something in the domain. That is what the Comments artifact is used for. Comments are written on a small white sticky note and stuck to another artifact or just on a certain place on the wall.</p><p>If you have events that could happen in arbitrary order, then don’t put them one after another, but in the same flow, and add appropriate comments. Imagine, a Customer may choose a payment method right before starting a booking funnel or exactly before the <em>Booking is Requested </em>event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lfL3jo0SKDDyLea-" /></figure><p>Earlier, one of our knowledge-holders mentioned that a Booking could be canceled any time between <em>Booking is Created</em> and <em>Ride is Started </em>events. To make this knowledge explicit, it’s worth using the Comments.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/113/1*QXeLchgUkce2XO9pAyAjxA.jpeg" /></figure><p><strong>Improvements &amp; Opportunities<br></strong>One of the important advantages of the event storming’s interactive format is that it helps to identify inconsistencies, points for improvements, and find new opportunities for business domain development. Such moments could be raised by discussions with controversial opinions or when someone shares a lot of knowledge that is new to others. In order to document it, a small purple or magenta sticky note is used as an Improvements &amp; Opportunities artifact.</p><p>For example, in early-stage startups, such improvements may relate to automation if flat files, e.g. *.word or *.xlsx, are used to store, process, or share data. Or an improvement could be to introduce a conversational AI into the Customer Care subdomain to reduce waiting time.</p><p>An opportunity could be to advertise and sell satellite goods and services to a customer. For example, most hotel booking services, after customers have already paid for the main service already, offer to book a car or an excursion. Ticketing services are using a similar business model.</p><p>Let’s dive back into our interactive workshop and listen to a dialog between a Software Engineer and SMM specialist:</p><blockquote>- As a father and a hailing service user, during the booking funnel I’m missing option to choose from the Drivers who have a baby seat.</blockquote><blockquote>- We had it in the past, but then removed because any additional step between opening the application and clicking the “Confirm” button reduces conversion rate. But now we’re working to provide this option to the Bookings, which Drop Off Locations are kindergartens and schools.</blockquote><blockquote>- Nice! Let’s add it to the wall</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eJOA6TatpijnJpCh" /></figure><p>Someone may object, that the opportunity sounds much like a policy + event. But it’s often important to remember, that event storming should reflect the current state of your business domain. If you want to discover future development more in-depth, then run an event storming focusing on and documenting more with Improvements &amp; Opportunities artifact.</p><p><strong>Systems<br></strong>The last valuable subject we are going to discover in the big picture event storming is Systems.</p><p>A System could be anything that provides solutions in your business domain, e.g. a deployable service developed inside your company or external third-party providers that your company is integrated with. An example of an external system could be an email-service or push-notifications service which sends notifications to Passengers, checkout service, Excel sheet, Google file hosting, Facebook business page, or a smartphone which Passenger and Driver may use to call each other.</p><p>Systems are documented with a big pink post-it.</p><p>Below are two parts, which I extracted in order not to overload the picture, where you can see examples of Systems: Booking funnel, Booking system, Offer system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kTMRDJgfFsjChqWg" /><figcaption><em>Picture 6. Policies</em></figcaption></figure><p>Also, we may notice cases of commands being triggered by a system, but not by a persona: <em>Generate Offer </em>and<em> Notify Passenger.</em></p><p><strong>Ubiquitous Language<br></strong>A very important outcome of the workshop is UL. After each event storming it’s absolutely necessary to collect all the collected definitions to a dedicated place and agree on using them among the colleagues and also to reflect the UL in the programming code. More about the role of UL you can find in the previous article <a href="https://medium.com/@chatuev/ddd-for-microservices-4778a363c071">Strategic DDD</a>.</p><p><strong>Summary<br></strong>We have done the first part of business domain discovery with Big Picture Event Storming.</p><p>It gives us a picture of our business and reveals:</p><ul><li>data flow represented by events,</li><li>highlights points for improvements and opportunities</li><li>represents the integration of internal and external systems</li><li>helps to fulfill UL</li></ul><p>To give you a broader picture, below is a partial result of our storming. To think big, imagine the flow continued till the Ride is finished and rated. Then think about the hailing app having not just taxi, but also scooters, bikes and other transportation options. And now expand the business domain into the B2C and B2B contexts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VLJan24_ovhBueyy_KWtHQ.jpeg" /></figure><p>The next step to design microservices using DDD is to run Software Design Event Storming and shape future microservices using Bounded Contexts and DDD tactical patterns.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a1fe18ffabb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DDD for microservices]]></title>
            <link>https://medium.com/@chatuev/ddd-for-microservices-4778a363c071?source=rss-167cc85be6ac------2</link>
            <guid isPermaLink="false">https://medium.com/p/4778a363c071</guid>
            <category><![CDATA[software]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[software-design]]></category>
            <category><![CDATA[domain-driven-design]]></category>
            <dc:creator><![CDATA[Magomed Chatuev]]></dc:creator>
            <pubDate>Fri, 08 May 2020 14:53:18 GMT</pubDate>
            <atom:updated>2020-09-27T16:18:43.201Z</atom:updated>
            <content:encoded><![CDATA[<h3>Strategic Domain-Driven Design</h3><p><strong>UPD: </strong><a href="https://medium.com/@chatuev/big-picture-event-storming-7a1fe18ffabb">Article#2. Big picture Event storming</a></p><p>Microservice-based architecture became a standard for designing a modular scalable software architecture. At a certain moment of growth, many companies face challenges of splitting monolithic applications into microservices. One of the most complicated steps in such challenges is how to define the proper responsibilities of each microservice, which will not allow them to grow into a bunch of smaller monoliths. And how to communicate microservices while keeping a high level of maintainability and evolvability.</p><p>In a set of articles about using DDD for microservices design, I’d like to share my experience adopting Domain-Driven Design in tech companies and integrating it into a software development process.</p><p>These articles could help you to use DDD not only for decoupling monoliths or designing microservices-based architecture but also to better structure and communicate engineering teams.</p><h3><strong>Intro</strong></h3><p>Domain-Driven Design is a philosophy, methodology, and a set of patterns, used for designing software for complex business domains.</p><p>When starting developing software, many think about the data structures first to design the DB tables and connected classes and modules.</p><p>But DDD offers to reflect knowledge about your business domain to software design by using a set of techniques and design patterns.</p><p>As an example, let’s discover a simplified Uber-like hailing application.</p><p><strong>Passenger</strong> makes a <strong>Booking</strong>. And <strong>Driver</strong> monitors and accepts a <strong>Booking</strong> from a <strong>Bookings</strong> <strong>list</strong>.</p><p>How could the application be designed based on data structures?</p><p>At first glance, we have the same Booking data structure used in two applications, Passenger &amp; Driver. Location, payment method, and price of a Booking are presented to both parties. So, the whole solution could be designed as a set of connected tables with the Bookings table in the core.</p><p>Then, we add appropriate programming code units: modules, classes, and interfaces.</p><p>Since the data to be presented to both types of users has much in common, the code could partially have generic interfaces and a shared behavior. Thus we’ll design the hailing app as a single, all-encompassing model.</p><p>It could be dangerous because while the complexity grows with the number of entities and their relationships, each specific concept of Passenger and Driver will require functionality with more specific responsibilities.</p><p>E.g. for a passenger the Booking could have attributes such as Pickup Address and Price. The Pickup Address is the passenger’s current point of waiting and the start of the physical ride. Price includes all the fees to the application owners and the Driver and is processed as a money transfer from the Passenger’s account to the application’s account.</p><p>But for Driver, a Pickup Address is just an intermediate point, while the Ride starting point is the one where he accepted Booking. Price, shown to Passenger is not presented to Driver, but some margin is.</p><p>We can see that data of a single Booking needs lots of preprocessing before being presented to different parties and has different meanings depending on a context.</p><p>Without careful design, the system has chances to grow into a Big Ball of Mud — a monolithic application consisting of tightly coupled modules with lowly cohessed elements.</p><p>The maintenance complexity of such monoliths increases exponentially with time. Often we deal with legacy parts that are just working, but the knowledge about the logic of the feature is lost with time or gone with specific engineers who left the team already.</p><p>In contrast to a data schema-first approach, let’s try to reflect the business domain into the software systems with Domain-Driven Design patterns. DDD is tackling the complexity of the business domain by aligning domain experts on the problem space and engineers who will implement the solution space.</p><p>In its core, DDD consists of Strategic and Tactical design.</p><p>Strategic Design is a set of principles and patterns for maintaining model integrity, distilling the Business Domain Model, and working with multiple models. Strategic design is very useful to divide a large and complex business problem into multiple chunks with clear boundaries and specific responsibilities and build a high-level software design topology.</p><p>Tactical Design is a set of design patterns and building blocks that you can use to abstract low and mid-level components of the software. Tactical patterns are very hands-on addressing programming code and deal with classes and modules. The purpose of tactical design is to refine the result of Strategic patterns applied to a stage where it can be converted into a working code.</p><p>Domain-Driven Design is an evolving process consisting of iterative cycles of applying strategic and tactical design. You start with strategic design, followed by tactical design.</p><p>This article is mostly focused on what the problem space is and how its growth is addressed with DDD Strategic design.</p><h3>Strategic design</h3><p>Business <strong>Domain</strong> is the problem we are trying to solve with a software effort. So, the domain is the problem space, or <em>what </em>is addressed.</p><p>A domain can be split into <strong>Subdomains</strong>, e.g. Booking, Accounting, Identity Management.</p><p><strong>Domain model </strong>— is an abstraction of the domain, which incorporates the behavior and data necessary to satisfy business requirements. So, the <strong>Domain model</strong> is a solution space, or <em>how </em>we’re going to solve the business problem</p><p>The domain model is consisting of <strong>Bounded Contexts </strong>— segments of the solution.</p><p>Bounded Context is a semantic contextual boundary. This means that within the boundary each component of the software model has a specific meaning and does specific things. The components inside a Bounded Context are context-specific and semantically motivated.</p><blockquote><strong>Bounded Context is a semantic contextual boundary. This means that within the boundary each component of the software model has a specific meaning and does specific things.</strong></blockquote><blockquote><strong><em>©Vaughn Vernon. Domain-Driven Design Distilled.</em></strong></blockquote><h4><strong>Designing a Problem Space</strong></h4><p>At first, to structure the business domain, we split it into subdomains to modularize the problem space. Splitting a business domain into subdomains is not trivial. The main challenges with splitting relate to handling the boundaries: how to identify the boundaries of each context, their overlapping areas, and how to deal with those areas.</p><p>In the problem space of our hailing app example on a high level, we have two subdomains: Passengers application and Drivers application.</p><p>In the Passenger subdomain, a customer creates a booking request. Customers can use Vouchers and manage Payment methods.</p><p>In the Driver subdomain, a licensed Driver accepts a Booking from the list and manages the appropriate physical ride.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/732/0*_Z3Vv8L1aspsjD_G" /></figure><p><strong><em>Pic 1. Hailing app problem space</em></strong></p><p>In order to design a solution space, we need to match each subdomain to an appropriate <strong>Bounded Context</strong>.</p><p><strong>Designing a Solution Space</strong></p><blockquote><strong>In DDD, a Subdomain in the problem space is ideally mapped 1-to-1 to a Bounded Context in the solution space.</strong></blockquote><p>Let’s at first solve the most complex part, the overlapping of subdomains. The first option to solve the overlapping is a Shared Kernel<strong> </strong>pattern. Shared Kernel is used when several bounded contexts can share one or many common entities. Using Shared Kernel in our case would mean a direct matching of <em>subdomains</em> and <em>concepts</em> from the Pic1 into <em>Bounded Contexts</em> and <em>Entities</em> with shared Booking and Payment.</p><p>The second option is a distinct Bounded Context holding specific entities. From the perspective of microservices architecture, the second option is usually more preferred and sustainable in the long-term, as any code unit tends toward a single responsibility principle.</p><p>On Pic 2 a hailing app problem space is abstracted with distinct Entities living inside their own split Bounded Contexts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/0*omuz3ER82Y_NqToR" /></figure><p><strong><em>Pic 2. Hailing app solution space</em></strong></p><p>With time the hailing business is growing. We’re upgrading different subdomains and concepts inside them. Existing concepts, like Booking and/or Bookings list, could also expand into a new Back-office subdomain. Even the whole product could extend to a B2B market. As a result, the problem space is becoming complex and requires further iterations of investigation and matching to bounded contexts. So, with further iterations of business evolution, we need to loop over the problem space to find new subdomains and apply Strategic DDD again.</p><h4><strong>How to detect new subdomains?</strong></h4><p>If a team starts using a new term to express an existing concept or an existing term is used to express a new meaning, then it is a red flag for the team that the subdomain’s boundaries are overlapping.</p><p>The growing Business Domain is verbally expressed and shared with expanding <strong>vocabulary</strong> of the domain-specific terms and called <strong>Ubiquitous Language. UL</strong> is documented and <strong>spoken</strong> <strong>by</strong> <strong>all</strong> <strong>the collaborators</strong> of a tackled domain involved in the software development process. Rewording, it is called <strong>Ubiquitous</strong> because it is used ubiquitously by the engineers and the domain experts.</p><p>The <strong>UL</strong> is what defines <strong>Bounded Contexts</strong>, so the evolving language is shaping the business domain model.</p><p>Let’s speak about the hailing more in details and use the Booking concept as a meaningful example:</p><ul><li>Passenger makes a Booking with the attributes: <strong>Passenger Name</strong>, <strong>Pickup location</strong>, <strong>Drop Off location</strong>, <strong>Car class</strong>, <strong>Price</strong>, <strong>Payment Method</strong>, etc.</li><li>The Booking request triggers the creation of an <strong>Offer</strong> which is added to the Offers list monitored by Drivers and Back-office. Offer has <strong>Price </strong>for Drivers, <strong>Amount</strong> of Passengers, <strong>Special requests</strong>, Passenger personal details, like <strong>Phone, Name, </strong>and <strong>Rate.</strong></li><li>Driver accepts an Offer and starts a physical <strong>Ride </strong>to pick up the Passenger and manage the full A-to-B service<strong>. </strong>The <strong>Ride </strong>has <strong>Arrival time, Start time, Length, Final price, </strong>and many others.</li></ul><p>Reflecting on the evolving behavior and attributes, the Booking concept is starting to have different meanings in Passenger, Driver, and newly appeared Back-office subdomains. So, the Booking is naturally transforming and could be split into Booking, Ride, and Offer.</p><p>The next-iteration problem space looks like in Pic 3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/729/0*RK_8KW5xRBuoY4qr" /></figure><p><strong>Pic. 3. Evolution of Hailing app domain</strong></p><p>Growing further, the whole business can expand to the B2B market which will cause new meanings of existing concepts and evolution of subdomains. On each iteration of the domain discovery, it’s crucial to make the <strong>UL</strong> reacher, so the new meanings of concepts and new subdomains could be detected and reflected in future system design.</p><p>Concepts and subdomains of the evolved problem space are then again matched to entities and bounded contexts in the solution space.</p><p>Let’s sum up the learnings</p><p><strong>Ubiquitous Language </strong>and<strong> Bounded Context </strong>are<strong> strategic patterns </strong>in<strong> DDD.</strong></p><p>The Strategic patterns are used to design large Business Domain Models described By <strong>Ubiquitous Language </strong>spoken inside their specific <strong>Bounded Contexts.</strong></p><blockquote>In short, <strong>DDD </strong>is primarily about modeling a Ubiquitous Language in an explicitly defined <strong>Bounded Context</strong></blockquote><blockquote><strong><em>©Vaughn Vernon. Domain-Driven Design Distilled.</em></strong></blockquote><p>As you see, the DDD approach requires business domain experts and software engineers to closely align on problem discovery and solution design. This pays off with a clear understanding of a business domain and clear and specific responsibilities of future software components.</p><h3><strong>Summary</strong></h3><p>DDD strategic patterns are used to design abstractions of Business domain models incorporating behavior and data. By collecting and using Ubiquitous Language we can detect a change in current and birth of new business subdomains. By structuring the Bounded Contexts and their relationships we can build a high-level topology of modular software design. The modular design helps to build microservices with clear responsibilities and thus increase the maintainability and evolvability of the system.</p><p>If that said, more questions are coming into the mind.</p><p>In the <a href="https://medium.com/@chatuev/big-picture-event-storming-7a1fe18ffabb">next article, we’ll talk about <strong>Event Storming</strong></a><strong> </strong>workshop<strong>, </strong>which helps<strong> </strong>to facilitate the collaboration between domain experts and engineers and build UL.</p><p>Further, using the outcome of Event Storming, we’ll build a <strong>Context Map </strong>which helps to exactly define responsibilities and communications between microservices.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4778a363c071" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>