Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Domain Driven Design - Strategic Patterns and Microservices

118 views

Published on

Presentation describes Domain Driven Design - approach to create applications driven by business domain. I show how to split your monolith base on DDD strategic patterns.

Published in: Internet
  • Be the first to comment

Domain Driven Design - Strategic Patterns and Microservices

  1. 1. 1 Domain Driven Design Strategic design & Microservices http://radblog.pl/DDD
  2. 2. 2 WHY SHOULD YOU EVEN CARE?
  3. 3. 3 radblog.pl @RadekMaziarkaobjectivity.co.uk Radek Maziarka
  4. 4. 4
  5. 5. 5 Monolith Microservices
  6. 6. 6 Modularity – the final frontierŁukasz Szydło at Boiling Frogs 2018 NO YES NO Monolith YES Microservices DISTRIBUTED MODULAR Distributed Monolith
  7. 7. 7 Ecommerce platform Multiple areas in selling products NOTIFICATIONS DELIVERY PRODUCT MANAGEMENT ORDERSSTORE ACCOUNTS
  8. 8. 8 Splitting Monolith by distributionMost common transition to microservices Store Func 2 Account Func 2 Delivery Func 1 Store Func 3 Delivery Func 2 Delivery Func 3 Order Func 1 Order Func 3 Account Func 1 Store Func 1 Order Func 2 Account Func 3 All Func in one DB Delivery Func 2 Store Func 3 Delivery Func 3 App 2-Func DB Order Func 1 Order Func 3 Account Func 2 2-Func DB Store Func 2 Delivery Func 1 Account Func 1 3-Func DB Order Func 2 Store Func 1 Account Func 3 3-Func DB Service 1 Service 2 Service 3 Service 4
  9. 9. 9 Monolith splitted by distributionMicroservices fitness check 3 TRANSACTION INSIDE SERVICE BUSINESS FOCUSED SERVICES SINGLE DATA OWNERSHIP2 1 Delivery Func 2 Store Func 3 Delivery Func 3 2-Func DB Order Func 1 Order Func 3 Account Func 2 2-Func DB Store Func 2 Delivery Func 1 Account Func 1 3-Func DB Order Func 2 Store Func 1 Account Func 3 3-Func DB Service 1 Service 2 Service 3 Service 4 4 INDEPENDENT DEPLOYMENTS Func mix in one DB V2 V2 V2
  10. 10. 10 Distributed MonolithDisadvantages of distributed big ball of mud 3 DISTRIBUTED TRANSACTION MIXED SERVICES NO DATA OWNERSHIP2 1 Delivery Func 2 Store Func 3 Delivery Func 3 Order Func 1 Order Func 3 Account Func 2 Store Func 2 Delivery Func 1 Account Func 1 Order Func 2 Store Func 1 Account Func 3 4 DEPENDENT DEPLOYMENTS 2-Func DB 2-Func DB 3-Func DB 3-Func DB Service 1 Service 2 Service 3 Service 4
  11. 11. 11 Distributed Monolith - articlesWhy you should not take this step
  12. 12. 12 JAKUB NABRDALIK MICROSERVICES ARE TECHNICAL SOLUTION And developers love technical solutions Conway’s revenge - Bydgoszcz JUG - https://www.youtube.com/watch?v=UhIIpUQ-i38 Mentor in Bottega IT Solution
  13. 13. 13
  14. 14. 14 Modularity – the final frontierŁukasz Szydło at Boiling Frogs 2018 NO YES NO Monolith YES Microservices DISTRIBUTED MODULAR Modular Monolith Distributed Monolith DDD
  15. 15. 15 Domain Driven Design Tactical patternsStrategic design Aggregates Repositories Entities Services Events Dependency Injection Modules Factories Layers Core domain Sub-domain DomainUbiquitous Language Domain model Context Map Context Generic Subdomain Bounded Context
  16. 16. 17 Domain Driven Design In ecommerce domain
  17. 17. 18 UBIQUITOUS LANGUAGE
  18. 18. 19 3 ADD ORDER UPDATE SHIPPING 2 1 Customer storiesClient actions in a store 4 ITEMS COLLECTION DELETE ORDER
  19. 19. 20 3 SPOKEN LANGUAGE MUST REFER TO BUSINESS LANGUAGE WILL EVOLVE WITH UNDERSTANDING DOMAIN SHARED LANGUAGE FROM BUSINESS TO CODEBASE2 1 Shared understandingCommon language between people User Client Add order Place order Update delivery Change delivery date Items collection Product catalogue Fast shipping Express delivery
  20. 20. 21 Deeper understanding of business Code adjusted to business needs Better cooperation with the client Ubiquitous LanguageBenefits of using UL
  21. 21. 22 BOUNDED CONTEXT
  22. 22. 23 ShippingIn online store platform 3 CRUCIAL CONTEXT CLIENT WILL FOCUS ON IT GENERATE A LOT OF MONEY2 1
  23. 23. 24 3 CORE DOMAINS GENERIC SUBDOMAINS SUPPORTING SUBDOMAINS2 1 Different importanceDomains are not equally significant Orders Store Delivery Notifications Account
  24. 24. 25 User in ecommerce contextDifferent meanings of users ACCOUNTSDELIVERYSTORE ORDERS • Shopper who looks for a products • Can add products to basket • Customer who bought placed order • Can change payment • User in store account • Can check personal data • Recipient who gets delivery • Can change change delivery address
  25. 25. 26 3 LOGICAL BOUNDARY BETWEEN UNDERSTANDINGS UNIFIED MODEL DOES NOT EXISTS DIFFERENT MODEL FUNCTIONS AND DATA STRUCTURE2 1 Bounded contextThings has different meaning between contexts CustomerOrder Payment Products Recipient Delivery Company Address Orders Delivery
  26. 26. 27 Modules divided from business perspective Solution adjusted to use-case Team bounded to single context Bounded ContextBenefits of using BC
  27. 27. 28 CONTEXT MAP
  28. 28. 29 3 DIFFERENT WAYS OF INTEGRATIONS SEPARATE WAYS AS INTEGRATION APPROACH TRANSLATIONS BETWEEN CONTEXT2 1 Context mapApproaches of communications between contexts Orders Store Shipping Notifications Down Up Shared Kernel Shared Kernel Layer Partnership Legacy Reporting Separate Ways
  29. 29. 30 More effective integration between contexts Better informed decisions Organized, business architecture Context MapBenefits of using CM
  30. 30. 31
  31. 31. 32 Monolith -> Modular MonolithLess common transition to microservices Store Func 2 Account Func 2 Delivery Func 1 Store Func 3 Delivery Func 2 Delivery Func 3 Order Func 1 Order Func 3 Account Func 2 Store Func 1 Order Func 2 Account Func 3 All Func in one DB Delivery Func 2 Delivery Func 3 Delivery Func 3 App Order Func 1 Order Func 3 Account Func 2 Store Func 2 Store Func 3 Store Func 1 Modules inside DB Account Func 2 Account Func 1 Account Func 3 Store Module Account Module Delivery Module Order Module App
  32. 32. 33 Modular Monolith -> MicroservicesTransition to microservices step by step Delivery Func 2 Delivery Func 3 Delivery Func 3 Order Func 1 Order Func 3 Account Func 2 Store Func 2 Store Func 3 Store Func 1 Modules inside DB Account Func 2 Account Func 1 Account Func 3 App 1 Delivery Func 2 Delivery Func 3 Delivery Func 3 Order Func 1 Order Func 3 Account Func 2 Store Func 2 Store Func 3 Store Func 1 Modules inside DB Account Func 2 Account Func 1 Account Func 3 App Store DB Delivery DB Store Module Account Module Delivery Module Order Module Store Service Account Module Delivery Service Order Module
  33. 33. 34 Monolith splitted by modularizationMicroservices fitness check Delivery Func 2 Delivery Func 3 Delivery Func 3 Order Func 1 Order Func 3 Account Func 2 Store Func 2 Store Func 3 Store Func 1 Account Func 2 Account Func 1 Account Func 3 Store DB Delivery DB Account DB Order DB 3 TRANSACTION INSIDE SERVICE BUSINESS FOCUSED SERVICES SINGLE DATA OWNERSHIP2 1 4 INDEPENDENT DEPLOYMENTS Store Service Account Service Delivery Service Order Service
  34. 34. 35 Microservices DDD
  35. 35. 36 radblog.pl/DDD Articles: •Weronika Łabaj - DDD Ultra-Lite •Herberto Graca - Domain-Driven Design •Carbon Five - Ubiquitous Language & the joy of naming •Sapiens Work - DDD - The Bounded Context Explained •Philip Brown - Strategies for Integrating Bounded Contexts •Sebastian Gębski - The awesomeness of Modular Monolith •Microsoft - Tackling Business Complexity in a Microservice with DDD and CQRS Patterns •Berke Sokhan - Domain Driven Design for Services Architecture Videos: •DevTalk - DDD with Sławomir Sobótka •DevTalk Trio - DDD •Domain Driven Design: The Good Parts - Jimmy Bogard •What is Domain Driven Design? •DDD & Microservices: At Last, Some Boundaries! •7 Reasons Why DDD Projects Fail Books: •Eric Evans - Domain Driven Design •Vernon Vaughn - Implementing Domain-Driven Design •Vernon Vaughn - Domain-Driven Design Distilled •Sam Newman - Building Microservices: Designing Fine-Grained Systems
  36. 36. 37 radblog.pl/DDD radblog.pl/DDD-form

×