Skip to content

Instantly share code, notes, and snippets.

@t3t5u
Last active October 19, 2015 07:04
Show Gist options
  • Save t3t5u/107fd7203851bdc1ef00 to your computer and use it in GitHub Desktop.
Save t3t5u/107fd7203851bdc1ef00 to your computer and use it in GitHub Desktop.
Gossip Protocol

流行性のブロードキャスト (Epidemic Broadcast) によるプロトコル。

決定論的なツリーに基づくブロードキャスト (Deterministic Tree-Based Broadcast) と比較して、 信頼性 (Reliability) と回復力 (Resiliency) が高く、メッセージのロスは少ないが、 重複するメッセージが大量に転送されるため、あまりスケーラビリティは高くない。

基本的な仕組み

  • あるメッセージを初めて受け取ったら、ランダムに選ばれた幾つか (fan-out) のノードに、そのメッセージを転送する。
  • 再度、同じメッセージを受け取ったら、そのメッセージは破棄する。

戦略のバリエーション

Eager Push Approach

  • メッセージを直ぐに転送する。

Pull Approach

  • 定期的に新しいメッセージを取りに行く。

Lazy Push Approach

  • メッセージの識別子は直ぐに転送する。
  • メッセージの識別子を受け取ったら、メッセージのペイロードを取りに行く。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment