This presentation approaches many challenges moving forward Microservices
Gustavo PantuzaMicroservices Challenges
View Slide
AgendaContext Considerations Use cases
Monolith
Monolith● Big code base● Difficult to scale● Easy to monitor/troubleshoot● Many responsibilities● Complex to deploy
microservice
Microservice● Small code base● Single responsibility● Complex to troubleshoot● Complex to monitor● Easier to test and deploy
Microservices challengesStep 1Application exampleStep 2Show a problemStep 3Propose a solution
Circuit breakerStep 1
Step 2If the microservices I integrate fail,how can I guarantee myauthentication system?Circuit breaker
Step 3If x% of failuresend emails toguaranteeauthenticationCircuit breaker
ScaleStep 1
ScaleStep 2How to increase load withoutsaturate computational resources?
ScaleStep 3Horizontal auto scaleCPU: 50%CPU: 95%CPU: 85%CPU: 50%CPU: 50%
ScaleStep 3$> kubectl autoscale \deployment php-apache \--cpu-percent=50 \--min=1 \--max=10
FreshnessStep 1
Step 2Content must be updated and everbeen shown to end usersFreshness
Step 3Cache pipelineProactive purgeFreshness
Passo 1Integration
Passo 2Integration How to add new applications withoutchanging my previous services?
Passo 3Integration● APIs Agregation● Enforce availability on BFFBFF - Backend for Front-end
ReliabilityStep 1API
Step 2If my service becomes unavailablewhat my clients should do?Reliability
Step 3Retry Backoff CacheReliability
CapacityStep 1Varnish
CapacityStep 2As traffic grows system startspaginating anddenying connections
User spaceCapacityStep 3Turn off swap TCP/IP tuningKernel spaceOperating system Tuning. swapoff --all. sysctl -w net.ipv4.tcp_fin_timeout=15
MonitoringStep 1
MonitoringStep 2How to minimize failure detectionand recovery time?
MonitoringStep 3● Zabbix● cachetFeedback system● Prometheus● Graylog
DesignStep 1
Step 2Software changes should notimpact all clientsDesign
Step 3TenantsDesignUSD BRL EUR. Extensibility. Customizable
CommunicationStep 1APIs
Passo 2How to compute votes andminimize response time?Communication
Passo 3Buffer in memory1000 votes or 10 seconds...Communication
DistributionStep 1
DistributionStep 2How to avoid a single point of failure?
DistributionStep 1Application distribution over network PoDs
AvailabilityStep 1A B C D E F G HApplication servers/containers
AvailabilityStep 2How to evenly distribute load over allapplication servers/containers?
AvailabilityStep 3Load balancingA B C D E F G H● IPVS● Neutrino● HAProxy● NginxL4 L7
DRYStep 1A BC DAuthenticationAuthorization
Step 2How to avoid repeating computationson many services?DRY
Step 3API GatewayDRYA BC DGKong HQ
Step 1Interfaces{"what": "A json example","test": true,"values": [42, 10, 5.32],"data": {"name": "Test Name","type": null}}
Step 2How to change my servicescontracts without breaking myclients integration?Interfaces
Step 3Generic and versioned InterfacesInterfaces. 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;}
Step 1Networking
Step 2How to deploy multiplemicroservices clusters and do notcollide sub-networks?Networking
Step 3Overlay networking. KubeRouter . VXLAN. Open vSwitch . IPIP tunnel. GRENetworkingSubnet: 10.0.10.0/24 Subnet: 10.0.10.0/24vRouter: 192.168.0.100/32 vRouter: 192.168.0.200/32
Step 1FilteringHostHypervisorVMs
Step 2How to filter traffic withoutoverloading network equipments?Filtering
Step 3Software Defined Networking. Open vSwitch . Netfilter/IP tablesFilteringHostHypervisorVMsOvS
Step 1A BC DTracing
Step 2How to know which service has failed?Tracing
Step 3TracingX-Request-IDGET /myservice/myresource HTTP/1.1Host: myservernameX-Request-ID: 30f14c6c1fc85cba12bfd093aa8f90e3Accept: */*A BC DRequest Identification
Questions?https://blog.pantuza.comhttps://github.com/pantuzahttps://twitter.com/gpantuza