Fault vs Failure
“A fault is … one component deviating from its spec, whereas a failure is when the system as a whole stops providing the required service.”
Fault یعنی یک جزء از سیستم از مشخصاتش منحرف شود؛ Failure زمانی است که کل سیستم دیگر سرویس موردنیاز را ارائه ندهد.
مفهوم:
هدف طراحی این است که Fault به Failure تبدیل نشود.
هدف عملی Reliability چیست؟
“The goal is to minimize the likelihood of failures, and to minimize the impact of failures when they do occur.”
دو محور اصلی:
کاهش احتمال + کاهش شدت اثر.
Fault و Failure چه تفاوتی دارند؟
“A fault is usually defined as one component of the system deviating from its spec, whereas a failure is when the system as a whole stops providing the required service to the user.”
Fault در سطح جزء است؛
Failure در سطح تجربه کاربر تعریف میشود.
چه زمانی ممکن است Reliability را قربانی کنیم؟
“We may choose to sacrifice reliability in order to reduce development cost… but we should be very conscious of when we are cutting corners.”
کاهش reliability باید تصمیم آگاهانه باشد، نه تصادفی.
Scalability تعریف ساده دارد؟
“Scalability is the term we use to describe a system’s ability to cope with increased load.”
Scalable بودن یک برچسب مطلق نیست.
وابسته به نوع رشد load است.
Throughput vs Response Time؟
“In online systems, what’s usually more important is the service’s response time.”
Batch → throughput
Online → latency مهمتر است.
Head-of-line blocking چیست؟
“A small number of slow requests [can] hold up the processing of subsequent requests.”
چند درخواست کند میتوانند کل صف را slow کنند.
اصل مهندسی پشت Hybrid چیست؟
“Your application may have very different characteristics, but you can apply similar principles to reasoning about its load.”
Load distribution را تحلیل کن، نه فقط average را.
Design باید بر اساس shape داده باشد، نه میانگین.
Fan-out on Write دقیقاً چیست؟
“Maintain a cache for each user’s home timeline… When a user posts a tweet, look up all the people who follow that user, and insert the new tweet into each of their home timeline caches.”
ترجمه:
«برای هر کاربر یک کش از تایملاین نگه دارید… وقتی کاربری توییت میکند، تمام دنبالکنندگان او را پیدا کرده و توییت جدید را در تایملاین هر کدام درج کنید.»
📌 مفهوم:
Materialization در زمان write انجام میشود.
خواندن ارزان، نوشتن گران.
مزیت کلیدی Fan-out on Write چیست؟
“The request to read the home timeline is then cheap, because its result has been computed ahead of time.”
ترجمه:
«درخواست خواندن تایملاین ارزان است، چون نتیجه از قبل محاسبه شده است.»
📌 Tail latency خواندن پایین و پایدار است.
Compute on Read چیست؟
“When a user requests their home timeline, look up all the people they follow, find all the tweets for each of those users, and merge them (sorted by time).”
ترجمه:
«وقتی کاربر تایملاین را میخواهد، تمام افرادی که دنبال میکند پیدا میشوند، توییتهایشان استخراج میشود و با هم ادغام و مرتب میگردند.»
📌 Query-time join
Write ارزان، read گران.
Fan-out vs Compute از نظر معماری چه دو فلسفهای هستند؟
Precompute vs Lazy Compute
Push Model vs Pull Model
Materialized View vs On-demand Query