Alle Beispiele

Beispiele

Welche Keys wandern, wenn ein Cache-Server dazukommt

Drei Cache-Server und vier Keys auf einem Hash-Ring, jeder Key beim nächsten Server im Uhrzeigersinn; ein vierter Server kommt dazu, und nur ein Key wandert zu ihm.

Dieses Video wurde mit dem Skill System Design gemacht.

  • 0:58
  • System Design
  • Gesprochen von Kore
  • Englisch

Aus einem Prompt erstellt

Explain consistent hashing with a hash ring: which keys move when a server is added?

Transkript zum Video

Adding one cache server should not force every cached key to move.

We hash cache server A onto a circle, then place servers B and C.

Now hash apple, book, cat, and dog onto that same circle, using their keys.

Each key belongs to the first server clockwise around the ring. So dog wraps past the top to A.

What happens when you need more capacity? Add server D between A and B.

Only book moves from B to D; its hash falls between A and D.

With uniform hashes, adding a fourth server moves about one quarter of keys on average. Real caches must refill moved entries.

Keys mark data; servers own the preceding clockwise interval. Adding D changes only its new interval, keeping other owners stable.

Dein Thema, gezeichnet in etwa einer Minute.

Deine ersten 2 Videos sind kostenlos, je bis zu 1 Minute lang, mit Wasserzeichen. Keine Kreditkarte nötig. Das komplette Produkt, inklusive aller Stimmen und Stile.