Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Bulletproof API's

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

Bulletproof API's

In high-availability systems is necessary to deal with inevitable failures. Whether they are temporary or not, we can have a direct impact in the user experience.

Bulletproof API's is a set of practices, techniques, and implementations that focus in providing resilience, identifying the type of failure and making possible to recover quickly, reducing or even eliminating the impact in the user experience.

Some topics that will be covered:
* Retries
* Circuit Breakers
* Timeouts
* How to identify and deal with different types of traffic
* Effective metrics analysis
* A real case and how the techniques were applied

At the end of the talk, it will be possible to understand how resilience approaches can impact the improvement of the users final experience.
An objective view of tools that we have available in the market.

And the importance of identifying temporary failures and how to deal with them.

Avatar for Vinicius Souza

Vinicius Souza

August 16, 2019

More Decks by Vinicius Souza

Other Decks in Programming

Transcript

  1. 3 What is a bulletproof thing? " d e s

    c r i b e a n o b j e c t a s b e i n g indestructible, to never stop working, or to outperform other similar products."
  2. 5 East West traffic. East-west traffic refers to the network

    communications between servers, applications and databases within the data center. Service Two Service One Database
  3. 6 North South. North-South traffic is the client server traffic

    that goes between users in a branch office and the data center that hosts the application that they are accessing. Web App User
  4. 7 Heavy traffic. Only 20% a datacenter traffic is a

    North South. 20% 80% East West North South
  5. Calculating percentiles. 953 ms | 99% 497ms | 70% 13

    E X : 1 4 9 , 1 8 5 , 2 2 1 , 2 7 3 , 3 0 9 , 4 3 0 , 4 5 1 , 4 9 7 , 8 2 1 , 9 5 3 430ms | 50%
  6. 15 Retries mechanisms can have success after a simple failure

    and most important, can help us to identify which kind of failure we have. Retry. Backoffs Max Attempts Identify
  7. 18 Circuit breakers. Wrap a protected function call in a

    circuit breaker object, which monitors for failures. Once the failures reach a certain threshold, the circuit breaker trips, and all further calls to the circuit breaker return with an error or with some alternative service or default message, without the protected call being made at all.
  8. 19 Start monitoring for errors. If threshold was reached the

    circuit change the state. Start monitoring for recovering. If have a confirmed success, alter circuit breaker state. Function wrapped
  9. 27 BRA X COS. 22/06/2018 - 09:00:00 5' 6' 7'

    8' 9' 10' 0 1 2.092 7.580 2 0 Rescued errors by Circuit Breaker
  10. 28 POR X ESP. 15/06/2018 - 03:00:00 PM 0' 8'

    24' 44' 55' 58 88 70 673 444 444 217 228 2 68.300 50.100 54.700 34.300 34.100 33.100 37.600 Req/m Rescued errors by Circuit Breaker
  11. 29 KOR X GER. 22/06/2018 - 11:00:00 63' 64' 65'

    66' 34.900 86.000 72.100 52.800 Req/m 63' 64' 65' 66' 125 141 107 101 service 1 P95