ワイドカラムストア

各キーをN個のノードに複製します。読み取りはR個に問い、書き込みはW個を待ちます。

このページはまだ日本語に翻訳されていません。

The Wide-column Store stands for Apache Cassandra, the Component the game is named after.

When to place it#

How it works#

It copies each key to N replicas and uses quorums to read and write. It takes read and write queries, transactions, and timeline writes. It sends nothing on.

When R + W is greater than N, every read asks at least one replica that has the latest write. When it is not, a read can miss the latest write: eventual consistency. A write costs N replica operations and a read costs R, so higher settings use more capacity. Latency is the time of the slowest replica you wait for.

You can spread it across your open regions. Each region then keeps its own replicas, and the Burn grows with each region.

Options#

設定項目設定値表示条件
レプリカ (N)N1 / N2 / N3 / N4 / N5常時
書き込み (W)W1 / W2 / W3 / W4 / W5常時
読み取り (R)R1 / R2 / R3 / R4 / R5常時
ホットキーシャード 1 つ / 分割ハイブリッドファンアウトの後
リージョン1 つ / 分散開いたリージョンが 2 つ
  • N: how many replicas hold each key. A higher N survives more lost replicas and stores more copies.

  • W: how many replicas must confirm a write. A higher W is safer and slower.

  • R: how many replicas a read asks. A higher R is more consistent and slower.

A read sees the latest write when R + W is greater than N. When it is not, a read can come back stale. See Quorum reads and writes.

  • Hot keys: with Hybrid fan-out, Split moves a hot key off its shard, so one key stops setting the pace. See Hot keys and hot shards.

  • Regions: Spread keeps a quorum in every open region, so the store serves through a region outage. Each region adds Burn, and a write waits for the regions its quorum needs.

How it fails#

  • A weak quorum serves stale reads.

  • Checkouts still go wrong now and then, even with a strong quorum, because some come back stale or duplicate. Overlap is not linearizability.

  • When a replica is lost, a quorum that needs every replica cannot form, and those calls fail.

Instance failure#

  • Signs: The store loses one replica. Calls whose quorum needs every replica fail.

  • Do now: Nothing to click: no Replace button appears, because the store keeps serving the quorums it can still form. It ends on its own after at most 60 s.

  • Prevent: Raise N and pick a quorum that survives one lost replica, such as W and R of 2 with N of 3.

Zone outage#

  • Signs: Every Node in one zone goes grey at once.

  • Do now: Nothing brings the zone back sooner; it ends on its own after at most 120 s.

  • Prevent: Research Multiple zones, then put copies in different zones with the Zone setting. A spread store keeps replicas in every zone.

Hot key#

  • Signs: One shard goes red while the others sit idle.

  • Do now: Set Hot keys to Split on the store. It needs Hybrid fan-out; without it, the incident ends on its own after at most 90 s.

  • Prevent: Research Hybrid fan-out and set Hot keys to Split.

Region outage#

  • Signs: Every Node in one region goes grey at once, unless the store is spread.

  • Do now: Nothing speeds it up; it ends on its own after at most 180 s.

  • Prevent: Turn on Spread, so every region keeps its own quorum. Research Multiple regions.

Operator typo#

  • Signs: Every Node of the store in its region goes down. The director picks the busiest Database first, so it reaches a Wide-column Store only when the Design has no busy Database.

  • Do now: Place a new Wide-column Store Node in the same region. The incident ends once one serves.

  • Prevent: Research Infrastructure as code.

Tips#

  • Use W and R of 2 with N of 3 for read-after-write with one failure to spare.

サンドボックスホットキーApdexを0.9以上に2分間保ってください。

ルール#

  • 追加のコピーは 1 つ前より 25% 高くなります。
  • 売却すると、最後のコピーの価格の 50% が戻ります。
  • サイズは 6 段階です。1 段ごとに容量と支出が倍になります。

一緒に使えるもの#

データベース、ドキュメントストア、分散SQL

エンジニアリング用語#