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

Coolblue Behind the scenes - Delphi (2018-11-29, with Barnsten)

8412539a171d6306ddda7bdd52ccab52?s=47 Erik Stok
November 29, 2018

Coolblue Behind the scenes - Delphi (2018-11-29, with Barnsten)

On the 29th of November 2018, Coolblue and Barnsten organised a Delphi meeting in Rotterdam, to take a look behind the scenes of Coolblue Delphi development.

As a developer of the warehouse management system team I shared experiences in transforming a monolith back office application into a service oriented application.

8412539a171d6306ddda7bdd52ccab52?s=128

Erik Stok

November 29, 2018
Tweet

Transcript

  1. Erik Stok | Principal Software Developer | e.stok@coolblue.nl | 29-11-2018

  2. Erik Stok | Principal Software Developer | e.stok@coolblue.nl | 2018-11-29

  3. Agenda What you can expect • Our back office system

    • Our architecture • Downsides to a monolith • Approach to integrating services • Testing • Upsides/downsides to services
  4. Our own website, built in-house

  5. Our own customer service

  6. Our own 9 stores

  7. Our own stock and logistics

  8. Our own delivery service

  9. Our own back office, built in-house

  10. Architecture Website Database Database Internet Data sync Back office services

    Back office services Classic back office
  11. Architecture Website Database Database Internet Data sync Back office services

    Back office services Classic back office
  12. Architecture Website Database Database Internet Data sync Back office services

    Back office services Classic back office
  13. Monolith setup Back office Database

  14. Application framework

  15. Application framework Framework Application base Application functionality Generic Application generic

    Functionality (specific)
  16. Monolith setup - business logic Back office Model View Controller

    Stored procedures Tables Triggers Database
  17. Monolith setup - downsides Why move the monolith? • Business

    logic in the client is not shared • Business logic in the server does not scale well • Events are hard to implement • Everything is synchronous • Testing is difficult
  18. Making it service oriented Back office Model View Controller Stored

    procedures Tables Triggers Database Services Logic
  19. Services - How to How we make services • REST

    • Discoverable through Swagger • Feature toggle
  20. Integrating a service - Approach 1 Back office View Controller

    Rest Service Database Model Service class Gateway ClientDataSet DataSet
  21. Integrating a service - Approach 2 Back office View Controller

    Rest Service Database Model Service class Gateway ClientDataSet Repository
  22. Integrating a service - Approach 3 Back office View Controller

    Rest Service Database Model Service class Gateway ClientDataSet
  23. Integrating a service - Approach 1 What to build •

    Create gateway (using OpenApi) ◦ Create Api classes ◦ Create gateway class • Create feature toggle • Create service class • Make the model use the service class ◦ Set up service class ◦ Use service class based on toggle
  24. Service upsides - Events Back office Database Services 3rd party

    system Event
  25. Testing

  26. Testing - Challenges How to get testing implemented • REST

    Service can be tested • Service class can be tested • Mapper can be tested • Repository integration tests • Gateway integration tests • Adjusting the framework for dependency injection
  27. Downsides to services What are the downsides? • Development setup

    becomes less easy • Breaking contracts/versioning
  28. Upsides to services Did we get rid of the downsides

    of the monolith? • Business logic in the client can be moved to the service • Business logic in the server can be moved to the service • Events can be started from the service • The service can operate asynchronous • Testing of business logic is covered in the service
  29. Erik Stok | Principal Software Developer | e.stok@coolblue.nl | 2018-11-29