DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Securing Your Software Supply Chain with JFrog and Azure
Register Today

Trending

  • A Comprehensive Guide To Testing and Debugging AWS Lambda Functions
  • How To Use Geo-Partitioning to Comply With Data Regulations and Deliver Low Latency Globally
  • Manifold vs. Lombok: Enhancing Java With Property Support
  • Hiding Data in Cassandra

Trending

  • A Comprehensive Guide To Testing and Debugging AWS Lambda Functions
  • How To Use Geo-Partitioning to Comply With Data Regulations and Deliver Low Latency Globally
  • Manifold vs. Lombok: Enhancing Java With Property Support
  • Hiding Data in Cassandra
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Large Scale Distributed Consensus Approaches: Computing with a Hundred Node Cluster

Large Scale Distributed Consensus Approaches: Computing with a Hundred Node Cluster

Oren Eini user avatar by
Oren Eini
·
Nov. 20, 14 · Interview
Like (0)
Save
Tweet
Share
3.86K Views

Join the DZone community and get the full member experience.

Join For Free

i’m using 100/99 node cluster as the example, but the discussion also apply for smaller clusters (dozens of nodes) and bigger clusters (hundreds or thousands). pretty much the only reason that you want to go with clusters of that size is that you want to scale out your processing in some manner. i’ve already discussed why a hundred node cluster isn’t a good option for safety reasons.

consensus algorithm create a single consensus in the entire cluster, usually about an order set of operations that are fed to a state machine. the easiest such example would be a dictionary. but it make no sense to have a single dictionary spread across hundred nodes. why would you need to do that?  how would it give you the ability to make full use of all of the power of all those nodes?

usually nodes are used for either computing or storage purposes. computing is much easier, so let us take that as a good example. a route calculating system, need to do a lot of computations on a relatively small amount of information (the map data). whenever there is a change in the map (route blocked, new road open, etc), it needs to send the information to all the servers, and make sure that it isn’t lost.

since calculating routes is expensive (we’ll ignore the options for optimizations and caching for now), we want to scale it to many nodes. and since the source data is relatively small, each node can have a full copy of the data. under this scenario, the actual problem we have to solve is how to ensure that once we save something to the cluster, it is propagated to the entire cluster.

the obvious way to do this is with a hierarchy:

image

basically, the big icons are the top cluster, each of which is responsible for updating a set of secondary servers, which is then responsible for updating the tertiary servers.

to be perfectly honest, this looks nice, and even reasonable, but it is going to cause a lot of issues. sure, the top cluster is resilient to failures, but relying on a node to be up to notify other nodes isn’t so smart. if one of the nodes in the top cluster goes down, then we have about 20% of our cluster that didn’t get the notice, which kind of sucks.

a better approach would be to go with a management system and a gossip background:

image

in other words, the actual decisions are down by the big guys (literally, in this picture). this is a standard consensus cluster (paxos, raft, etc). once a decision has been made by the cluster, we need to send it to the rest of the nodes in the system. we can do that either by just sending the messages to all the nodes, or by selecting a few nodes and have them send the messages to their peers. the protocol for that is something like: “what is the like command id you have? here is what i have after that.” assuming that each processing node is connected to a few other servers, that means that we can send the information very quickly to the entire cluster. and even if there are errors, the gossiping server will correct it (note that there is an absolute order of the commands, ensured by the consensus cluster, so there isn’t an issue about agreeing to this, just distributing the data).

usually the gossip topology follows the actual physical distribution. so the consensus cluster will notify a couple of servers on each rack, and let the servers in the rack gossip among themselves about the new value.

this means that once we send a command to the cluster, the consensus would agree on that, then we would distribute it to the rest of the nodes. there is a gap between the consensus confirming it and the actual distributing to all the nodes, but that is expected in any distributed system. if it is important to sync this on a synchronized basis across the entire cluster, the command is usually time activated (which require clock sync, but that is something that we can blame on the ops team, so we don’t care smile ).

with this system, we can have an eventually consistent set of data across the entire cluster, and we are happy.

of course, this is something that is only relevant for compute clusters, the kind of things were you compute a result, return it to the client and that is about it. there are other types of clusters, but i’ll talk about them in my next post.

cluster AI Computing

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Trending

  • A Comprehensive Guide To Testing and Debugging AWS Lambda Functions
  • How To Use Geo-Partitioning to Comply With Data Regulations and Deliver Low Latency Globally
  • Manifold vs. Lombok: Enhancing Java With Property Support
  • Hiding Data in Cassandra

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: