Slide 1

Slide 1 text

Implementing the planet's largest e-commerce site using vertical slices By Dennis van der Stelt

Slide 2

Slide 2 text

WHY VERTICAL SLICES Complex software systems stay maintainable with highly cohesive and low coupled slices FINDING SERVICE BOUNDARIES Use a well-known business process and find consistency boundaries and data ownership CODING VERTICAL SLICES Use data composition, service-oriented architecture, event-driven architecture, and more architectural styles

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

inventory orders website orders inventory where does it start Coupling products products

Slide 5

Slide 5 text

inventory products orders website orders products inventory where does it start Coupling

Slide 6

Slide 6 text

inventory products orders website orders products inventory products inventory orders orders products inventory Logical View Physical View where does it start Coupling

Slide 7

Slide 7 text

inventory products orders website orders products inventory products inventory orders orders products inventory Logical View Physical View where does it start Coupling

Slide 8

Slide 8 text

inventory products orders website orders products inventory products inventory orders orders products inventory Logical View Physical View WebAPI WebAPI WebAPI where does it start Coupling

Slide 9

Slide 9 text

inventory products orders website orders products inventory products inventory orders orders products inventory Logical View Physical View WebAPI WebAPI WebAPI where does it start Coupling

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

inventory products orders website orders products inventory products inventory orders orders products inventory Logical View Physical View WebAPI WebAPI WebAPI where does it end Coupling

Slide 12

Slide 12 text

inventory products orders website orders products inventory products inventory orders orders products inventory Logical View Physical View where does it end Coupling

Slide 13

Slide 13 text

inventory products orders website orders products inventory products inventory orders orders products inventory Logical View Physical View where does it end Coupling

Slide 14

Slide 14 text

inventory inventory where does it end Coupling

Slide 15

Slide 15 text

data storage where does it end Coupling front-end business logic

Slide 16

Slide 16 text

where does it end Coupling data storage front-end business logic

Slide 17

Slide 17 text

where does it end Coupling

Slide 18

Slide 18 text

where does it end Coupling 01 High Cohesion 02 Low Coupling 03 Maintainability 04 Concurrency 05 Conway’s Law

Slide 19

Slide 19 text

Autonomous microservices don’t share data. Period. Dennis van der Stelt Finding your service boundaries – a practical guide Adam Ralph Finding Service Boundaries – illustrated in healthcare Udi Dahan

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

OmNomNom Because beer is good, but beers are better.

Slide 23

Slide 23 text

Shopping Cart https://www.omnomnom.dev/abraxas/ Abraxas by Perennial Artisan Ales Proceed to checkout Subtotal: $42.00 Quantity Item Price $42.00 1 This list contains a gift. or Sign in for 1 click ordering. 1 start checkout

Slide 24

Slide 24 text

Where should we deliver your order? Enter a shipping address Full Name: https://www.omnomnom.dev/buy/shippingaddress/ Dennis van der Stelt Address Line 1: Van Zandvlietplein 1 City: Rotterdam Country: The Netherlands Ship to this Address 2 shipping address

Slide 25

Slide 25 text

When do you need it? Shipping from Amazon.com Abraxas https://www.omnomnom.dev/buy/delivery/ Perennial Artisan Ales Hard cover - New Continue Choose a delivery option $42.00 – Quantity: 1 Amazon Standard Shipping $7.98 – Averages 9-14 business days Amazon Expedited Shipping $20.98 – Averages 7-10 business days Amazon Priority Shipping $49.98 – Averages 2-5 business days 3 shipping method

Slide 26

Slide 26 text

When do you need it? Shipping from Amazon.com Abraxas https://www.omnomnom.dev/buy/delivery/ Perennial Artisan Ales Hard cover - New Continue Choose a delivery option $42.00 – Quantity: 1 Amazon Standard Shipping $7.98 – Averages 9-14 business days Amazon Expedited Shipping $20.98 – Averages 7-10 business days Amazon Priority Shipping $49.98 – Averages 2-5 business days 3 shipping method

Slide 27

Slide 27 text

Select a payment option Your credit and debit cards https://www.omnomnom.dev/buy/payment/ Amazon accepts all major credit and debit cards > Add a card Continue MasterCard ending in 2464 Dennis van der S… 09/2026 More payment options Please tell us the currency of your card My card is in US Dollar My card is in a different currency: select a currency 4 payment method

Slide 28

Slide 28 text

Review your order https://www.omnomnom.dev/buy/payment/ Shipping address Dennis van der Stelt Van Zandvlietplein 1 Rotterdam, The Netherlands Payment method ending in 2464 Billing Address Same as shipping address Estimated delivery: Aug 17, 2018 – Aug 21, 2018 Abraxas by Perennial Artisan Ales $42.00 - Quantity: 1 change change change Place your order Order Summary Items: Shipping: Total before tax: Estimated tax: Order Total $42.00 $7.98 $49.98 $0.00 $49.98 5 summary finalize

Slide 29

Slide 29 text

01 Service A ce C ProductId Name Description Image Category 1 02 Service A Service B ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 2 03 Service A Service B oductId Stock derId oductId uantity oductId ame escription age tegory 3 4 e A e B n 4 5 BOUNDARIES service Finding

Slide 30

Slide 30 text

01 ProductId Price Discount Service A Service C ProductId Name Description Image Category 1 02 Service A Service B ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 2 03 Service A Service B oductId Stock derId oductId uantity oductId ame escription age tegory 3 4 e A e B n 4 5 BOUNDARIES service Finding Shopping Cart https://www.omnomnom.dev/abraxas/ Abraxas by Perennial Artisan Ales Proceed to checkout Subtotal: $42.00 Quantity Item Price $42.00 1 This list contains a gift. or Sign in for 1 click ordering.

