14 Ocak 2020 Salı

Fault Tolerance - Hataya Dayanıklılık - Yazılım veya Donanımda Hata Olsa Bile Sistem Çalışmaya Devam Eder

Giriş
Fault tolerance (hataya dayanıklılık) bir sistemin bileşenlerinden birisinin bozulması halinde dahi sistemin sadece çalışmaya devam etmesi değil, aynı zamanda doğru (correct) şekilde çalışmaya devam edebilmesidir. Tabii bunun olması için özel bazı tedbirlerin alınması gerekiyor.

Yani hem tek arıza noktası (single point of failure) olmayacak, hem de doğru çalışmaya devam edecek

Dolayısıyla Fault Tolerance'ın temelinde bir bileşenin eninde sonunda bozulacağı varsayımı vardır ve bu durum normal kabul edilir. Sistem paniklemez :) Açıklaması şöyle
The system considers the failure of components to be a normal mode of operation, and continues operation with no or minimal interruption.
Bazı sorular şöyle.
What happens when the database isn't there?
What happens if all connections time out?"
Mevcut Sistemi Fault Tolerant Hale Getirmek
Eğer en baştan tasarlanmazsa mevcut sistemi bu hale getirmek zor. Açıklaması şöyle.
Fault tolerance — alongside with security and other traits - is hard to factor-in after the service is already built. It's created by making careful design decisions starting at the same time your service was born.
Çoğunlukla Hataya Sebep Olan Genel Şeyler
Bir sistemi Fault Tolerance hale getiremesek bile çoğunlukla hataya sebep olan genel şeyleri bilmekte fayda var. Bazıları şöyle
1. Hardware Faults
2. Incorrect error handling
Hataların göz ardı edilmesi veya hataların çok genel şekilde işlenmesi

3. Configuration Changes
Konfigürasyon değişse bile sistemin her bileşeninin bu hemen almaması ve hataların ilerleyen bir zamanda ortaya çıkması

4. Single Points of Failure

5. Network Faults
6. Resource Leaks
7. Load Pressure
8. Cascading Failures

Fault Tolerance vs Resiliency
Açıklaması şöyle
Fault tolerance means given a microservice application how much tolerant it is or what is the impact when there is a fault, will the whole application goes down or part of functionality goes down or there are some arrangements to handle failures.

Resilience means how many faults the system can tolerate.
Fault Tolerance vs High Availability
Fault Tolerance vs High Availability yazısına taşıdım

Fault Tolerance ve Performans

Fault Tolerant sistemler arıza durumunda eski performansı sağlamayabilirler. Açıklaması şöyle.
Now, with FT, we will again, try to minimize downtime but performance will not be a concern, in fact, you could say that a degraded performance is going to be expected.
Fault Tolerance Çözümleri

1. Yedek Sistem
Fault tolerance sağlamak için en sık kullanılan yöntem Redundancy. Açıklaması şöyle
The simplest way to introduce fault-tolerance into any system is by introducing redundancy.
Redundancy deyince akla sadece birbirini yedekleyen 2 tane sistem geliyor. Ancak sayı aslında önemli.

Örnek
Klasik olarak arıza sebebiyle kartın bozulması durumunda, yedek kartın devreye girmesi örneği verilebilir.

Örnek
Uçaklarda kullanılan Fail Operational kavramı da bence Yedek Sistem tanımına giriyor. Açıklaması şöyle.
Fail operational - Where you have 3 autopilots engaged, such that any single failure will result in the remaining 2 autopilots being able to safely land the aircraft. That is if there is a failure autoland remains operational.
Fail Passive - Where you have 2 autopilots engaged, such that a single autopilot failure will result in the disengagement of both autopilots with no significant deviation from the established flight path. In this case the pilot must manually take control and go-around/land.
Fail Operational Sistemlerin bazı özellikleri şöyle. Burada otopilot sayısının 3 olduğuna dikkat etmek lazım.
The following are typical arrangements which may be acceptable for Fail Operational Systems:
  1. Two or more monitored fail passive autopilots or integrated autopilot flight director systems each with dual channels making up an automatic fail operational system designed so that at least one autoflight system remains operative after the failure of one system, and the failed system is not used or cannot cause unacceptable autoflight system performance.
    Note: Following a failure with this configuration, it is not intended that a landing be continued with flight director alone, unless a successful Proof of Concept demonstration has been completed.
  2. Three autopilots or integrated autopilot flight director systems designed so that at least two remain operative after failure to permit comparison and provide necessary monitoring and protection while continuing to a landing.
  3. A monitored fail passive automatic flight control system with automatic landing capability to touchdown and rollout, if applicable, plus an independent and adequately failure protected manual flight guidance system, suitable for landing and rollout with guidance provided for the flying pilot and monitoring displays for the non-flying pilot. A proof of concept demonstration would be necessary for this arrangement.
  4. Two independent and adequately monitored manual flight guidance systems with independent displays for the pilot flying and the pilot not flying, each capable of supporting a landing and rollout. A proof of concept demonstration would be necessary for this arrangement.
2. Yük Dağıtımı
Bir diğer örnek ise yükün dağıtılmasıdır (load balancing). Örneğin IP adresi şöyle dağıtılabilir.
a. anycast - Bir IP'ye çeşitli bölgelerdeki sunucuların hizmet vermesi
b. geo balance - Bulunulan bölgeye göre IP kullanılması
c. load balancer - Yükün çeşitli sunuculara dağıtılması. Load Balancer yazısına taşıdım

3. Bulkhead Tasarımı
Bu tasarım gemi inşasında kullanılıyor. Geminin gövdesi birbirinden bağımsız bölmeler halinde inşa ediliyor. Böylece bir bölme su alsa bile, diğer bölmeler bağımsız oldukları için gemi batmıyor. Açıklaması şöyle
Why Bulkhead?
A ship is split into small multiple compartments using Bulkheads. Bulkheads are used to seal parts of the ship to prevent the entire ship from sinking in case of a flood. Similarly, failures should be expected when we design software. The application should be split into multiple components and resources should be isolated in such a way that failure of one component is not affecting the other.
4. Yazılımsal Çözümler
Fault Tolerance ve Resiliency İçin Bazı Yazılım Çözümleri yazısına taşıdım.

Hiç yorum yok:

Yorum Gönder