1 / 66

System Reliability and Resilience

System Reliability and Resilience. and stuff. S ome things need to be cleared up first. http://en.wikipedia.org/wiki/Vedette_(cabaret). tuple. //Initialize customer and invoice Initialize( customer, invoice ) ;.

Download Presentation

System Reliability and Resilience

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. SystemReliability and Resilience and stuff

  2. Some things need to be cleared up first

  3. http://en.wikipedia.org/wiki/Vedette_(cabaret)

  4. tuple

  5. //Initialize customer and invoiceInitialize(customer, invoice);

  6. public void Initialize (Customer customer, Invoice invoice){customer.Name=“asdf”;invoice.Date =DateTime.Now;}

  7. Initialize(customer, invoice);//did something happen to customer// and/or invoice?

  8. customer.Name =InitNameFrom(customer, invoice);invoice.Date = InitDateFrom(customer, invoice);

  9. customer.Name =GetNameFrom(customer, invoice);invoice.Date = GetDateFrom(customer, invoice);

  10. var results = Initialize(customer, invoice);customer.Name =results.Item1;invoice.Date = results.Item2;

  11. public tuple<string, DateTime>Initialize(customer, invoice){ return new Tuple<string, DateTime> (“asdf”, DateTime.Now);}

  12. public static boolTryParse (string s, outDateTime result)orpublic static tuple<bool, DateTime?>TryParse (string s)

  13. tuple • Avoid side effects • Avoid out parameters • multiple values without a specific type

  14. null object

  15. private ILogger _logger;public MyClass(ILogger logger) {_logger = logger;}…if (_logger != null) {_logger.Debug(“it worked on my machine!”);}

  16. null checks for everyone!

  17. forget one and…

  18. public class NullLogger:ILogger{ public void Debug(string text) { //do sweet nothing}}

  19. private ILogger _logger = newNullLogger();public MyClass(ILogger logger) {_logger = logger;}…_logger.Debug(“it worked on my machine!”);

  20. null object • Can eliminate null checks • Simple to implement

  21. Circuit Breaker

  22. Retry

  23. Your Application Out of Process Dependency N times

  24. Out of Process Dependency N times * Y clients

  25. = Denial of Service Attack

  26. Limit the # of retries

  27. N * Ybecomes5 * Y

  28. Y isstill aproblem

  29. Circuit Breaker

  30. State MachineOn :: Off

  31. On  Offwhen not healthy

  32. Off  Onmanually

  33. Get to softwarebefore we ask you to dance

  34. HealthyorUnhealthy Out of Process Dependency

  35. State is independent of requestor Out of Process Dependency

  36. Has many independent external dependencies Your Application

  37. Can throttle itself Your Application

  38. Has a wait threshold Your Application

  39. Circuit Breaker External Dependency Your Application Threshold = 2 Pause = 10ms Timeout = 30s State = Closed Request Request Failure (i.e. HTTP 500) Failure Count = 1 Pause 10ms Request Failure (i.e. HTTP 500) Failure Count = 2 State = Open OperationFailedException

  40. Circuit Breaker External Dependency Your Application Threshold = 2 Pause = 10ms Timeout = 30s State = Open System can try to become healthy for 30s Request 30s has not passed CircuitBreakerOpenException Request 30s has not passed CircuitBreakerOpenException

  41. Circuit Breaker External Dependency Your Application Threshold = 2 Pause = 10ms Timeout = 30s State = ½ Open 30s has passed Request Request Failure (i.e. HTTP 500) Failure Count = 2 State = Open OperationFailedException

  42. Circuit Breaker External Dependency Your Application Threshold = 2 Pause = 10ms Timeout = 30s State = ½ Open 30s has passed Request Request Response Failure Count = 0 State = Closed Response

  43. ClosedOpen½ Open

  44. ½ Open is like a manual reset

  45. PauseTimeout

  46. Pausebetween callsin the loop

  47. Timeoutbefore youcan call again

More Related