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.

Microservice architecture 바로 알기

4.156 visualizações

Publicada em

[ Microservice architecture 바로 알기 ]
Slidesahre, Facebook, 각종 블로그, 사이트등을 통해 얻은 다양한 자료를 정리해 볼까하며 개인적으로 끄적거리는 중인 자료입니다.
간단한 세미나에서 공유하고 잘 완성해 공유하려다 근래 잉여력이 바닥인지라 ... 그냥 투척합니다. 요즘 아몰랑...... 하고 마구 투척하는 것도 유행인듯하니... ㅋㅋ
다양한 클라우드플랫폼, CI/CD의 성숙, DDD, 오픈소스.. 등등등 Micro service architecture를 이야기하기에 기술적인 환경은 어느 정도 준비가 되었다고 봅니다.

여기서는 이러한 부분에 대한 내용을 다루며
조직이나 커뮤니케이션에 대한 부분은 이야기 하지 않습니다 ^^;
저도 답을 찾아 방황하는 중이에요~~~ +_+

Publicada em: Software
  • Entre para ver os comentários

Microservice architecture 바로 알기

  1. 1. /114 Microservice architecture (바로알기) 이거 걍 하믄 되는거 아님? 이건희 gunlee01@gmail.com http://facebook.com/gunlee01 1
  2. 2. /114 들어가기 전에.. 2 Slidesahre, Facebook, 각종 블로그, 사이트등을 통해 얻은 다양한 자료를 정리해 볼까하며 개인적으로 끄적거리는 중인 자료입니다. 간단한 세미나에서 공유하고 잘 완성해 공유하려다 근래 잉여력이 바닥인지라 ... 그냥 투척합니다. 요즘 아몰랑...... 하고 마구 투척하는 것도 유행인듯하니... ㅋㅋ 다양한 클라우드플랫폼, CI/CD의 성숙, DDD, 오픈소스.. 등등등 Micro service architecture를 이야기하기에 기술적인 환경은 어느 정도 준비가 되었다고 봅니다. 여기서는 이러한 부분에 대한 내용을 다루며 조직이나 커뮤니케이션에 대한 부분은 이야기 하지 않습니다 ^^; 저도 답을 찾아 방황하는 중이에요~~~ +_+
  3. 3. /114 Microservice architecture 3
  4. 4. /114 Microservice architecture 이런 것? Ref. http://eugenedvorkin.com/seven-micro-services-architecture-advantages/ 4
  5. 5. /114 Microservice architecture 혹은 이런 것? Ref. http://martinfowler.com/articles/microservices.html5
  6. 6. /114 Microservice architecture MSA는 앞서 연구하여 정의된 아키텍처가 아닌... 문제를 해결하기 위해 결과로서 스스로 정의된 아키텍처 이며... 한가지 일을 잘하는 작은 서비스들로 이루어진... Vendor가 아닌 개발자 주도의 SOA 사상으로... 그리고 .... Bla bla... 6
  7. 7. /114 Microservice architecture 네 ~ 맞습니다. 7
  8. 8. /114 Microservice architecture 네 ~ 맞습니다. 그럼 장점은? 8
  9. 9. /114 Key benefits 1)Technology Heterogeneity 9
  10. 10. /114 Key benefits 1)Technology Heterogeneity Ref. Building Microservices Designing Fine-Grained Systems / By Sam Newman / O’Reilly Media10
  11. 11. /114 Key benefits 1)Technology Heterogeneity Ref. Building Microservices Designing Fine-Grained Systems / By Sam Newman / O’Reilly Media 각 비즈니스에 최적화된 기술 적용 Time to Market 11
  12. 12. /114 Key benefits 2)Optimizing for Replaceability 12
  13. 13. /114 Key benefits 2)Optimizing for Replaceability - Small size, small risk 13
  14. 14. /114 Key benefits 2)Optimizing for Replaceability - Small size, small risk - Too big, too risky ! 14
  15. 15. /114 Key benefits 2)Optimizing for Replaceability - Small size, small risk - Too big, too risky ! 차세대 없이는 어찌 해볼 도리가 없다... 차세대의 교훈 ! 차세대도 어렵다. 15
  16. 16. /114 Key benefits 2)Optimizing for Replaceability - Small size, small risk - Too big, too risky ! 차세대 없는 점진적 진화 ! 16
  17. 17. /114 Key benefits 3)Resilience 17
  18. 18. /114 Key benefits 3)Resilience A service fails, Everything stops working 18
  19. 19. /114 Key benefits 3)Resilience A service fails, Everything stop workingA service fails, the service stops working 19
  20. 20. /114 Key benefits 4)Scailing 20
  21. 21. /114 Key benefits 4)Scailing 21
  22. 22. /114 Key benefits 4)Scailing We have to scale everything together. 22
  23. 23. /114 Key benefits 4)Scailing Scaling at just those microservices that need it Ref. Building Microservices Designing Fine-Grained Systems / By Sam Newman / O’Reilly Media 필요한 Biz에 선별적 확장 가능 23
  24. 24. /114 Key benefits & Ease of Deployment Organizational Alignment Composability 24
  25. 25. /114 Key benefits & more 이론적으로 제한 없는 선형적 성능 확장 장애는 항상 국소적 Simple 25
  26. 26. /114 Key benefits 굉장하군! 26
  27. 27. /114 Key benefits But... 27
  28. 28. /114 But But... MSA is no free lunch or silver bullet. 28
  29. 29. /114 But Complexities of distributed systems Scaling은 MSA 만으로 되지 않는다 분산 시스템으로 인한 (개발/운영) 복잡도 증가 실제로는 하나의 서비스가 전체 장애가 된다 - 오히려 장애율이 더 높을 수 있다. 29
  30. 30. /114 But Complexities of distributed systems Fallacies of distributed computing 30
  31. 31. /114 But Complexities of distributed systems Fallacies of distributed computing The network is reliable. Latency is zero. Bandwidth is infinite. The network is secure. Transport cost is zero. ... Ref. http://en.wikipedia.org/wiki/Fallacies_of_distributed_computing31
  32. 32. /114 But Complexities of distributed systems 성능은? 모니터링은? 운영은? 보안은? ... 32
  33. 33. /114 But Ref. Dante And Virgil In Hell (1850) / by William-Adolphe Bouguereau (1825-1905) Complexities of distributed systems 준비되지 않았다면 Hell ~~! 33
  34. 34. /114 Basic Strategies 극복 방안 ! 34
  35. 35. /114 Basic Strategies Scaling Scaling Database Caching Asynchronous 35 Basic Strategies for MSA
  36. 36. /114 Basic Strategies 1)Scaling 36
  37. 37. /114 Basic Strategies 1)Scaling Splitting 37 POST Friends Pictures
  38. 38. /114 Basic Strategies 1)Scaling 38 Splitting Spreading
  39. 39. /114 Basic Strategies 1)Scaling 39 Splitting Spreading Load balancing Ref. Building Microservices Designing Fine-Grained Systems / By Sam Newman / O’Reilly Media Customer Service Instance 1 Load balancer Customer Service Instance 2 Customer Service Instance 3
  40. 40. /114 Basic Strategies 1)Scaling 40 Splitting Spreading Load balancing Worker based Customer Service Worker1 Customer Service Worker2 Customer Service Worker3 dispatcher Queue
  41. 41. /114 Basic Strategies 2)Scaling Database 41
  42. 42. /114 Basic Strategies 2)Scaling Database Scaling for read 42 Ref. Building Microservices Designing Fine-Grained Systems / By Sam Newman / O’Reilly Media Replication
  43. 43. /114 Basic Strategies 2)Scaling Database Scaling for read 43 Ref. Building Microservices Designing Fine-Grained Systems / By Sam Newman / O’Reilly Media
  44. 44. /114 Basic Strategies 2)Scaling Database Scaling for read 44 CP? AP ?
  45. 45. /114 Basic Strategies 2)Scaling Database Scaling for read 45 Ref. Building Microservices Designing Fine-Grained Systems / By Sam Newman / O’Reilly Media Sacrificing availability Sacrificing Consistency - BASE CP? AP ?
  46. 46. /114 Basic Strategies 2)Scaling Database Scaling for read Scaling for write 46 1 4 7 2 5 8 3 6 9 Sharding Customer Customer Customer
  47. 47. /114 Basic Strategies 2)Scaling Database Scaling for read Scaling for write 47 1 4 7 2 5 8 3 6 9 Sharding Customer Customer Customer Shard Key ? Rebalancing ?
  48. 48. /114 Basic Strategies 2)Scaling Database Scaling for read Scaling for write 48 Sharding & replication
  49. 49. /114 Basic Strategies 2)Scaling Database 49 Products... NoSQLs.... & NHN Cubrid shard Twitter Gizzard Spoke Proxy Spider storage Engine CONNECT storage Engine
  50. 50. /114 Basic Strategies 3)Caching 50
  51. 51. /114 Basic Strategies 3)Caching 51 Performance optimization
  52. 52. /114 Basic Strategies 3)Caching 52 Performance A RAM is faster than a HDD ! Client Memory (Cache) Disk (origin) 1)Request for cache entry 2)on cache miss, Get fresh data from the origin 3)Update cache entry
  53. 53. /114 Basic Strategies 3)Caching 53 Local Cache Global cache Distributed cache Cache Cache Cache Cache Cache Cache Cache
  54. 54. /114 Basic Strategies 3)Caching 54 Performance, 공유저장소, 그리고 보통 DB의 읽기 부하 분산...
  55. 55. /114 Basic Strategies 3)Caching 55 Performance, 공유저장소, 그리고 보통 DB의 읽기 부하 분산... 그런데 !!! Cache가 죽으니 DB가 죽더라...
  56. 56. /114 Basic Strategies 3)Caching 56 How to hide the origin Client Cache Origin (DB or others) Sync. Request for cache entry Async. Event fired in event of cache miss update Fail fast on cache miss
  57. 57. /114 Basic Strategies 3)Caching 57 Products... Redis Memcached Redis Cluster Infinispan Hazelcast Coherence
  58. 58. /114 Basic Strategies 4)Asynchronous 58
  59. 59. /114 Basic Strategies 4)Asynchronous 59 스타벅스는 비동기? Ref. http://www.eaipatterns.com/ramblings/18_starbucks.html / Gregor Hohpe Starbuks Does Not Use 2PC. - Hotto Cocoa o Kudasai.
  60. 60. /114 Basic Strategies 4)Asynchronous 60
  61. 61. /114 Basic Strategies 4)Asynchronous 61 스타벅스는 비동기? 주문 데스크 바리스타 바리스타 바리스타 바리스타
  62. 62. /114 Basic Strategies 4)Asynchronous 62 스타벅스는 비동기? 고객이 주문하고 기다릴 필요가 없다. - 웹서핑을 하던지, 수다를 떨던지... Loosely Coupled !
  63. 63. /114 Basic Strategies 4)Asynchronous 63 스타벅스는 비동기? 주문을 지속적으로 받을 수 있다. - 커피 머신이 잠시 고장나더라도... Resilience !
  64. 64. /114 Basic Strategies 4)Asynchronous 64 스타벅스는 비동기? 비슷한 음료는 한번에 만들 수도.. - 반드시 순서대로 작업할 필요가 없다... - 여러 고객의 커피류를 한번에 만든다... Performance !
  65. 65. /114 Basic Strategies 4)Asynchronous 65 Loosely coupled Resilience Performance Client Service Worker Worker Worker Message Queue
  66. 66. /114 Basic Strategies 4)Asynchronous 66 Orchestration vs Choreography 지휘 vs 안무구성
  67. 67. /114 Basic Strategies 4)Asynchronous 67 Orchestration vs Choreography Choreographed approach is more loosely coupled, flexible and amenable to change.
  68. 68. /114 Basic Strategies 4)Asynchronous 68 Orchestration vs Choreography Orchestration Ref. Building Microservices Designing Fine-Grained Systems / By Sam Newman / O’Reilly Media
  69. 69. /114 Basic Strategies 4)Asynchronous 69 Orchestration vs Choreography Choreography Ref. Building Microservices Designing Fine-Grained Systems / By Sam Newman / O’Reilly Media
  70. 70. /114 Basic Strategies Scaling Scaling Database Caching Asynchronous 70 Basic Strategies for MSA
  71. 71. /114 Real World 71 실제로는 훨씬 더 복잡하다 어떻게 하라는 거임?
  72. 72. /114 Real World 72 더 필요한 것들
  73. 73. /114 Real World 1)Dynamic Service Registry 73
  74. 74. /114 Real World 1)Dynamic Service Registry 74 Service discovery Health check between instances Service versioning
  75. 75. /114 Real World 1)Dynamic Service Registry 75 Client Service Registry Service A Where is the service A? Service Service Service Service Service Service Service I’m here. I’m alive! OK
  76. 76. /114 Real World 1)Dynamic Service Registry 76 Zookeeper Apache Consul Eureka Netflix
  77. 77. /114 Real World 2)Antifragile 77 A resilience is free? Absolutely Not!
  78. 78. /114 Real World 2)Antifragile 78 Cascading failure Ref. https://github.com/Netflix/Hystrix/wiki
  79. 79. /114 Real World 2)Antifragile 79 Ref. https://github.com/Netflix/Hystrix/wiki Cascading failure
  80. 80. /114 Real World 2)Antifragile 80 Ref. https://github.com/Netflix/Hystrix/wiki Cascading failure
  81. 81. /114 Real World 2)Antifragile 81 Bulkhead Cascading failure
  82. 82. /114 Real World 2)Antifragile 82 Timeout Client Servicerequest over N/W Wait for some seconds Check time out Do failure scenarios Cascading failure
  83. 83. /114 Real World 2)Antifragile 83 Throttle & quick failure Client Servicerequest over N/W Quick failure (if exceed max allowed req.) Cascading failure
  84. 84. /114 Real World 2)Antifragile 84 Retry Client Servicerequest over N/W If error or timeout, Retry Cascading failure
  85. 85. /114 Real World 2)Antifragile 85 Idempotency Cascading failure Ref. https://github.com/Netflix/Hystrix/wiki
  86. 86. /114 Real World 2)Antifragile 86 Circuit breaker Cascading failure Ref. https://github.com/Netflix/Hystrix/wiki
  87. 87. /114 Real World 2)Antifragile 87 Cascading failure
  88. 88. /114 Real World 2)Antifragile 88 Catastrophic Failover Client Service Worker Worker Worker Message Queue Bad Message
  89. 89. /114 Real World 2)Antifragile 89 Catastrophic Failover Client Service Worker Worker Worker Message Queue Bad Message
  90. 90. /114 Real World 2)Antifragile 90 Catastrophic Failover Client Service Worker Worker Worker Message Queue Bad Message
  91. 91. /114 Real World 2)Antifragile 91 Catastrophic Failover Client Service Worker Worker Worker Message Queue Bad Message
  92. 92. /114 Real World 2)Antifragile 92 Catastrophic Failover Client Service Worker Worker Worker Message Queue Bad Message
  93. 93. /114 Real World 2)Antifragile 93 Catastrophic Failover Client Service Worker Worker Worker Message Queue Bad Message
  94. 94. /114 Real World 2)Antifragile 94 Catastrophic Failover Failure queue Client Service Worker Worker Worker Message Queue Bad Message Failure Queue Bad MessageBad Message
  95. 95. /114 Real World 3)Monitoring 95
  96. 96. /114 Real World 3)Monitoring 96 Cross service Tracing
  97. 97. /114 Real World 3)Monitoring 97 Cross service Tracing It’s not my fault!
  98. 98. /114 Real World 3)Monitoring 98 Google Dapper Cross service Tracing Ref. http://static.googleusercontent.com/media/research.google.com/ko//pubs/archive/36356.pdf
  99. 99. /114 Real World 3)Monitoring 99 Google Dapper Cross service Tracing
  100. 100. /114 Real World 3)Monitoring 100 Pinpoint – open source https://github.com/naver/pinpoint
  101. 101. /114 Real World 3)Monitoring 101 Zipkin – twitter
  102. 102. /114 Real World 3)Monitoring 102 App Dynamics – on premise, SASS Flow map Business Activity Monitoring Cross-service tracing Self-leaning
  103. 103. /114 Real World 3)Monitoring 103 New Relic Transaction Breakdown Cross App Tracing Support any language on any hosting Browser side insight
  104. 104. /114 Real World 3)Monitoring 104 Scouter – Open source https://github.com/scouter-project
  105. 105. /114 Real World 105 이것들 말고 더 있다... 1) Dynamic Service Registry (or Service Discovery or API Gateway ... ) 2) Antifragile 3) Monitoring
  106. 106. /114 Real World 106 And More ... Deployment
  107. 107. /114 Real World 107 And More ... Deployment Continuous delivery Blue Green deployments Canary deployments Ref. https://devcentral.f5.com/articles/programmability-in-the-network-canary-deployments Ref. http://andreas-simon.blogspot.kr/2014/02/zero-downtime-deployment-for-grails.html
  108. 108. /114 Real World 108 And More ... Security – Trust between services API Token Client Certificate HMAC (hash message authentication code) Ref. http://en.wikipedia.org/wiki/Hash-based_message_authentication_code
  109. 109. /114 Real World 109 And More ... Testing Ref. http://martinfowler.com/articles/microservice-testing/#conclusion-summary
  110. 110. /114 Real World 110 And More ... Ref. http://www.slideshare.net/saltynut/whitebase White Base – SK Planet API Gateway Easy to instantiate MSs in development env. Solving resource problems on developer’s PC. Testing
  111. 111. /114 Real World 111 And More ... Ref. http://www.slideshare.net/saltynut/whitebase Testing White Base
  112. 112. /114 결국... 기술적인 부분도 더 고민해야 할 것이 많다. 112 Scaling Caching Service Discovery (API Gateway) Monitoring Asyncronous Antifragile Security Testing Deployment Maturity bar Optimizing Defined Initial
  113. 113. /114113 Thank you ! Q&A or later gunlee01@gmail.com http://facebook.com/gunlee01
  114. 114. /114 References http://eugenedvorkin.com/seven-micro-services-architecture-advantages/ http://martinfowler.com/articles/microservices.html http://martinfowler.com/bliki/CatastrophicFailover.html http://martinfowler.com/articles/microservice-testing http://www.appdynamics.co.kr http://newrelic.com/application-monitoring https://github.com/Netflix/Hystrix/wiki http://martinfowler.com/bliki/PolyglotPersistence.html http://static.googleusercontent.com/media/research.google.com/ko//pubs/archive/36356.pdf https://github.com/naver/pinpoint http://www.slideshare.net/saltynut/whitebase https://devcentral.f5.com/articles/programmability-in-the-network-canary-deployments http://andreas-simon.blogspot.kr/2014/02/zero-downtime-deployment-for-grails.html http://en.wikipedia.org/wiki/Hash-based_message_authentication_code Building Microservices Designing Fine-Grained Systems / By Sam Newman / O’Reilly Media 114

×