Upgrade to Pro — share decks privately, control downloads, hide ads and more …

microxchg 2019 - A competitive food retail architecture with microservice

Sebastian
April 01, 2019

microxchg 2019 - A competitive food retail architecture with microservice

Sebastian

April 01, 2019
Tweet

More Decks by Sebastian

Other Decks in Technology

Transcript

  1. A competitive food retail architecture with microservices
    A five year journey
    Sebastian Gauder
    Software Architect eCommerce
    @rattakresch

    View full-size slide

  2. 3
    Details REWE Group
    Turnover
    >57 bn
    History
    >90 years
    Employees
    >345.000
    Inudstries
    Food Retail,
    Tourism,
    DIY
    Shops
    >15.000

    View full-size slide

  3. Our history - the overview

    View full-size slide

  4. Service/team growth
    2014
    40 15
    100
    28
    200
    46
    2015 2016 2017
    # Services
    # Dev Teams
    1 2
    2018
    270
    48

    View full-size slide

  5. Organization and Architecture
    at Rewe Digital
    Domain Subdomain Bounded Context
    Tribe Squad Team
    Platform Service
    Is
    modelled
    as
    Consists
    of
    Consists
    of
    1 N 1 N
    1 N
    Consists
    of
    1 N
    Consists
    of
    1 N
    1
    1
    1
    1
    N
    1
    Builds Builds
    1
    N
    Implements
    Fulfills requirements
    of
    1
    1
    Is responsible
    for

    View full-size slide

  6. How to scale monoliths?

    View full-size slide

  7. Design Goals
    Vertical Boundaries
    Decentralization

    View full-size slide

  8. “Any organization that designs a system (defined broadly) will produce a design whose structure is a copy of the
    organization's communication structure.”
    Melvin Conway (1967)
    Conway’s law

    View full-size slide

  9. How to organize teams to build a scalable system?
    Functional and vertical teams
    Frontend
    Backend
    Database
    QA
    Ops
    ...
    Team A Team B Team C

    View full-size slide

  10. How to determine boundaries?

    View full-size slide

  11. Customer journey defines subdomains
    Product Information Backoffice Mobile
    Plattform
    Fulfillment
    Customer Check-in Product Discovery Checkout

    View full-size slide

  12. Fulfillment
    Fullfilment domain transformation
    Inbound Inventory Outbound Realization
    Master Data
    Platform
    Backoffice

    View full-size slide

  13. How to guide 150+ developers?

    View full-size slide

  14. Design Goals
    - Vertical boundaries
    - Decentralization
    Architectural principles
    - Collection of 9 basic ‘laws’
    - Autonomy, Automation and Communication
    Guides
    - Practical manual for common tasks (RFC 2119)
    - e.g. Eventing, REST, Authentication
    Guarding rails for developers
    MUST
    SHOULD
    COULD

    View full-size slide

  15. Architectural principles

    View full-size slide

  16. Autonomy principles
    Deploy independently
    Ensure that the services can and are deployed by the teams themselves.
    Isolate failure
    Make the services as resilient as possible.
    Hide implementation Details
    Different verticals must be stateless and must not share state.
    Encapsulate Data Storage
    For any data resource exactly one service is responsible. If possible, the data supply should proceed
    asynchronously in the background

    View full-size slide

  17. Bloated Features
    - Smaller features (MVP) -> fewer teams, lesser synchronization overhead
    Big Bang Releases
    - Appropriate patterns -> smaller risk, lesser need for synchronization
    Urge for Reutilization and Shared Libraries
    - “WET is the new DRY”
    The classic enemies of autonomy

    View full-size slide

  18. Autonomy opens your tech stacks

    View full-size slide

  19. Automation principles
    Be Scalable
    Services are scaled horizontally
    Embrace a Culture of Automation
    Test, deployment and operations are completely automated
    Be Highly Observable
    Use of semantic monitoring to see if the whole platform works correctly.

    View full-size slide

  20. communication

    View full-size slide

  21. Communication principles
    Standardize Service communication
    Inter-service communication is standardized and if possible asynchronous
    Follow REST Principles
    The API of a service follows the RESTful paradigm (REST maturity level 2)

    View full-size slide

  22. Communication in microservice worlds
    Having data is better than fetching data
    µService
    Event-API (Kafka)
    REST-API (JSON) UI-API (HTML)

    View full-size slide

  23. Problems in HTTP/REST-only architectures
    Gateway
    µService 1
    µService 2
    µService 5
    µService 4
    Things that help:
    ● Timeouts
    ● Fallbacks
    ● Circuit Breakers
    ● Eventing
    µService 3

    View full-size slide

  24. Eventing with Apache Kafka
    ● Eventing != Messaging
    ○ Publish events that already happened
    ○ One owning service per queue/topic
    ● Eventing != Event Sourcing
    ○ Complete entities - not deltas
    ○ Allows log compaction
    ● Re-writing and Re-reading
    ○ needed in case of additional data
    ○ useful in case of data loss

    View full-size slide

  25. Eventing is an API as well
    - Events have to behave like APIs and avoid breaking changes.
    Writing (generic) APIs is hard
    - Teams tend to write APIs for special clients (e.g. mobile apps)
    Breaking changes require a strict procedure
    - Must be solved by introducing new endpoints / new topics
    Lessons learned with microservice communication

    View full-size slide

  26. How to access?

    View full-size slide

  27. Usage of API gateways as entry points
    How to access Microservices?

    View full-size slide

  28. What about frontend?

    View full-size slide

  29. Dynamic frontend composition
    How UIs in microservice architectures should be composed

    View full-size slide

  30. Dynamic UI composition with DUC
    Where does my UI come from?

    View full-size slide

  31. Git Project: rewe-digital/integration-patterns
    https://git.io/vA2MY

    View full-size slide

  32. Thank you
    Questions ?

    View full-size slide

  33. A competitive food retail architecture with microservices
    A five year journey with microservices
    Sebastian Gauder
    Software Architect eCommerce
    @rattakresch

    View full-size slide