Successfully reported this slideshow.
Your SlideShare is downloading. ×

The_Story_of_Microservices_YAI_KALBIS.pdf

More Related Content

Related Books

Free with a 30 day trial from Scribd

See all

The_Story_of_Microservices_YAI_KALBIS.pdf

  1. 1. Mapan © Copyright 2020 The Story of Microservices August 21st. 2021
  2. 2. Mapan © Copyright 2020 Agenda of Content 01. About Me 02. In the beginning, Distributed System 03. Distributed System Architecture (and SOA) 04. And there is Microservices 05. Migrating into Microservices 06. Do you need Microservices ? 07. Q&A z
  3. 3. Mapan © Copyright 2020 ● 13+ years of experience on IT Industry and Education ● Senior DevOps Engineer - former Solution Architect at MAPAN ( GoTo Group) since 2018 ○ We’re hiring, please visit https://www.career.mapan.id/ ○ Send your CV to mapan-recruitment@gojek.com ○ Interest in our DevOps engineering ? PM me ● Former Lead Engineer - Universitas Indonesia Data Center (2012 - 2018) ● Former Lecturer at Faculty of Computer Science - Universitas Indonesia between (2014 - 2018) ○ Teaching Subject : System Programming, Modern IT Infrastructure, Distributed System ● Former volunteer system administrator for kambing.ui.ac.id (now defunct), one of the largest of national Free/Open Source Software repository (2009-2018) ● Co-founding two startups during (2012 - 2015) , now defunct ● Contact : tonny.sabastian@gojek.com / tonny@segmentationfault.xyz About Me
  4. 4. Mapan © Copyright 2020 In the beginning, - Distributed System -
  5. 5. Mapan © Copyright 2020 What are Distributed Systems ? Can you give an example ?
  6. 6. Mapan © Copyright 2020 The Definition of a Distributed System Distributed system is a collection of independent nodes but appears to user as a single coherent system Facebook, Youtube, GMail, Twitter, GitHub, WhatsApp, …... NFS, GFS, Ceph, Orange FS AWS S3, Openstack Swift RabbitMQ, ZeroMQ, MQTT, Kafka Docker Swarm , AWS EC2, Kubernetes Apache Mesos, Kubernetes Files & Dirs put, get, delete enq, deq tasks orchestration Networking Layer ( IP, TCP, UDP, socket, HTTP) OS Layer
  7. 7. Mapan © Copyright 2020 ● Transparency ○ Your Pokemon Go Client doesnʼt have to know exactly which game server is spawning your rare MewTwo ● Scalability ○ Content Delivery Network is an example of bandwidth and compute power aggregation ○ The instruction needed to schedule your Smart Lamp at home is queued somewhere within Google PubSub, which is a disk aggregation ○ Which scales we are talking about ? Each of mentioned service might be run on some 20 - 30k machines ● Availability ○ Build a reliable system from unreliable system (ex : network can fail, hardware can fail, software may have bugs) ○ Resiliency & Robustness to maintain 99.999999999999% uptime Why we built distributed system ?
  8. 8. Mapan © Copyright 2020 ● Modularity ○ Your application is splitted into many smaller parts. ○ Some part perhaps already exist and can be directly deployed ○ Some part are harder to implement Why we built distributed system ?
  9. 9. Mapan © Copyright 2020 ● Challenges ○ System Design is Challenging ○ Achieving Scalability is Challenging ○ Consistency - Wait my transaction have not been propagated ○ Security - Somebody breach into my customer data via my unprotected AWS S3 for images ○ Fault Tolerance - My authentication is down and my client cannot upload their videos ● Distributed System Fallacy ● Microservices are harder to handle Distributed System is Hard
  10. 10. Mapan © Copyright 2020 Distributed System Architecture (and SOA)
  11. 11. Mapan © Copyright 2020 ● Itʼs a macroscopic view of a system structure ○ How responsibilities are assigned and divided ○ How contract between system are stated and implemented ○ How connector can be placed between systems ● Architecture is essential . It will influenced on how fast we adapt to changes and how much our cost will be spend for those changes What is an Architecture ?
  12. 12. Mapan © Copyright 2020 Common Architecture Pattern Tiered Architecture Remote Method Invocation Event Driven Peer to Peer Shared Memory / Storage
  13. 13. Mapan © Copyright 2020 Example Architecture of a Web Apps Discuss each layers ● What constitutes it ? ● What does it do ? ● Hardware Requirements ● or Cloud Service Equivalents ● Deployment choices ● Glue / Interconnection
  14. 14. Mapan © Copyright 2020 SOA - Service Oriented Architecture
  15. 15. Mapan © Copyright 2020 SOA - Service Communication & Orchestration In order to get meaningful result, service talk to others via sets of contracts and the result is orchestrated before presented to user Service Talk via Contracts Service Orchestration
  16. 16. Mapan © Copyright 2020 SOA - Example - Travel Agent Service
  17. 17. Mapan © Copyright 2020 Here Comes Microservices
  18. 18. Mapan © Copyright 2020 Meme Time !!!
  19. 19. Mapan © Copyright 2020 What is Microservices ? Microservices are independently deployable services modeled around a business domain. They communicate with each other via networks…...They are a type of service-oriented architecture (SOA), albeit one that is opinionated about how service boundaries should be drawn, and that independent deployability is key. Martin Fowler Sam Newman
  20. 20. Mapan © Copyright 2020 Microservices Characteristic
  21. 21. Mapan © Copyright 2020 Microservices Architecture Style Infrastructure Style ● API Gateway ● Service Mesh ● Containerization ● Service Discovery ● Circuit Breaker ● Configuration Repository ● Event Bus / Streams Software Style ● Hexagonal Architecture ● Domain Driven Design ● Event Sourcing ● CQRS ● Functional Reactive Programming Let’s take a look into some of the styles mentioned above
  22. 22. Mapan © Copyright 2020 API Gateway & Service Mesh (a)API Gateway & Service Mesh source : Building Microservices, 2nd Edition, Sam Newman (b) API Gateway Functionality source : https://microservices.io/patterns/apigateway.html
  23. 23. Mapan © Copyright 2020 Containerization (a)Container Packaging source : Building Microservices, 2nd Edition, Sam Newman (b)Container Orchestration source : Building Microservices, 2nd Edition, Sam Newman
  24. 24. Mapan © Copyright 2020 Event Bus / Stream (a)PubSub Pattern via Event Bus source : Building Microservices, 2nd Edition, Sam Newman (b)Event Payload source : Building Microservices, 2nd Edition, Sam Newman
  25. 25. Mapan © Copyright 2020 Domain Driven Design (a)Services are being abstracted from domain boundary context source : Building Microservices, 2nd Edition, Sam Newman (b)Information hiding between domain source : Building Microservices, 2nd Edition, Sam Newman
  26. 26. Mapan © Copyright 2020 Command Query Responsibility Segregation Read Only Database to Segregate Event (Query) From Multiple Services source : https://microservices.io/patterns/data/cqrs.html
  27. 27. Mapan © Copyright 2020 Migrating into Microservices
  28. 28. Mapan © Copyright 2020 In the beginning, there was monolith But, not these monolith
  29. 29. Mapan © Copyright 2020 Example : Payment Gateway (2) Monolith Payment Gateway HTTP Payment Partner Merchant Transaction Member DB Cash
  30. 30. Mapan © Copyright 2020 Example : Payment Gateway (2) Monolith Payment Gateway Payment Partner Merchant Transaction Member DB Cash Payment API HTTP
  31. 31. Mapan © Copyright 2020 Example : Payment Gateway (3) Payment Partner Transaction DB Cash Payment API HTTP Wallet Service Member Service Merchant Service
  32. 32. Mapan © Copyright 2020 Example : Payment Gateway (4) Payment Partner DB Payment API HTTP Member Service Merchant Service Cash Service Transaction Service
  33. 33. Mapan © Copyright 2020 Example : Payment Gateway (5) Payment Partner DB Payment API HTTP Member Service Merchant Service Cash Service Card Service Voucher Service
  34. 34. Mapan © Copyright 2020 Example : Payment Gateway (6) Payment Partner DB Payment API HTTP Member Service Merchant Service Cash Service Card Service Voucher Service DB DB DB DB
  35. 35. Mapan © Copyright 2020 Example : Payment Gateway (7) Payment Partner Payment API HTTP Member Service Merchant Service Cash Service Card Service Voucher Service DB DB DB DB DB Event Bus (ex: Kafka) Aggregat or Service DB
  36. 36. Mapan © Copyright 2020 Do you need Microservices ?
  37. 37. Mapan © Copyright 2020 Meme Time !!!
  38. 38. Mapan © Copyright 2020 Meme Time !!!
  39. 39. Mapan © Copyright 2020 Microservices Merit and Demerit (Arguable) Merit ● Faster time to market ● Scaling - Based on Component ● Robustness and Resiliency ● Ease of Deployment - Independent Deployability ● Strong System Boundaries ● Adapting to Technology Diversities De-Merit ● Distributed - choose two from these three : Consistency - Availability - Partition ● More complex to operate ○ Most likely you’ll need infrastructure automation and DevOps ○ Observability and not just Monitoring ● Costly ● Technology Overload - Over-engineering ● Developer Experience can be painful ● Testing is harder ● Security can also be painful
  40. 40. Mapan © Copyright 2020 Organizing Your Team
  41. 41. Mapan © Copyright 2020 Deploying Your Services - DevOps CI/CD Pipeline
  42. 42. Mapan © Copyright 2020 Observe All The Things Monitoring Tracing Logging Do you know what your codes are doing on 2AM when your cash payment service is down ?
  43. 43. Mapan © Copyright 2020 Work your assessment and try to answer the following questions : ● What we want to achieve and how we want to achieve it ? ● Do we have strong definition on businesses domain ? ● How did we organize our team ? - (People over Processes over Tools) ● Do our team can adapt quickly to technological changes and technical diversities ? ● Can we facilitate our team when they building things ? ● Can we observe clearly on what happening to our system ? Microservices is an architectural approach, not the architectural approach. Your own context should play a huge part in your decision whether to go down that path. Should We Use Microservices ?
  44. 44. Mapan © Copyright 2020 Enjoy The Journey
  45. 45. Mapan © Copyright 2020 Examples & References
  46. 46. Mapan © Copyright 2020 ● Google Microservices Demo : https://github.com/GoogleCloudPlatform/microservices-demo ● WeaveWorks Microservices Demo : https://github.com/microservices-demo/microservices-demo ● Bookinfo : https://istio.io/latest/docs/examples/bookinfo/ ● Code Instrumentation : https://github.com/tonnyadhi/distributed-tracing-example Code Examples
  47. 47. Mapan © Copyright 2020 ● Distributed Systems , 3rd Edition, Andrew Tanenbaum ● Building Microservices, 2nd Edition, Sam Newman ● Monolith to Microservices, Sam Newman ● Patterns of Enterprise Application Architecture, Martin Fowler ● Microservices Pattern, Chris Richardson References - Books
  48. 48. Mapan © Copyright 2020 ● Monolith Decomposition - Sam Newman https://www.youtube.com/watch?v=9I9GdSQ1bbM&ab_channel=GOTOConferences ● Design Microservices Architecture https://www.youtube.com/watch?v=j6ow-UemzBc&ab_channel=InfoQ ● Microservices - Martin Fowler https://www.youtube.com/watch?v=wgdBVIX9ifA&ab_channel=GOTOConferences ● Event Driven Architecture - Martin Fowler https://www.youtube.com/watch?v=STKCRSUsyP0&ab_channel=GOTOConferences ● Microservices at Netflix Scale https://www.youtube.com/watch?v=57UK46qfBLY&ab_channel=GOTOConferences References - Talks
  49. 49. Mapan © Copyright 2020 Q&A

×