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.

Elder Moraes

June 21, 2018
Tweet

More Decks by Elder Moraes

Other Decks in Technology

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.

    | –  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”
  4. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

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

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

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

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

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

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

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

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

    | 22 T1 T2 T3 T4 C1 C2 C3 Transações de Compensação
  13. 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
  14. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

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

    | Fn Server Fn FDK’s Fn Load Balancer Fn Flow
  16. 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
  17. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.

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

    | http://comunidade.cloud Virtual Workshops