From 2ab74bed2766e67b9dcc56e7fa61e487f3152e48 Mon Sep 17 00:00:00 2001 From: beklapko Date: Wed, 22 Jul 2015 09:58:48 -0700 Subject: [PATCH] Light copy edits. --- docs/architecture_design.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/architecture_design.md b/docs/architecture_design.md index 7f448953..1518502a 100644 --- a/docs/architecture_design.md +++ b/docs/architecture_design.md @@ -1,11 +1,11 @@ -# Architecture, Design and Implementation +# Architecture, Design, and Implementation ## Concepts ### Membership Protocol Ringpop implements a membership protocol that allows nodes to discover one another, disseminate information quickly, and maintain a consistent view across nodes within your application cluster. Ringpop uses a variation of the gossip protocol known as SWIM (Scalable Weakly-consistent [Infection-style](http://www.cs.cornell.edu/~asdas/research/dsn02-swim.pdf) Process Group Membership Protocol) to disseminate membership updates across the many members of the membership list. Changes within the cluster are detected and disseminated over this protocol to all other nodes. -Ringpop uses SWIM gossip protocol mechanisms of “ping” and “ping-req”. Pings are used for disseminating information and fault detection. Members ping each other in random fashion until they get through the full membership list, rotate the list, then repeat the full round of pinging. +Ringpop uses the SWIM gossip protocol mechanisms of “ping” and “ping-req”. Pings are used for disseminating information and fault detection. Members ping each other in random fashion until they get through the full membership list, rotate the list, then repeat the full round of pinging. ####SWIM Gossip Protocol for Information Dissemination Let’s say you have a cluster with two nodes: A and B. A is pinging B and B is pinging A. Then a third node, C, joins the cluster after pinging B. At this point B knows about C, but A does not. The next time B pings A, it will disseminate the knowledge that C is now part of the cluster. This is the information dissemination aspect of the SWIM gossip protocol. @@ -14,12 +14,12 @@ Ringpop gossips over TCP for its forwarding mechanism. Nodes within the ring/mem A membership list contains instances’ addresses and statuses (alive, suspect, faulty, etc.). It also contains additional metadata like the incarnation number, which is the logical clock. All this information is combined and we compute a checksum from it. -The checksums detect a divergence in the cluster in the event a request is forwarded, or a ping occurs and the source and destinations checksums differ. Then the divergence is detected that needs to be rectified. +The checksums detect a divergence in the cluster in the event a request is forwarded, or a ping occurs, and the source and destinations checksums differ. Ringpop retains members that are “down” in its membership list. SWIM manages membership status by removing down members from the list, whereas Ringpop keeps down members in the list allowing the ability to merge a split-brain after a network partition. For example, let’s say two clusters form your application. If there isn’t a way to identify which nodes were previously faulty or down because the network partition happened during that time, there would be no way to merge them back together. ### Consistent Hashing -Ringpop leverages consistent hashing to minimize the number of keys to rebalance when your application cluster is resized. Consistent hashing in Ringpop allows the nodes to rebalance themselves, and traffic is evenly distributed. Ringpop uses [FarmHash](https://code.google.com/p/farmhash/) as its hashing function because it is fast and provides good distribution. Consistent hashing applies a hash function to not only the identity of your data, but also the nodes within your cluster that are operating on that data. +Ringpop leverages consistent hashing to minimize the number of keys to rebalance when your application cluster is resized. Consistent hashing in Ringpop allows the nodes to rebalance themselves with traffic evenly distributed. Ringpop uses [FarmHash](https://code.google.com/p/farmhash/) as its hashing function because it's fast and provides good distribution. Consistent hashing applies a hash function to not only the identity of your data, but also the nodes within your cluster that are operating on that data. Ringpop maintains a consistent hash ring of its members. Once members are discovered to join or leave the cluster, that information is added into the consistent hash ring. Then the instances’ addresses along that ring are hashed, giving a particular part about of the key space over to that instance for the time it is alive and operating. @@ -29,7 +29,7 @@ Ringpop adds a uniform number of replica points per node. To spread the nodes ar ### Forwarding -Ringpop offers proxying as a convenience and can be used to route your application's requests. As your application is receiving traffic, that traffic is probably directed toward a particular entity in your system like an object with an id. That id belongs somewhere in your cluster on a particular instance, depending on how it hashes. If the key hashes to an instance that did not receive the request, then that request is simply forwarded and everything is taken care of under the hood. This acts like a middleware layer for applications. Before the request even gets to your business logic, it is already routed to the appropriate node. +Ringpop offers proxying as a convenience and can be used to route your application's requests. Traffic through your application is probably directed toward a particular entity in your system like an object with an id. That id belongs somewhere in your cluster on a particular instance, depending on how it hashes. If the key hashes to an instance that did not receive the request, then that request is simply forwarded and everything is taken care of under the hood. This acts like a middleware layer for applications. Before the request even gets to your business logic, it is already routed to the appropriate node. Ringpop has codified a handle or forward pattern. If a key arriving at instance A hashes to the node, it can process it, otherwise, it forwards it. This information is forwarded using a protocol called [TChannel](https://github.com/uber/tchannel). TChannel is a networking framing protocol developed by Uber, used for general RPC. Ringpop uses TChannel as its proxying channel and transport of choice. It supports out-of-order responses at extremely high performance with benchmarks ranging from 20,000 to 40,000 operations per second. @@ -39,7 +39,7 @@ Ringpop packs forwarded requests as HTTP over TChannel. HTTP is packed into the As an example, let's say node C joins a ring and now all of the addresses and replica points are evenly distributed around the ring. A, B, and C are pinging one another. The handle or forward pattern peforms a `ringpop.lookup`, gives it the sharding key and gets a destination back. If the destination resolves to A, then A can handle the request; otherwise it forwards it over TChannel transport to its destination. -**Note**: Eventually, this process will be moved over to a Thrift model instead of HTTP. +**Note**: Eventually, this process will be moved to a Thrift model instead of HTTP. ## How Ringpop Works