this is a comparision of yugabyte and foundationdb from the yugabyte website: "Fault…
- User
this is a comparision of yugabyte and foundationdb from the yugabyte website: "Fault tolerance
Distributed databases achieve fault tolerance by replicating data into enough independent failure domains so that loss of one domain does not result is data unavailability and/or loss. Based on a recent presentation, we can infer that replication in FoundationDB is handled at the shard level similar to YugabyteDB. In Replication Factor 3 mode, every shard has 3 replicas distributed across the available storage servers in such a way that no two storage servers have the same replicas.
As previously highlighted in How Does Consensus-Based Replication Work in Distributed Databases?, a strongly consistent database standardizing on Raft (a more understandable offshoot of ) for data replication makes it easy for users to reason about the state of the database in the single key context. FoundationDB takes a very different approach in this regard. Instead of using a distributed consensus protocol for data replication, it follows a custom leaderless replication protocol that commits writes to ALL replicas (aka the transaction logs) before the client is acknowledged.
Write unavailability
Let's compare the behavior of FoundationDB and a Raft-based DB such as YugabyteDB in the context of RF=2, 3 and 5. Note that while RF=2 is allowed in FoundationDB, it is disallowed in Raft-based databases since it is not a fault-tolerant configuration.
FDB vs. Raft
The above table shows that FoundationDB's RF=2 is equivalent to Raft's RF=3 and FoundationDB's RF=3 is equivalent to Raft's RF=5. While it may seem that FoundationDB and a Raft-based DB behave similarly under failure conditions, that is not the case in practice. In a 3-node cluster with RF=2, FoundationDB has 2 replicas of any given shard on only 2 of the 3 nodes. If the 1 node not hosting the replica dies then writes are not impacted. If any of the 2 nodes hosting a replica die, then FoundationDB has to rebuild the replica's transaction log on the free node first before writes are allowed back on for that shard. So the probability of writes being impacted for a single shard because of faults is 2/3, i.e., RF/NumNodes.
In a 3-node RF=3 Raft-based DB cluster, there are 3 replicas (1 leader and 2 followers) on 3 nodes. Failure of the node hosting a follower replica has no effect on writes. Failure of the node hosting the leader simply leads to leader election among the 2 remaining follower replicas before writes are allowed back on that shard. In this case, the probability of writes being impacted 1/3, which is half of FoundationDB's. Note that the probability here is essentially 1/NumNodes.
Leader-driven replication ensures that the probability of write unavailability in a Raft-based DB is at least half of that of FoundationDB's. Also, higher RFs in FoundationDB increase this probability while it is independent of RF altogether in a Raft-based DB. Given that failures are more common in public cloud and containerized environments, the increased probability of write unavailability in FoundationDB becomes a significant concern to application architects.
- Assistant
- User
does yugabytes usage of raft really only have upsides, and are they relevant? what are the downsides?
- Assistant
- User
i mean especially compared to foundationdb.
- Assistant
- User
which one is easier to use in production? foundationdb claims that it is very easy to run in production
- Assistant
Ease of use in a production environment can depend on several factors, including the specifics of your use case, your team's familiarity with the technology, the quality of documentation and community support, among other factors. As of my knowledge cutoff in September 2021, both FoundationDB and YugabyteDB have been used in production by many organizations, and both have their own strengths.
FoundationDB is known for its strong consistency model, ACID transactions, and high performance. It uses a simple key-value data model that can be extended with layers to support different types of data models, like document or relational. Some users find this model to be flexible and powerful, while others might find it adds complexity. Its design also tends to be more operational simplicity due to its shared-nothing architecture, allowing you to add and remove machines to the cluster easily.