Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Evolving big microservice architectures

53 visualizaciones

Publicado el

Microservices are a well-established architecture applied by many organizations around the world to build scalable and fault-tolerant backend systems. But as these systems grow so does the number of services in them. And this brings many challenges when we want to introduce new functionality. For a simple feature, engineers may need to spend a lot of time designing the end to end flow, changing code in multiple services and setting up complex test scenarios. During this talk, we’ll explore how to evolve a microservice architecture to be easily extensible based on some lessons learned from running 5000 microservices in production. We’ll go over different architectural patterns and open source tools that we can use to make it easy for all engineers to understand, extend and be more and more productive in such big complex systems.

Publicado en: Tecnología
  • Sé el primero en comentar

Evolving big microservice architectures

  1. 1. Evolving big microservice architectures Nikolay Stoitsev, Engineering Manager @ Uber Engineering
  2. 2. Dispatch API
  3. 3. A monolith? Code was consistently good Easy to reuse code Well tested Hard to deploy
  4. 4. Pull Request Pull Request Pull Request Pull Request Pull Request ? ? ? ? ?
  5. 5. Pull Request Pull Request Pull Request Pull Request Pull Request ? ? ? ? ? Unknown risk Unknown priority
  6. 6. Low Risk High Risk High Risk Med Risk High Risk Build
  7. 7. Low Risk High Risk High Risk Med Risk High Risk Build ?
  8. 8. Low Risk High Risk High Risk Med Risk High Risk Build
  9. 9. Low Risk / P0 High Risk / P1 High Risk / P0 Med Risk / P3 High Risk / P0 Build
  10. 10. Low Risk / P0 High Risk / P1 High Risk / P0 Med Risk / P3 High Risk / P0 Build CI / CD
  11. 11. Gradual rollout is important
  12. 12. Lesson learned: A monolith can scale a lot, but...
  13. 13. Dispatch API
  14. 14. Dispatch API UsersTrips ReceiptsPayments
  15. 15. Dispatch API Users Trips ReceiptsPayments
  16. 16. Dispatch API UsersTrips ReceiptsPayments
  17. 17. Dispatch API UsersTrips ReceiptsPayments
  18. 18. 4000+ microservices 1K+ avg deploys a day
  19. 19. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Apache Kafka Apache Kafka Apache Kafka Sample architecture
  20. 20. We want to introduce Uber Elevate
  21. 21. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Apache Kafka Apache Kafka Apache Kafka
  22. 22. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Task #1 Apache Kafka Apache Kafka Apache Kafka
  23. 23. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Task #1 OK Apache Kafka Apache Kafka Apache Kafka
  24. 24. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Task #1 OK Task #2 Apache Kafka Apache Kafka Apache Kafka
  25. 25. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Task #1 OK Task #2 Task #3 Apache Kafka Apache Kafka Apache Kafka
  26. 26. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Task #1 OK Task #2 Task #3 Task #4 Apache Kafka Apache Kafka Apache Kafka
  27. 27. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Task #1 OK Task #2 Task #3 Task #4 Task #5Apache Kafka Apache Kafka Apache Kafka
  28. 28. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Task #1 OK Task #2 Task #3 Task #4 Task #5 OKApache Kafka Apache Kafka Apache Kafka
  29. 29. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Task #1 OK Task #2 Task #3 Task #4 Task #5 OK Task #6 Apache Kafka Apache Kafka Apache Kafka
  30. 30. How do we evolve big microservice architectures?
  31. 31. You can’t change what you can’t test
  32. 32. Staging environment?
  33. 33. Integration tests?
  34. 34. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Change Apache Kafka Apache Kafka Apache Kafka
  35. 35. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Change MOCK MOCK MOCK MOCK Apache Kafka Apache Kafka Apache Kafka
  36. 36. Multitenancy
  37. 37. Tenancy - set of data that is isolated from the other sets of data
  38. 38. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Change Apache Kafka Apache Kafka Apache Kafka
  39. 39. Testing tenancy vs. Production tenancy
  40. 40. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Change Test Data Test Config Test Config Test Data Apache Kafka Apache Kafka Apache Kafka
  41. 41. Audit tenancy
  42. 42. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Audit tenancy traffic Check Test Config Test Config Test Data Apache Kafka Apache Kafka Apache Kafka Check Check Check
  43. 43. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Task #1 OK Task #2 Task #3 Task #4 Task #5 OKApache Kafka Apache Kafka Apache Kafka
  44. 44. Platforms
  45. 45. Services are too concrete so it’s hard to support new use cases
  46. 46. Services need to support abstraction
  47. 47. AWS is a good example
  48. 48. Dispatch Pricing Services Tax Calc Vehicles Trips Services Users Payments Services Receipts Apache Kafka Apache Kafka Apache Kafka
  49. 49. Dispatch Pricing Services Tax Calc Vehicles Orders Platform Users Payments Services Receipts Apache Kafka Apache Kafka Apache Kafka
  50. 50. Dispatch Pricing Services Tax Calc Vehicles Orders Platform Users Payments Services Receipts Apache Kafka Apache Kafka Apache Kafka
  51. 51. Dispatch Pricing Services Tax Calc Vehicles Orders Platform Users Payments Services Receipts Apache Kafka Apache Kafka Apache Kafka
  52. 52. Hard shift in mentality in the way you design your services
  53. 53. Can you sell it outside of the company?
  54. 54. Tax Calc Payments Pricing
  55. 55. Tax Calc Payments Pricing 3.14159
  56. 56. Tax Calc Payments Pricing 3.14159 “3.14”
  57. 57. Tax Calc Payments Pricing 3.14159 “3.14” 314159
  58. 58. Common data model
  59. 59. Data extensions = schema + payload
  60. 60. How to do it? Schema service Repo Library ...
  61. 61. Dispatch Pricing Services Tax Calc Vehicles Orders Platform Users Payments Services Receipts Apache Kafka Apache Kafka Apache Kafka
  62. 62. … but there is still business specific logic.
  63. 63. Dispatch Pricing Services Tax Calc Vehicles Orders Platform Users Payments Services Receipts Where to put it? Business logic Apache Kafka Apache Kafka Apache Kafka
  64. 64. No common understanding of what should go where
  65. 65. How do we call code with business logic, presentation logic, and SQL queries all over the place?
  66. 66. We fix spaghetti code with separation of concerns
  67. 67. Presentation Logic Data
  68. 68. Layered architecture
  69. 69. Users Vehicles Order Platform Pricing Tax Calc Payments Receipts Rides Elevate Web Services Mobile Backend
  70. 70. Why?
  71. 71. Common language
  72. 72. Clear separation of concerns
  73. 73. Consistent patterns
  74. 74. API and functionality discoverability
  75. 75. Engineering velocity
  76. 76. Users Vehicles Order Platform Pricing Tax Calc Payments Receipts Rides Elevate Web Services Mobile Backend Generic Specific
  77. 77. Users Vehicles Order Platform Pricing Tax Calc Payments Receipts Rides Elevate Web Services Mobile Backend Breaks everything Breaks specific thing
  78. 78. Users Vehicles Order Platform Pricing Tax Calc Payments Receipts Rides Elevate Web Services Mobile BackendPresentation LoB Biz Infra Core
  79. 79. https://philcalcado.com/2018/09/24/services_layers.html Users Vehicles Order Platform Pricing Tax Calc Payments Receipts Rides Elevate Web Services Mobile Backend Clay Rocks
  80. 80. Users Vehicles Order Platform Pricing Tax Calc Payments Receipts Rides Elevate Web Services Mobile BackendPresentation
  81. 81. Users Vehicles Order Platform Pricing Tax Calc Payments Receipts Rides Elevate Web Services Mobile Backend LoB
  82. 82. Users Vehicles Order Platform Pricing Tax Calc Payments Receipts Rides Elevate Web Services Mobile Backend Biz Infra
  83. 83. Users Vehicles Order Platform Pricing Tax Calc Payments Receipts Rides Elevate Web Services Mobile Backend Core
  84. 84. Clear API
  85. 85. protobuf Apache Thrift GraphQL
  86. 86. End result: Layered multitenant architecture built with abstract platforms and a common data model
  87. 87. Users Vehicles Order Platform Pricing Tax Calc Payments Receipts Rides Web Services Mobile Backend
  88. 88. Users Vehicles Order Platform Pricing Tax Calc Payments Receipts Rides Elevate Web Services Mobile Backend
  89. 89. Q&A Feedback:
  90. 90. Proprietary © 2019 Uber Technologies, Inc. All rights reserved. No part of this document may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage or retrieval systems, without permission in writing from Uber. This document is intended only for the use of the individual or entity to whom it is addressed and contains information that is privileged, confidential or otherwise exempt from disclosure under applicable law. All recipients of this document are notified that the information contained herein includes proprietary and confidential information of Uber, and recipient may not make use of, disseminate, or in any way disclose this document or any of the enclosed information to any person other than employees of addressee to the extent necessary for consultations with authorized personnel of Uber.

×