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.

Serverless ddd

1,370 views

Published on

Presented at Serverless Tel Aviv Meetup, on April 25 2017

Published in: Software
  • Get access to 16,000 woodworking plans, Download 50 FREE Plans... ◆◆◆ http://tinyurl.com/yy9yh8fu
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Want to preview some of our plans? You can get 50 Woodworking Plans and a 440-Page "The Art of Woodworking" Book... Absolutely FREE ♥♥♥ http://tinyurl.com/y3hc8gpw
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • The 3 Secrets To Your Bulimia Recovery ★★★ http://scamcb.com/bulimiarec/pdf
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Want to preview some of our plans? You can get 50 Woodworking Plans and a 440-Page "The Art of Woodworking" Book... Absolutely FREE ♣♣♣ http://tinyurl.com/yy9yh8fu
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Serverless ddd

  1. 1. Serverless Domain-Driven Design At last some productivity Asher Sterkin asher.sterkin@gmail.com Serverless Meetup April 25, 2017, Tel-Aviv
  2. 2. About Myself ● Close to 40 years of experience in the software technology field ● VP Technology, Chief Technology Advisor Group, NDS (2010 - 2012) ● Distinguished Engineer, Office of CTO, Cisco Engineering (2012 - 2016) ● Today CTO at IRKI ● Focusing on software product line strategy ○ Lean Startup ○ Wardley Maps ○ (Strategic) Domain-Driven Design ○ Cynefin ○ Promise Theory ○ Serverless Architecture ○ ...
  3. 3. Metallic Sage Green Luster, Opaque Metallic Matte Galvanized SF Pink Blush, Opaque Galvanized Semi-Matte Metallic Dark Raspberry Iris, Opaque Metallic Matte Light Olive Luster, Opaque Metallic Matte
  4. 4. Serverless ←→ DDD ● DDD & Microservices ● Serverless → DDD ○ Strategic DDD ○ Tactical DDD ○ Serverless AI → DDD ● Serverless ← DDD ● Serverless DDD → Productivity
  5. 5. Video, Slides
  6. 6. Key Messages
  7. 7. Domain Model Ubiquitous Language Bounded Context Permeable Context Boundaries Result in BBoM Symptoms of Rotting Design ● Rigidity - hard to change ● Fragility - easy to break ● Immobility - hard to reuse ● Viscosity - hard to do the right thing ● Opacity - disorganized expression ● ...
  8. 8. 10 4+1 View of Software Architecture Conceptual Physical Process View Deployment View Logical View Use-Case View Implementation View End-user Functionality Programmers Software management Performance Scalability Throughput System integrators System topology Delivery, installation communication System engineering Analysts/Designers Structure P. Krutchen, “Architectural Blueprints - The “4+1” View Model of Software Architecture
  9. 9. 11 4+1 View of Software Architecture Conceptual Physical Process View Deployment View Logical View Use-Case View Implementation View End-user Functionality Programmers Software management Performance Scalability Throughput System integrators System topology Delivery, installation communication System engineering Analysts/Designers Structure Bounded Context → Microservice
  10. 10. Serverless → Strategic DDD
  11. 11. Strategic Domain-Driven Design Vernon Vaughn, “Implementing Domain-Driven Design”
  12. 12. Strategic Domain-Driven Design
  13. 13. Strategic Domain-Driven Design Fashion Accessories
  14. 14. Strategic Domain-Driven Design Fashion Accessories
  15. 15. Strategic Domain-Driven Design Fashion Accessories
  16. 16. Disorder
  17. 17. Disorder
  18. 18. Disorder
  19. 19. Pull Up/Push Down Pull up useful abstractions Push down support and generic stuff; control through OSS contributions Fashion Accessories There is no ideal core domain model sitting and waiting to be discovered. It’s more like attractor gradually emerging out of multiple “safe-to-fail” experimentations
  20. 20. Strategic Domain-Driven Design ● Compute ● Network ● Storage ● Intelligence Serverless ● 2D Shape ● 3D Shape ● ... Geometry ● Color ● ... Graphics Microservice = CF Stack? ERP, CRM, SCM, PLM, ECM, CAD, ... Taxes Shipment Web Site Inventory .... Fashion Accessories
  21. 21. Strategic Domain-Driven Design ● Compute ● Network ● Storage ● Intelligence Serverless BC ● 2D Shape ● 3D Shape ● ... Geometry ● Color ● ... Graphics Microservice = CF Stack? ERP, CRM, SCM, PLM, ECM, ... Taxes Shipment Web Site Inventory .... Fashion Accessories
  22. 22. Strategic Domain-Driven Design ● Compute ● Network ● Storage ● Intelligence Serverless BC ● 2D Shape ● 3D Shape ● ... Geometry ● Color ● ... Graphics Microservice = CF Stack? ERP, CRM, SCM, PLM, ECM, ... Taxes Shipment Web Site Inventory .... Fashion Accessories
  23. 23. Strategic Domain-Driven Design ● 2D Shape ● 3D Shape ● ... Geometry ● Color ● ... Graphics ● Compute ● Network ● Storage ● Intelligence Serverless BC Microservice = CF Stack? ERP, CRM, SCM, PLM, ECM, ... Taxes Shipment Web Site Inventory .... Fashion Accessories ...
  24. 24. Context Map is the Key ● 2D Shape ● 3D Shape ● ... Geometry ● Color ● ... Graphics ● Compute ● Network ● Storage ● Intelligence Serverless BC Microservice = CF Stack? ERP, CRM, SCM, PLM, ECM, ... Taxes Shipment Web Site Inventory .... Fashion Accessories ... ACL ACL ACL
  25. 25. Emerging Core Domain so Far Types Components Products Inventory Items Customers Manufacturers Vendors Catalog Items Shapes Colors Pictures
  26. 26. Amazon is Eating Software ... valuechain evolutionG C P U eTailer Service AIaaS FaaS PaaS IaaS SCM ... Web Scale Operation New Service
  27. 27. Amazon is Eating Software ... valuechain evolutionG C P U Video Service AIaaS FaaS PaaS IaaS Recommendations ... Cloud Native Ability to build a Web Scale Application is not a differentiator anymore!
  28. 28. Serverless Strategic DDD Prefer utility AIaaS Prefer product or utility SaaS Major effort Pull up useful abstractions Proper timing for API Push down support and generic stuff; control through OSS contributions
  29. 29. Serverless → Tactical DDD
  30. 30. Bounded Context Tactical DDD Patterns Domain Model Ubiquitous Language Nouns, Adjectives, Imperative Verbs, Interrogative Verbs, Perfect Tense Verbs Entities, Values, Commands, Queries, Events, Aggregates, Repository, Computational Services, Factories, ACL, Saga (Process Manager) Serverless Cloud Environment
  31. 31. Repository Strong Transaction Consistency + Invariant DDD Aggregate and Repository <<Aggregate Root>> Entity Entity Value Value Eventual Transaction Consistency Storage Command/ Query Request Processor Command or Query Requests Domain Events
  32. 32. (AWS) Serverless DDD Patterns ● Repository ○ CRUD ○ CQRS ○ CQRS/ES ○ CQRS/ES IoT Scale ● Computation Service ○ Function ○ Batch ○ Map/Reduce ● Saga (Process Manager)
  33. 33. Default Serverless DDD Repository (CRUD) DynamoDB Streams Command/Query Handler Domain Event Handler Strong vs. Eventual Consistency Bead Shape Bead Color Bead Product Type Component Type
  34. 34. Serverless DDD Repository (CQRS) DynamoDB Streams Command Handler Query View Builder Query Handler ● Ad-hoc vs. precomputed ● Inter- vs. Intra Aggregate Query View Store SOT Store ● Command vs. Query Storage optimization ● Query interface complexity Bead Color/Shape Compatibility
  35. 35. Serverless DDD Repository (CQRS/ES) DynamoDB Streams Command Handler Projection Builders Query Handler ● Ad-hoc vs. precomputed ● Inter- vs. Intra Aggregate Query View Store Event Store Snapshot Store ● Immutability ● Auditing Product Spec Product/Component Inventory
  36. 36. Event Store Patterns ● State Change Events (git style) ● Measurement/Observation (telemetry) ● Transaction/Account/Entry (accounting) ● Meaningful Domain Events
  37. 37. Snapshot Store Patterns ● Most Recent State ● State Change History ● Multiple Worlds
  38. 38. Serverless DDD Repository (CQRS/ES IoT Scale) Edge Command/Event Handler Cloud Command/Event Handler Thing Event Stream Thing Event Handlers Thing Snapshot View Thing Projection Builder Thing Event Store
  39. 39. Serverless DDD Computation Services Command/Query/Event Handler Computation Service Bead Color/Shape Permutations Bead Color Bead Shape Bead Component Most popular products Most popular colors per country Minimal inventory level per product ...
  40. 40. Serverless DDD Saga (Process Manager) Product Picture Album Building Raw Pictures Catalog Pictures Product Catalog Background Cleanup Color/Light Adjustments Resolution Transcoding
  41. 41. Serverless AI → DDD
  42. 42. ignore AI Irrelevance adopt AI Wasted time and resources
  43. 43. Serverless DDD AI Patterns ● Pereferrial Adapters: audio, video, picture, text ● Application Services: dynamic state machines ● Command/Query Request Processors: classification, matching ● Event Handlers: anomaly detection ● Computation Services: analysis, generation, transformation, optimization ● Batch Processing: feedback and learning
  44. 44. Serverless AI ← DDD Pereferrial Adapters Application Services Dynamic State Machines Application-level Stimulo Domain Services Command/Query Requests EventsRaw A/V/T Inputs Dynamic Classifications Anomaly Detection Event Processors Feedback and Training Pinterest/Instagram/Facebook/Twitter Feedback Processing Best Earrings Match Best Necklace Match Historical Data
  45. 45. Serverless → DDD What is Missing?
  46. 46. Serverless → DDD Wish List ● Support for Actor Model ● Support for Reactive Programming ● JavaScript, JSON and YAML are (cloud) machine-level languages - need something at higher level ● Simple modeling tool (lightweight UML) ● Fully fledged IDE supporting above ● Support for Semantic Maps (kind of AI service)
  47. 47. Serverless ← DDD
  48. 48. Serverless Creating this mess from Lambda Functions would not make it better
  49. 49. DDD for Serverless Use DDD Strategic and Tactical patterns as Serverless Architecture organizing principles to prevent ending with just a distributed version of BBoM.
  50. 50. One who increases flesh, increases worms; one who increases possessions, increases worry; one who increases wives, increases witchcraft; one who increases maidservants, increases promiscuity; one who increases man-servants, increases thievery; Pirkey Avot Chapter 2/7 ‫כשפים‬ ‫מרבה‬ ‫נשים‬ ‫מרבה‬ .‫דאגה‬ ‫מרבה‬ ‫נכסים‬ ‫מרבה‬ .‫רימה‬ ‫מרבה‬ ‫בשר‬ ‫.מרבה‬ ‫גזל‬ ‫מרבה‬ ‫עבדים‬ ‫מרבה‬ .‫זימה‬ ‫מרבה‬ ‫שפחות‬ ‫מרבה‬ Kohelet Chapter 1/18 18For in much wisdom is much vexation, and he who increases knowledge, increases pain. :‫ְאוֹב‬‫כ‬ַ‫מ‬ ‫ִיף‬‫ס‬‫יוֹ‬ ‫ַת‬‫ע‬ַ‫דּ‬ ‫ִיף‬‫ס‬‫ְיוֹ‬‫ו‬ ‫ַס‬‫ע‬ָ‫כּ‬ ‫ב‬ ָ‫ר‬ ‫ָה‬‫מ‬ְ‫כ‬ָ‫ח‬ ‫ֹב‬ ‫ְר‬‫בּ‬ ‫ִי‬‫כּ‬‫יח‬
  51. 51. Too Many Moving Parts ...
  52. 52. DDD for Serverless Treat ‘em all as Aggregate Repositories within the corresponding Bounded Context of Generic Infrastructure Sub-Domain
  53. 53. At Last Some Productivity
  54. 54. How to Measure Productivity? ● Lines of Code - well known anti-pattern ● Story Points - less well known anti-pattern (velocity is not productivity) ● Features - “feature train” (producing many features nobody needs) ● Value - too much depends on Product Owner; not under direct control ● Domain Insights - only domain experts could bring it → a lot of experimentation “Software Development is a Learning Process. Running code is byproduct.” A.Brandolini
  55. 55. “Consensus is poisonous for innovation” D. Snowden The last slide

×