Leveling a Serverless application’s design usin...

Leveling a Serverless application’s design using Hexagonal architecture - NodeConfEU 2019

Serverless is becoming one of the most relevant technologies in this era. One year and a half ago, I started to develop AWS Lambda functions with node.js with no idea of what challenges I was about to face.

With portability as the priority, and after a couple of iterations, and our learnings from three stories, we discovered the concepts behind Hexagonal architecture that helped us to re-use the main’s application logic behind different AWS services and avoid hight complex test.

Sebastián Osorio

November 13, 2019

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

66 slides
  1. 1

  2. 3

  3. 5

  4. 6

  5. 8

  6. 9

  7. 11 * Works with and without network connection * Maps

    & point clouds in 30 minutes * AI on the Edge * GNSS RTK base station
  8. 12

  9. 13

  10. 16 *We gained some visibility *We got a commitment *We

    got a humble budget to maintain some stages.
  11. 17

  12. 18 *Problems managing the stages... and the deployment. *Over use

    of the humble budget. *Still have a commitment.
  13. 19 A user is going to use the application a

    couple of times per week. ~300 usage peaks/week. We're paying for servers 24/7 per 3 stages. We're spending a considerable amount of time to maintain the environment. We do this for love, and sometimes we have no time/resources.
  14. 21

  15. 22

  16. 23

  17. 25

  18. 26

  19. 27

  20. 28

  21. 30

  22. 32 *Local startup. * They had a global competitor. *Be

    the first => need velocity => Used a service that increased the development velocity. *They did it!!! .
  23. 33

  24. 34

  25. 41

  26. 45 *Boundary-Controller-Entity, Ivar Jacobson, 1992 *Hexagonal Architecture, Alistar Cockburn, 2005

    *Jeffery Palermo, Onion Architecture, 2008 *Robert C. Martin, Screaming Architecture, 2011
  27. Service Trigger apiGatewayPort.js core.js s3EventPort.js stepFunctionEventPort.js { "path": "/hello", "headers",

    "pathParameters", "requestContext", "httpMethod": "GET", } { ...payload }
  28. Service Trigger apiGatewayPort.js core.js s3EventPort.js stepFunctionEventPort.js outsidePort.js { "path": "/hello",

    "headers", "pathParameters", "requestContext", "httpMethod": "GET", } { ...payload } .callMe()
  29. 58 * The core logic is available with a simple

    contract easy to define and consume. * Concentrate the team effort on create test important to the business. * Execute the code in your/any machine. * Calls the outside world using a well defined interface as port. core.js 1. * (Make sure to manage errors)
  30. 59 * A single piece of code that handles the

    definition of any event that your business logic can run. * You test what concerns to the definition of the service. _port.js 2.
  31. 60

  32. 62 For the next iteration of your application don't talk

    about a refactor, talk about an adaptation

More Decks by Sebastián Osorio

Other Decks in Programming