Distributed system is Partial failure + unbounded latency
for both, we have zero control over it.
To deal with the problem, "time" and "clocks" are suggested in computing.
What would they mean by the way?
Clocks are to mark a particular point in time. For example, "Migo starts writing this post at 7:49 GST." In this sense, timeout is duration or intervals of time.
However, human-friendly time-of-day clocks are not suitable for a distributed system because they require synchronization with a network time protocol(NTP) and are bad for measuring duration or intervals of time.
1) Time-of-day time can jump back and forth either due to daylight saving time.
2) we may need more find-grained resolution to prevent specific races. But that's also OS-specific. (Imagine how horrible it would be when some nodes in the system are spun up in Windows and others on Linux and they have different resolutions)
If you are curious about what would happen if you use something like "Utc.Now()" all the time and how it can introduce bugs, check out the blog from CloudFlare
So perhaps monotonic clocks like Unix timestamps are recommended?
Well, it is absolutely good for marking duration or interval, it doesn't allow for marking a point in time like "now it's 8:16 GST".
Simply put, we don't have a good way of achieving both marking points in time and duration with "physical clocks".
We need a different notion of the clock in a distributed system called a "logical clock."
To be fair, logical clocks don't measure time of day and they don't measure elapsed time either. They instead measure the order of events.
What it cares is which event happened before another.
Suppose A happened before B.
A->B
What does this tell me about causality?
Migo님, 분산 시스템에서 시간과 시계에 대한 흥미로운 글을 공유해 주셔서 감사합니다! 실시간 시계와 단조 시계에 대한 당신의 언급은 정말 중요합니다. 추가로, 시간과 기간을 계산하는 데 유용한 도구를 찾고 있다면 time calculator를 참고해 보세요. 분산 시스템에서 시간을 보다 효율적으로 관리하는 데 도움이 될 수 있습니다!