O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.

TDC2016POA | Trilha Arquitetura - Versioning APIs

149 visualizações

Publicada em

Versioning APIs

Publicada em: Educação
  • Seja o primeiro a comentar

  • Seja a primeira pessoa a gostar disto

TDC2016POA | Trilha Arquitetura - Versioning APIs

  1. 1. Versioning APIs Marcelo Cure
  2. 2. Why do I care? ● Distributed components ● Isolation ● Microservices evolving independently ● Deploy anytime
  3. 3. Contracts break
  4. 4. Why contracts break?
  5. 5. Consumers set expectations
  6. 6. APIs evolve
  7. 7. We need to change them
  8. 8. Non breaking changes
  9. 9. Breaking changes
  10. 10. Breaks consumer :’(
  11. 11. And now?
  12. 12. Version it!
  13. 13. Communication
  14. 14. Be cautious ● Too many versions; ● Complexity; ● Bugs;
  15. 15. How to version my API?
  16. 16. Version as path/query parameter https://host/api/v1/bands/1/albuns https://host/api/bands/albuns?version= 1 ● Explicit ● Cleaner for consumers ● Harder to identify ● Intrusive
  17. 17. Version as a header Accept: application/json; version=1.0 ● Less intrusive ● Does not polute URL ● Easier to identify ● No specification for that or use a custom header
  18. 18. Take care of your contracts ● It’s your front door ● Care about your design ● Discuss contract changes, do it cautiously ● Postpone decisions ● Test your contracts
  19. 19. Bad design -> contract break -> versioning
  20. 20. Don’t have a lot of versions
  21. 21. Remove deprecated versions
  22. 22. You need to get used... Contracts break, it’s natural
  23. 23. But not so often
  24. 24. Thanks Marcelo Cure - Software Engineer at ilegra marcelo.cure@ilegra.com Twitter: @__cure http://marcelo-cure.blogspot.com.br

×