Slide 31

Slide 31 text

01 ProductId Price Discount Service A Service C ProductId Name Description Image Category 1 02 ProductId Price Discount Service A Service C Service B ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 2 03 Service A Service B oductId Stock derId oductId uantity oductId ame escription age tegory 3 4 e A e B n 4 5 BOUNDARIES service Finding Shopping Cart https://www.omnomnom.dev/abraxas/ Abraxas by Perennial Artisan Ales Proceed to checkout Subtotal: $42.00 Quantity Item Price $42.00 1 This list contains a gift. or Sign in for 1 click ordering.

Slide 32

Slide 32 text

01 ProductId Price Discount Service A Service C ProductId Name Description Image Category 1 02 ProductId Price Discount Service A Service C Service B ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 2 03 ProductId Price Discount OrderId ProductId PriceId DeliveryOptionId Quantity BillingAddress DeliveryOptionId Price DeliveryOptionId Type Description International OrderId CustomerId DeliveryOptionId ShippingAddress Service D Service A Service C Service B ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 3 4 e A e B n 4 5 BOUNDARIES service Finding When do you need it? Shipping from Amazon.com Patterns of Enterprise Application Ar… https://www.amazon.com/buy/delivery/ Martin Fowler Hard cover - New Continue Choose a delivery option $42.00 – Quantity: 1 Amazon Standard Shipping $7.98 – Averages 9-14 business days Amazon Expedited Shipping $20.98 – Averages 7-10 business days Amazon Priority Shipping $49.98 – Averages 2-5 business days

Slide 33

Slide 33 text

01 ProductId Price Discount Service A Service C ProductId Name Description Image Category 1 02 ProductId Price Discount Service A Service C Service B ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 2 03 ProductId Price Discount OrderId ProductId PriceId DeliveryOptionId Quantity BillingAddress DeliveryOptionId Price DeliveryOptionId Type Description International OrderId CustomerId DeliveryOptionId ShippingAddress Service D Service A Service C Service B ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 3 04 ProductId Price Discount OrderId ProductId PriceId DeliveryOptionId Quantity BillingAddress CreditCardId Cardholder LastDigits ExpiryDate Token DeliveryOptionId Price DeliveryOptionId Type Description International OrderId CustomerId DeliveryOptionId ShippingAddress Service D Service A Service C Service B Service E ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 4 5 BOUNDARIES service Finding Select a payment option Your credit and debit cards https://www.amazon.com/buy/payment/ Amazon accepts all major credit and debit cards > Add a card Continue MasterCard ending in 2464 Udi Dahan 09/2026 More payment options Please tell us the currency of your card My card is in US Dollar My card is in a different currency: select a currency

Slide 34

Slide 34 text

01 ProductId Price Discount Service A Service C ProductId Name Description Image Category 1 02 ProductId Price Discount Service A Service C Service B ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 2 03 ProductId Price Discount OrderId ProductId PriceId DeliveryOptionId Quantity BillingAddress DeliveryOptionId Price DeliveryOptionId Type Description International OrderId CustomerId DeliveryOptionId ShippingAddress Service D Service A Service C Service B ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 3 04 ProductId Price Discount OrderId ProductId PriceId DeliveryOptionId Quantity BillingAddress CreditCardId Cardholder LastDigits ExpiryDate Token DeliveryOptionId Price DeliveryOptionId Type Description International OrderId CustomerId DeliveryOptionId ShippingAddress Service D Service A Service C Service B Service E ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 4 05 ProductId Price Discount OrderId ProductId PriceId DeliveryOptionId Quantity BillingAddress CreditCardId Cardholder LastDigits ExpiryDate Token DeliveryOptionId Price DeliveryOptionId Type Description International OrderId CustomerId DeliveryOptionId ShippingAddress ProductId Reviews Stars Shipping Catalog Finance Catalog PaymentInfo Marketing ProductId InStock OrderId ProductId Quantity ProductId Name Description Image Category 5 BOUNDARIES service Finding Review your order https://www.amazon.com/buy/payment/ Shipping address Udi Dahan 20 Uri Tzvi Greenberg Street Haifa, Israel Payment method ending in 2464 Billing Address Same as shipping address Estimated delivery: Aug 17, 2018 – Aug 21, 2018 Patterns of Enterprise Application Architecture by Martin Fowler $42.00 - Quantity: 1 change change change Place your order Order Summary Items: Shipping: Total before tax: Estimated tax: Order Total $42.00 $7.98 $49.98 $0.00 $49.98

Slide 35

Slide 35 text

No content

Slide 36

Slide 36 text

No content

Slide 37

Slide 37 text

No content

Slide 38

Slide 38 text

COMPOSED UI Instead of starting with coupling in the database, we removed coupling as much as possible and did not introduce it until in the user interface. It’s possible to take it up even higher and introduce microviews that are deployed to the website. (I challenge you to a Pull Request in the GitHub repo)

Slide 39

Slide 39 text

SERVICE BUS Temporal coupling is removed by replacing RPC calls between services with messages using a service bus. Concepts like publish/subscribe, increased reliability and better performance Events are published across service boundaries and contain only the least volatile data; identifiers.

Slide 40

Slide 40 text

INVOICES Invoices and emails are also user interfaces where data needs to be composed from the back end. These are still owned by the system. Ask me how to integrate with third parties that don’t know anything about your service boundaries.

Slide 41

Slide 41 text

go.particular.net/dennis free 2-day video course on distributed systems and more…

Slide 42

Slide 42 text

Thanks go.particular.net/dennis free 2-day video course on distributed systems and more… for listening