Microservices Challenges

Microservices Challenges

This presentation approaches many challenges moving forward Microservices

B1412c9ed55333c1df561f64dfad69d3?s=128

Gustavo Pantuza

April 01, 2019
Tweet

Transcript

  1. Gustavo Pantuza Microservices Challenges

  2. None
  3. Agenda Context Considerations Use cases

  4. Monolith

  5. Monolith • Big code base • Difficult to scale •

    Easy to monitor/troubleshoot • Many responsibilities • Complex to deploy
  6. microservice

  7. Microservice • Small code base • Single responsibility • Complex

    to troubleshoot • Complex to monitor • Easier to test and deploy
  8. None
  9. None
  10. Microservices challenges Step 1 Application example Step 2 Show a

    problem Step 3 Propose a solution
  11. Circuit breaker Step 1

  12. Step 2 If the microservices I integrate fail, how can

    I guarantee my authentication system? Circuit breaker
  13. Step 3 If x% of failure send emails to guarantee

    authentication Circuit breaker
  14. Scale Step 1

  15. Scale Step 2 How to increase load without saturate computational

    resources?
  16. Scale Step 3 Horizontal auto scale CPU: 50% CPU: 95%

    CPU: 85% CPU: 50% CPU: 50%
  17. Scale Step 3 $> kubectl autoscale \ deployment php-apache \

    --cpu-percent=50 \ --min=1 \ --max=10
  18. Freshness Step 1

  19. Step 2 Content must be updated and ever been shown

    to end users Freshness
  20. Step 3 Cache pipeline Proactive purge Freshness

  21. Passo 1 Integration

  22. Passo 2 Integration How to add new applications without changing

    my previous services?
  23. Passo 3 Integration • APIs Agregation • Enforce availability on

    BFF BFF - Backend for Front-end
  24. Reliability Step 1 API

  25. Step 2 If my service becomes unavailable what my clients

    should do? Reliability
  26. Step 3 Retry Backoff Cache Reliability

  27. Capacity Step 1 Varnish

  28. Capacity Step 2 As traffic grows system starts paginating and

    denying connections
  29. User space Capacity Step 3 Turn off swap TCP/IP tuning

    Kernel space Operating system Tuning . swapoff --all . sysctl -w net.ipv4.tcp_fin_timeout=15
  30. Monitoring Step 1

  31. Monitoring Step 2 How to minimize failure detection and recovery

    time?
  32. Monitoring Step 3 • Zabbix • cachet Feedback system •

    Prometheus • Graylog
  33. Design Step 1

  34. Step 2 Software changes should not impact all clients Design

  35. Step 3 Tenants Design USD BRL EUR . Extensibility .

    Customizable
  36. Communication Step 1 APIs

  37. Passo 2 How to compute votes and minimize response time?

    Communication
  38. Passo 3 Buffer in memory 1000 votes or 10 seconds

    ... Communication
  39. Distribution Step 1

  40. Distribution Step 2 How to avoid a single point of

    failure?
  41. Distribution Step 1 Application distribution over network PoDs

  42. Availability Step 1 A B C D E F G

    H Application servers/containers
  43. Availability Step 2 How to evenly distribute load over all

    application servers/containers?
  44. Availability Step 3 Load balancing A B C D E

    F G H • IPVS • Neutrino • HAProxy • Nginx L4 L7
  45. DRY Step 1 A B C D Authentication Authorization

  46. Step 2 How to avoid repeating computations on many services?

    DRY
  47. Step 3 API Gateway DRY A B C D G

    Kong HQ
  48. Step 1 Interfaces { "what": "A json example", "test": true,

    "values": [42, 10, 5.32], "data": { "name": "Test Name", "type": null } }
  49. Step 2 How to change my services contracts without breaking

    my clients integration? Interfaces
  50. Step 3 Generic and versioned Interfaces Interfaces . JSON Schema

    . ProtoBuffers /* Proto Buffers */ message Example { string what = 1; boolean test = 2; repeated int32 values = 3; optional DataMessage data = 4; } message DataMessage { string name = 1; optional string type = 2; }
  51. Step 1 Networking

  52. Step 2 How to deploy multiple microservices clusters and do

    not collide sub-networks? Networking
  53. Step 3 Overlay networking . KubeRouter . VXLAN . Open

    vSwitch . IPIP tunnel . GRE Networking Subnet: 10.0.10.0/24 Subnet: 10.0.10.0/24 vRouter: 192.168.0.100/32 vRouter: 192.168.0.200/32
  54. Step 1 Filtering Host Hypervisor VMs

  55. Step 2 How to filter traffic without overloading network equipments?

    Filtering
  56. Step 3 Software Defined Networking . Open vSwitch . Netfilter/IP

    tables Filtering Host Hypervisor VMs OvS
  57. Step 1 A B C D Tracing

  58. Step 2 How to know which service has failed? Tracing

  59. Step 3 Tracing X-Request-ID GET /myservice/myresource HTTP/1.1 Host: myservername X-Request-ID:

    30f14c6c1fc85cba12bfd093aa8f90e3 Accept: */* A B C D Request Identification
  60. None
  61. Questions? https://blog.pantuza.com https://github.com/pantuza https://twitter.com/gpantuza