Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Cassandraの活用事例とパフォーマンス特性
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Tomohiro Hashidate
June 04, 2019
Technology
1.3k
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Cassandraの活用事例とパフォーマンス特性
Repro Tech LT発表資料
Tomohiro Hashidate
June 04, 2019
More Decks by Tomohiro Hashidate
See All by Tomohiro Hashidate
Ruby::Boxでできること、Refinementsでできること
joker1007
3
480
Do Ruby::Box dream of Modular Monolith?
joker1007
1
1.7k
ReproでのicebergのStreaming Writeの検証と実運用にむけた取り組み
joker1007
0
810
マイクロサービスへの5年間 ぶっちゃけ何をしてどうなったか
joker1007
23
11k
Quarkusで作るInteractive Stream Application
joker1007
0
320
今改めてServiceクラスについて考える 〜あるRails開発者の10年〜
joker1007
25
29k
rubygem開発で鍛える設計力
joker1007
5
1.5k
実践Kafka Streams 〜イベント駆動型アーキテクチャを添えて〜
joker1007
3
1.5k
本番のトラフィック量でHudiを検証して見えてきた課題
joker1007
2
1.4k
Other Decks in Technology
See All in Technology
C#未経験の僕がAIに読めるコードを書かせるまで
maguroalternative
0
250
Cloudflare Workers 向けアプリを C# で構築する ~WASM Native AOT への道~
nenonaninu
1
1.3k
ADKで始める業務改善 - AIエージェント開発時の考えと設計
harappa80
2
280
AI時代の「技術的負債」の変質ー概念の終焉と再解釈、エージェントと共に向かう先
nwiizo
1
3.2k
Azure Serverless 2026:Production-ready な AI エージェント基盤 / Azure Serverless 2026: Production-Ready AI Agent Platform
miyake
2
550
beyond jj: config & tools ecosystem
indirect
0
5.9k
Claude in Chrome 入門 / Introduction to Claude in Chrome
cielo1985
0
890
フルカイテン株式会社 エンジニア向け採用資料
fullkaiten
0
12k
The Knowledge Spine: A Machine-Executable Ontology for Governed Marketing Activation
vananth22
0
120
「どのログを見ればいい?」 から始めた サーバーレス障害解析
y_waka1
1
130
10Xに技術的負債をもたらした「2つの境界の歪み」その構造と解消への営み
10xinc
0
2.4k
Why Agent Cost Needs Observability
nttcom
0
140
Featured
See All Featured
Designing for Performance
lara
611
70k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Six Lessons from altMBA
skipperchong
29
4.5k
Paper Plane
katiecoart
PRO
4
53k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
A Soul's Torment
seathinner
8
3.6k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
WENDY [Excerpt]
tessaabrams
14
39k
Are puppies a ranking factor?
jonoalderson
2
3.9k
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Balancing Empowerment & Direction
lara
6
1.3k
Transcript
Cassandra の活⽤事例とパフォーマンス特性 joker1007 (Repro inc. CTO)
self.inspect @joker1007 Ruby/Rails/fluentd/presto/infra ⼤体アーキテクト業 今はkafka とkudu に興味がある
話すこと Repro でのCassandra の活⽤⽬的 Cassandra の選定理由 Cassandra のパフォーマンス特性と設計時の注意 話さないこと 運⽤時の細かな注意点
何のために 端末情報記録 ユーザープロフィール情報 イベント実⾏回数 / user リアルタイムで更新される情報の保持がメイン
何故Cassandra を選択したか 書き込み回数が⾮常に多い かつ読み込み時に100 万件単位で取得しJOIN する必要がある 組み合わせる対象として、数⼗⽇分の⾏動ログを含む。 書き込みがスケールし、当時からセグメンテーションに利⽤していたpresto と連携が 可能で、読み込みもある程度分散できるデータストアが必要。
→ Cassandra を採⽤。
Cassandra のパフォーマンス特性
書き込みの概要 Client Client R2 R2 R3 R3 1 1 2
3 4 4 5 6 7 8 9 10 11 12 R1 R1 Write response Chosen node Coordinator node https://docs.datastax.com/ja/cassandra- jajp/3.0/cassandra/dml/dmlClientRequestsWrite.html
書き込みの概要 https://docs.datastax.com/ja/cassandra- jajp/3.0/cassandra/dml/dmlHowDataWritten.html
書き込みパフォーマンス特性 パーティション対象の決定とmemtable 、transaction log が書ければOK 。 最終的なテーブルファイルは不変なので、書き出しがシンプル。 パーティションさえ均等なら割と簡単にスケールする ⼀件単位の書き込みは、ほぼ100 マイクロ秒以下
現時点で20000/sec ぐらいの書き込みがある 整合性を保ってカウントアップする処理は重い 複数ノードを跨いでCAS やロックが必要になる
読み込みの概要 Client Client R2 R2 R3 R3 1 1 2
3 4 4 5 6 7 8 9 10 11 12 R1 R1 replica node failed coodinator node resends after timeout Chosen node Coordinator node https://docs.datastax.com/ja/cassandra- jajp/3.0/cassandra/dml/dmlClientRequestsRead.html
読み込みの概要 https://docs.datastax.com/ja/cassandra-jajp/3.0/cassandra/dml/dmlAboutReads.html
読み込みパフォーマンス特性 ⼀件単位の読み込みに向いている 多くのデータをまとめて取得するには不向き 取得対象のパーティションとノード特定にCPU を使う クラスタのノード間でデータの通信が多く発⽣する パーティション毎のdigest 要求 read repair
presto での利⽤は本来は不向き パーティション数とノード数でバランスを取ることで 何とか⽬的のパフォーマンスを維持
テーブル設計の重要性 読み込みワークロードに合わせてテーブルを設計する、でないとまともにパフォ ーマンスが出ない。 ユースケース毎にテーブルがあり、データの重複は覚悟する。 とにかくパーティションキー以外を条件にクエリしないこと。
まとめ 読み込みパターンに合わせたテーブル設計をすること ⽤途が適切ならかなりのパフォーマンスが出せる パーティション数とデータの分散度合いのコントロールが重要
その他のTips CPU 、ディスクI/O 、ネットワークそれぞれかなり影響があるのでメトリックをち ゃんと取得しておくこと ホットデータはオンメモリで読み書きするのでメモリは多く セカンダリインデックスは基本使えない