(9) How does Uber's ringpop work in a layman's terms? - Quora



(9) How does Uber's ringpop work in a layman's terms? - Quora

I hope this is layman's enough. Please let me know if it isn't...

Think of how distributed applications (services, in the Service-Oriented Architecture sense) are traditionally provisioned and run. That is, as a set of independent worker processes (let's call them instances from now on). Each of these instances are, for the most part, treated equally and get their fair share of traffic. These instances also don't know about one another. They act as if they are the only ones serving traffic for your application! How dare they! :P Their use is orchestrated by something else, like a load-balancer, in front of them.

This model is all well and good, but not the Ringpop model[1]. The very foundations of Ringpop are based on a membership protocol derived from SWIM. A membership protocol gives the ability for these independent instances to discover one another, establish connections for communication between one another and provides a very powerful building block to implement more advanced features like an actor model, (weak) leader election, work delegation, distributed querying and command execution, request coalescing, application-layer caching and more.

Ringpop has applied consistent hashing on top of its membership protocol as a part of its core offering. Consistent hashing is all about partitioning a keyspace and assigning ownership to each of the partitions. The keyspace is mapped onto a range of your choosing, but are typically a hash of the IDs of the entities/objects in your application. The owners are the individual instances of your application that were discovered through Ringpop's membership protocol. In short, certain objects in your application are owned by certain instances. Ownership is distributed evenly, but not in the same way a round-robin scheduler might distribute evenly.

What happens when membership changes, for instance, when you want to add capacity to your application or some hosts running your application fail? Ringpop automatically detects those changes and integrates them into its membership list and consistent hash ring. This integration may result in partitions being reassigned or rebalanced (aka new owners for the objects in your application).

Why is any of this good? When you want certain guarantees or deterministic behavior out of your application at tremendous scale often not everything can be homogenous. Not everything can serve every request or store all of the data and even if they could, sometimes it's extremely hard to do efficiently.

The other nice part about Ringpop is that, for any application embedding it, its clients remain completely ignorant of the underlying sharding scheme. Clients neither know nor have to care about who the right instance is to serve a request. They may send a request anywhere and Ringpop forwards it to the correct owner.

In summary, Ringpop provides scalable, fault-tolerant application-layer sharding. More fundamentally, it provides the instances of a distributed application with the ability to cooperate and coordinate in a variety of ways. Choose your own adventure!

Providing more clarity around Ringpop and its intended use is not only a fun problem to work through, but it's also my job. I hope this helps!

[1] Ringpop does not preclude your application from having a load-balancer in front of it. In fact, it still ought to!

Read full article from (9) How does Uber's ringpop work in a layman's terms? - Quora


No comments:

Post a Comment

Labels

Algorithm (219) Lucene (130) LeetCode (97) Database (36) Data Structure (33) text mining (28) Solr (27) java (27) Mathematical Algorithm (26) Difficult Algorithm (25) Logic Thinking (23) Puzzles (23) Bit Algorithms (22) Math (21) List (20) Dynamic Programming (19) Linux (19) Tree (18) Machine Learning (15) EPI (11) Queue (11) Smart Algorithm (11) Operating System (9) Java Basic (8) Recursive Algorithm (8) Stack (8) Eclipse (7) Scala (7) Tika (7) J2EE (6) Monitoring (6) Trie (6) Concurrency (5) Geometry Algorithm (5) Greedy Algorithm (5) Mahout (5) MySQL (5) xpost (5) C (4) Interview (4) Vi (4) regular expression (4) to-do (4) C++ (3) Chrome (3) Divide and Conquer (3) Graph Algorithm (3) Permutation (3) Powershell (3) Random (3) Segment Tree (3) UIMA (3) Union-Find (3) Video (3) Virtualization (3) Windows (3) XML (3) Advanced Data Structure (2) Android (2) Bash (2) Classic Algorithm (2) Debugging (2) Design Pattern (2) Google (2) Hadoop (2) Java Collections (2) Markov Chains (2) Probabilities (2) Shell (2) Site (2) Web Development (2) Workplace (2) angularjs (2) .Net (1) Amazon Interview (1) Android Studio (1) Array (1) Boilerpipe (1) Book Notes (1) ChromeOS (1) Chromebook (1) Codility (1) Desgin (1) Design (1) Divide and Conqure (1) GAE (1) Google Interview (1) Great Stuff (1) Hash (1) High Tech Companies (1) Improving (1) LifeTips (1) Maven (1) Network (1) Performance (1) Programming (1) Resources (1) Sampling (1) Sed (1) Smart Thinking (1) Sort (1) Spark (1) Stanford NLP (1) System Design (1) Trove (1) VIP (1) tools (1)

Popular Posts