After reading an excellent article about role of the logs in distributed file systems logging seems for me the only answer for cluster-wide-consistency of distributed databases and data integration problem.
Does all distributed systems use logs for synchronization, consistency, replication and recovery purposes? Or they differ only in the format/protocol of log?
Could u please provide an alternative ways of cluster-wide-consistency in distributed databases?
HBase and Bigtable both give another example of logs in modern databases.
What did they mean? Other databases doesn't use logs for consistency purposes?
Consistency is an overloaded term which has multiple meanings. But usually, when people say that a system is consistent they mean that the system is free of contradictions and its behavior matches the specification. Obviously, there are a lot of consistent distributed systems which don't use logs.
Examples:
(joke) If you only write data and never read then /dev/null is consistent because by definition you can't read data so you can't end up with contradiction
Distributed version control systems (like Git) are consistent because they avoid contradictions by keeping both versions (branches) and delegating the resolving of the conflicts to the clients (merge/rebase).
CRDT + Quorum reads/writes. Source code has a complex structure, and it's impossible to think about a universal auto merge algorithm. But with simpler structures it's possible. If we need to implement a trivial comment system and we don't care about the order and delete/edit capabilities, then we can store comments in a set and use set-union as the automated conflict resolution strategy. CRDT protects against conflicts, while quorum reads/writes gives us the wall-clock order: once an operation finishes its effects are visible to all follow-up reads. The lack of conflicts and wall-clock time guarantee the lack of contradictions.
Quorum reads/writes + single client. If a system has only one client then the conflicts are also impossible so the quorum reads/writes provides consistency as well.
People usually confuse consistency with linearizability, but even if we talk about linearizability then there are ways to use it without logs. The most famous protocol for achieving linearizability is Paxos.
Paxos is about building a distributed write-once register (Multi-Paxos is about distributed append-only log). It seems that regular Paxos (non Multi-Paxos) has a very narrow set of applications but:
We still can build consistent distributed systems on top of it. For example, we can use Paxos to overcome the downside of 2PC (2PC blocks a system if a coordinator fails): since a coordinator needs to decide to abort or commit a transaction only once, so it's fine to use write-once register to store that decision.
It has has a variant allowing to use it as a rewritable register without logs. I described this approach in the How Paxos Works post and implemented it in the Gryadka project with 500-lines of JavaScript. Also, the idea behind it was independently checked with TLA+ by Greg Rogers and Tobias Schottdorf.