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

Consistência de dados entre microservices: é possível?

Consistência de dados entre microservices: é possível?

Eba! Temos microservices! Agora tudo está resolvido: podemos escalar, distribuir e orquestrar nossos serviços sem qualquer preocupação!

Será? Já parou para pensar nos dados de cada serviço? E nos dados compartilhados entre eles? E pior: já pensou nas transações entre serviços?

Transações ACID não servem mais. Transações distribuídas menos ainda. Como fazer então?

Para isso existe o padrão de Sagas! Com ele é possível resolver esse problema de uma forma inteligente, consistente e alinhado ao paradigma de microservices.

Cad9d9d8998f49269ce4f28a018ba53e?s=128

Elder Moraes

June 21, 2018
Tweet

Transcript

  1. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Consistência de dados entre microservices utilizando serverless e FaaS Elder Moraes Cloud Evangelist Oracle Julho, 2018
  2. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.
  3. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    |
  4. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    |
  5. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    |
  6. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 7 Microservices
  7. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 8 Microservices
  8. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | –  M. Conway (Conway’s Law) 9 “Organizations which design systems (…) are constrained to produce designs which are copies of the communication structure of these organizations”
  9. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Escalar pessoas, e não software 10
  10. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 11 “Two Pizzas Rule” Jeff Bezos, CEO at Amazon
  11. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 12 https://martinfowler.com/articles/microservices.html
  12. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 13 https://martinfowler.com/articles/microservices.html
  13. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 14 https://martinfowler.com/articles/microservices.html
  14. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 15
  15. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 16 Consistência
  16. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 17 ACID Atomicity Consistency Isolation Durability
  17. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 18 ACID Atomicity Consistency Isolation Durability Microservices
  18. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 19 PRODUCT SERVICE DATABASE CART SERVICE DATABASE Transação
  19. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 20 Mas eu… … queria.
  20. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 21 https://www.cs.cornell.edu/andru/cs711/2002fa/reading/sagas.pdf
  21. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 22 T1 T2 T3 T4 C1 C2 C3 Transações de Compensação
  22. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | E aí, Tom… vamos orquestrar na mão?
  23. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | http://fnproject.io/
  24. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Serverless
  25. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | IaaS PaaS CaaS FaaS
  26. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    |
  27. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | 28
  28. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Deploy and test in cloud • ~ 30 seconds Deploy and test locally • ~ 10 seconds Unit testing • ~ 1 second
  29. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    |
  30. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    |
  31. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Fn Server Fn FDK’s Fn Load Balancer Fn Flow
  32. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Fn Server Fn FDK’s Fn Load Balancer Fn Flow
  33. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Demo Time!!!
  34. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | Demo FLIGHT PROVIDER book cancel HOTEL PROVIDER book cancel CAR RENTAL PROVIDER book cancel EMAIL PROVIDER send Flight booking fn Flight cancellation fn Hotel booking fn Hotel cancellation fn Car booking fn Car cancellation fn Email sending fn Trip booking fn
  35. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | My Devoxx, by Gluon http://gluonhq.com/serverless-functions-gluon-cloudlink-oracle-fn/
  36. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | http://comunidade.cloud Virtual Workshops
  37. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

    | book.eldermoraes.com @elderjava