Networked Components which communicate and coordinate their actions by passing messages
Troll Definition
Capacity to Recover from difficulties
Incorrect internal state in your system
Inability of the system to do its intended job
https://github.com/gojektech/heimdall
Resiliency Pattern #0
Stop waiting for an answer
Resiliency Pattern #1
httpClient := http.Client{}
_, err := httpClient.Get("https://gojek.com/drivers")
httpClient := heimdall.NewHTTPClient(1 * time.Millisecond)
_, err := httpClient.Get("https://gojek.com/drivers",
http.Header{})
Try again on Failure
Resiliency Pattern #2
backoff := heimdall.NewConstantBackoff(500)
retrier := heimdall.NewRetrier(backoff)
httpClient := heimdall.NewHTTPClient(1 * time.Millisecond)
httpClient.SetRetrier(retrier)
httpClient.SetRetryCount(3)
httpClient.Get("https://gojek.com/drivers", http.Header{})
Stop making calls to save systems
Resiliency Pattern #3
config := heimdall.HystrixCommandConfig{
MaxConcurrentRequests: 100,
ErrorPercentThreshold: 25,
SleepWindow: 10,
RequestVolumeThreshold: 10,
}
hystrixConfig := heimdall.NewHystrixConfig("MyCommand",
config)
timeout := 10 * time.Millisecond
httpClient := heimdall.NewHystrixHTTPClient(timeout,
hystrixConfig)
_, err := httpClient.Get("https://gojek.com/drivers",
http.Header{})
Degrade Gracefully
Resiliency Pattern #4
Resiliency Pattern #5
Test and Break
Unknown Unknowns
Come meet us ...