experiences with microservices at tuenti
TRANSCRIPT
![Page 1: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/1.jpg)
.Experiences with Microservices at
Aarón FasAndrés Viedma
![Page 2: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/2.jpg)
Microservices?
I know what you’re probably thinking...
![Page 3: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/3.jpg)
![Page 4: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/4.jpg)
![Page 5: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/5.jpg)
![Page 6: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/6.jpg)
Who did you say these guys are?
Andrés Viedma@andres_viedma
Aarón Fas@aaronfc
Javadinosaur
Useless gadgets buyer
![Page 7: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/7.jpg)
About
![Page 8: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/8.jpg)
From Social Network...
![Page 9: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/9.jpg)
From Social Network...
![Page 10: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/10.jpg)
To Mobile Operator(full MVNO)
![Page 11: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/11.jpg)
The PHPMonolith
One single source repository
PHP???
![Page 12: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/12.jpg)
Do you need a release?
Take a ticketand wait...
![Page 13: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/13.jpg)
.Microservices
![Page 14: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/14.jpg)
Microservices… again… (and take a shot)
❖ Distributed, independently deployable components
❖ Well defined interfaces
❖ Simple communication interface (HTTP?)
❖ Each service has its own DB
❖ Each service has its own source repository
![Page 15: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/15.jpg)
Microservices… again… (and take a shot)
❖ Distributed, independently deployable components
❖ Well defined interfaces
❖ Simple communication interface (HTTP?)
❖ Each service has its own DB
❖ Each service has its own source repository
THAT ISSOA !!!
![Page 16: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/16.jpg)
Microservices… again… (and take a shot)
❖ Distributed, independently deployable components
❖ Well defined interfaces
❖ Simple communication interface (HTTP?)
❖ Each service has its own DB
❖ Each service has its own source repositoryIs that important enough to deserve a new name???
![Page 17: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/17.jpg)
Mixing technologies
❖ Allows using different languages
❖ Different platform versions
❖ Incremental technology changes / evolution
![Page 18: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/18.jpg)
Separation of responsibilities
❖ Forces separation of responsibilities
➢ Subsystems with well defined facades
➢ Different source repositories
![Page 19: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/19.jpg)
Separation of responsibilities
❖ Forces separation of responsibilities
➢ Subsystems with well defined facades
➢ Different source repositories
YOU DON’T NEED MICROSERVICES!
USE JARS !!!
![Page 20: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/20.jpg)
Continuous deployment
«Our highest priority is to satisfy the customerthrough early and continuous deliveryof valuable software.»
«The best architectures, requirements, and designsemerge from self-organizing teams.»
-- Principles of the Agile Manifesto
![Page 21: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/21.jpg)
Continuous deployment
«Our highest priority is to satisfy the customerthrough early and continuous deliveryof valuable software.»
«The best architectures, requirements, and designsemerge from self-organizing teams.»
-- Principles of the Agile Manifesto1 Service => 1 Team?
Better than Continuous delivery!:Continuous deployment
Team responsible of the deployments?
![Page 22: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/22.jpg)
Beware! High costs
❖ No transactions!
➢ Distributed tx?
❖ Requires a much more complex infrastructure
❖ Difficult integration testing
![Page 23: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/23.jpg)
For us: Seemed like a good idea
❖ We have small self-organized teams => Continuous deployment is a reality
❖ We wanted Java, we had PHP
❖ Strong SRE / DevOps team
❖ Our software was intended mainly to access 3rd parties => transactions not possible anyway
![Page 24: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/24.jpg)
.Communications protocol
![Page 25: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/25.jpg)
Existing libraries
❖ No PHP implementation➢ Avro, Etch, Netflix stack
❖ Only serialization➢ Protocol buffers
❖ Didn’t exist or were too new➢ Cap’n Proto, gRPC
❖ Thrift?➢ Good option, but a lot of PHP boilerplate
![Page 26: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/26.jpg)
TService
❖ Own abstraction layer - RPC based❖ Basic implementation: JSON-RPC❖ Interface Definition Language (IDL)❖ Generates Java / PHP / Erlang:
➢ Interchange objects
➢ Client
➢ Server stub
![Page 27: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/27.jpg)
TService IDL/** * Manages the transfer of balance between subscriptions. * @version 1 */interface BalanceTransferService {
/** Transfer money from one subscription to another one. */String transfer(Donation donation) throws NoSuchSubscriptionException;(...)
}
/** Donation between two subscriptions. */class Donation {
/** Id of the donor */long from;/** Amount of money to transfer */int amount;(...)
}
class NoSuchSubscriptionException extends Exception {int code = 100;
}
Java???
![Page 28: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/28.jpg)
TService Versioning
Interface v1
Service
Client 1
Client 2
(compatible changes)
● New methods● New fields in objects
● New parameters in methods
● Delete methods / parameters / fields
![Page 29: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/29.jpg)
TService Versioning
Interface v1
Service
Interface v2
Client 1
Client 2
(compatible changes)
![Page 30: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/30.jpg)
TService Versioning
Interface v1
Service
Interface v2
Client 1
Client 2
(compatible changes)
![Page 31: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/31.jpg)
.Java Platform
![Page 32: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/32.jpg)
Technology stack
![Page 33: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/33.jpg)
XConfig
❖ Own configuration system❖ YAML files based❖ Git repository❖ Overriding system: by env, common / service❖ Hot reloading
➢ Everything adjusts to changes: even DB pools!
➢ No restart required
![Page 34: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/34.jpg)
Async jobs
TService request processing Enqueue
job
Queued jobs
Executor thread pool
![Page 35: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/35.jpg)
Async jobs
TService request processing Enqueue
job
Queued jobs
Executor thread pool
Cron jobs
Cron jobs programming in config
![Page 36: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/36.jpg)
Feature disabling
❖ Activation / deactivation of features by config➢ Is the new development risky?
➢ Is the rest of services / environment ready for the change?
❖ Partial activation of a feature for a % of users➢ Incremental activation of an optional risky change
➢ A / B tests
![Page 37: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/37.jpg)
Integration tests
❖ Custom JUnit runner➢ Bootstraps the platform
➢ Cleans / restarts the local database
➢ Allows the use of @Inject in tests
➢ Allows overriding in dependency injection => inject mocks of the other services
❖ Uses special, “development” XConfig repo
![Page 38: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/38.jpg)
.Monitoring
![Page 39: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/39.jpg)
Monitoring, a priority
❖ What is happening or has happened?➢ Logs
➢ Metrics
➢ Alarms
❖ Distributed architectures are much more difficult to track
![Page 40: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/40.jpg)
And basically because...
![Page 41: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/41.jpg)
.Let’s talk about logs
![Page 42: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/42.jpg)
Logging
❖ Logging library in Java?➢ Log4j
❖ We needed full details➢ Filters to expand/simplify information logged
➢ Multiple appenders logged into distinct storages
![Page 43: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/43.jpg)
❖ Overview of appenders
Logging
log.info(...); Logger
MySQL Appender
LogStash Appender
Hadoop Appender
![Page 44: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/44.jpg)
❖ Following call’s path (TService calls logging)
Logging
ServiceA ServiceB ServiceCGlobalID = 100RequestID = 1
GlobalID = 100RequestID = 2
GlobalID = 100RequestID = 3
Benefits● Locate in/out for calls● Get all interactions
![Page 45: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/45.jpg)
Logging
❖ Kibana dashboard
What does it look like?
![Page 46: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/46.jpg)
Change query
![Page 47: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/47.jpg)
Customize filters
![Page 48: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/48.jpg)
Log types by color
![Page 49: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/49.jpg)
Full log details
![Page 50: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/50.jpg)
.Let’s talk about metrics
![Page 51: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/51.jpg)
Metrics
❖ We graphs➢ As easy as possible to track new metrics
❖ Do not reinvent the wheel➢ Already using StatsD/Graphite on PHP side
❖ What are we tracking?➢ Basic monitoring metrics added by the platform
➢ Metrics from Tomcat JMX
➢ Metrics related to business
![Page 52: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/52.jpg)
Metrics
❖ Multiple graphs dashboards tested➢ Default graphite one
➢ Grafana
![Page 53: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/53.jpg)
Graphite’s is a little ugly...
![Page 54: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/54.jpg)
Grafana is prettier
![Page 55: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/55.jpg)
Layout customized
![Page 56: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/56.jpg)
Much better UI to create graphs
![Page 57: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/57.jpg)
.Let’s talk about alarms
![Page 58: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/58.jpg)
Alarms
❖ Graphs are ok, but we don’t have people 24x7 staring at them.➢ We need notifications
❖ Different things to monitor➢ SQL queries
➢ Graphite metrics
➢ HTTP requests
➢ ...
![Page 59: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/59.jpg)
Alarms
❖ Created our own alarms system➢ Multiple data sources and easily extensible
➢ Quick edition of conditions
➢ Observers for alarms
❖ We ended up using mainly➢ MySQL and Graphite data sources
➢ Java Expression Language on config checkers
➢ Email notifications
![Page 60: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/60.jpg)
… and then, we found Cabot
Separated by service
![Page 61: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/61.jpg)
Cabot overview
Multiple integrations
![Page 62: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/62.jpg)
Cabot overview
Service status overview
![Page 63: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/63.jpg)
Cabot overview
Graphite checks
![Page 64: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/64.jpg)
Cabot overview (Creating new check)
Set graphite metric
![Page 65: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/65.jpg)
Cabot overview (Creating new check)
Check data
![Page 66: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/66.jpg)
Cabot overview (Creating new check)
Set check type/value
![Page 67: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/67.jpg)
Cabot overview (Creating new check)
Set importance
![Page 68: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/68.jpg)
Cabot
❖ Benefits of using Cabot➢ Friendlier UI than config files➢ No dependency on the service monitored➢ Opensource and many integrations
![Page 69: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/69.jpg)
Alarms
❖ Where are we heading now?➢ Moving now most Graphite alarms to Cabot
➢ Replacing thresholds with dynamic expectations (Holt Winters)
❖ It is still the main alarms platform being used
![Page 70: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/70.jpg)
.That’s all about monitoring
![Page 71: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/71.jpg)
.Some Lessons learned
![Page 72: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/72.jpg)
![Page 73: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/73.jpg)
GO ASYNC!!!
![Page 74: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/74.jpg)
Don’t get blocked for too long
❖ Concurrent requests: don’t wait for free threads➢ Own Rate limit mechanism
➢ Tune container thread pool size
➢ Tune database pool (and other possible blocking pools)
❖ Tune clients timeout➢ It may depend on called service / operation
➢ It may depend on the caller
![Page 75: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/75.jpg)
Asynchronous logging
log.info(...)Appender MySQL
Appender Logstash
AppenderHadoop
Logger
![Page 76: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/76.jpg)
Asynchronous logging
log.info(...)
When the ring buffer is full…WAIT!
Appender MySQL
Appender Logstash
AppenderHadoop
Logger
Ring buffer
Async Logger
Not configurable!
![Page 77: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/77.jpg)
Asynchronous logging
log.info(...)
When the ring buffer is full…WAIT!
Appender MySQL
Appender Logstash
AppenderHadoop
Logger
Ring buffer
Async Logger
Async Appender
Async Appender
Async Appender
Not configurable!
When async appender full, messages are discarded
![Page 78: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/78.jpg)
Asynchronous operations
❖ Getters➢ Make them fast (sacrifice consistency)
➢ Cache
➢ Use default values
❖ Setters➢ No operation result
➢ Wait for a notification of operation finished
➢ Query the status of the change
![Page 79: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/79.jpg)
Message queues
❖ Operation queues➢ Retry system
➢ Persistent queues
❖ Publish / subscribe model (pub/sub)➢ Event driven
➢ Reactive programming
![Page 80: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/80.jpg)
Circuit breaker
❖ From the client, consider the status of the service➢ Previous calls
➢ Health checks
❖ If it’s degraded, don’t call it (close the circuit)➢ Return a default response
➢ Enqueue the operation for later retry
➢ Throw an error
![Page 81: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/81.jpg)
.Do It Yourself
![Page 82: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/82.jpg)
Many implementations available
❖ Communication layer➢ gRPC, Cap’n proto, Thrift…
➢ REST, JSON…
❖ Services platform➢ Spring boot, Dropwizard, Spark, Ninja, Jodd…
❖ Netflix stack➢ Hystrix, Ribbon…
![Page 83: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/83.jpg)
Make your own combination!
(it can’t be so difficult…)
![Page 84: Experiences with Microservices at Tuenti](https://reader034.vdocuments.mx/reader034/viewer/2022042615/55c35e05bb61eb536f8b4701/html5/thumbnails/84.jpg)
Aarón Fas@aaronfc
Andrés Viedma@andres_viedma
.Thanks!Questions?