Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ActiveHash
Search
さっちゃん
July 27, 2017
Programming
0
360
ActiveHash
ActiveHash
さっちゃん
July 27, 2017
Tweet
Share
More Decks by さっちゃん
See All by さっちゃん
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
1.3k
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
1.2k
path 依存型って何?
ne_sachirou
0
540
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
610
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
76
名實一致
ne_sachirou
0
640
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
3k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
910
Monitoring Containerized Elixir
ne_sachirou
1
940
Other Decks in Programming
See All in Programming
PHPのバージョンアップ時にも役立ったAST
matsuo_atsushi
0
230
CloudNativePGを布教したい
nnaka2992
0
120
コミュニティ駆動 AWS CDK ライブラリ「Open Constructs Library」 / community-cdk-library
gotok365
2
250
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
160
The Clean ArchitectureがWebフロントエンドでしっくりこないのは何故か / Why The Clean Architecture does not fit with Web Frontend
twada
PRO
34
11k
Visual StudioのGitHub Copilotでいろいろやってみる
tomokusaba
1
210
ファインディLT_ポケモン対戦の定量的分析
fufufukakaka
0
940
機能が複雑化しても 頼りになる FactoryBotの話
tamikof
1
230
Go 1.24でジェネリックになった型エイリアスの紹介
syumai
2
300
React 19アップデートのために必要なこと
uhyo
8
1.6k
Rubyと自由とAIと
yotii23
6
1.8k
Rubyで始める関数型ドメインモデリング
shogo_tksk
0
140
Featured
See All Featured
Building an army of robots
kneath
303
45k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2.1k
Faster Mobile Websites
deanohume
306
31k
Being A Developer After 40
akosma
89
590k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
Visualization
eitanlees
146
15k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.3k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
440
Speed Design
sergeychernyshev
27
810
Site-Speed That Sticks
csswizardry
4
410
Transcript
ActiveHash
イェーイ!
.。oO(さっちゃんですよヾ(〃l _ l)ノ゙☆)
Elixir書いてます
⽇本の休⽇ {:holiday_jp, "~> 0.2.2"} ちゃんと動く優先度附きキュー {:pqueue2, "~> 0.1.0"} Streamを圧縮/伸⻑ {:stream_gzip,
"~> 0.1.0"} Streamのhash値を計算 {:stream_hash, "~> 0.1.0"} 標準Lint集 {:inner_cotton, github: "ne-sachirou/inner_cotton", only: [:dev, :test], runtime: false}
ActiveHash
ActiveRecord == べんり
マスターデータ V.S. ユーザーデータ
マスターデータ V.S. ユーザーデータ ソーシャルゲームのマスターデータは↓ 數週間に⼀回等、偶にしか更新しない。 ⼀元して更新を制御出來る。 所詮は各テーブル數萬件しか無い。 Readが凄く多い。
マスターデータ V.S. ユーザーデータ ソーシャルゲームのマスターデータは↓ 數週間に⼀回等、偶にしか更新しない。 ⼀元して更新を制御出來る。 所詮は各テーブル數萬件しか無い。 Readが凄く多い。 ↓ Memoryに持ってしまえ
ActiveHash gem 'active_hash'
ActiveHash on memoryなKVS
ActiveHash sample1: id: 1 name: sample class Sample < ActiveYaml::Base
end Sample.find 1
ActiveHash 出來る事↓ ⾼速にfindする find_by, where belongs_to, has_many create, save, delete_all
(on memory) FactoryGirl
ActiveHash 出來ない事↓ join index ⾼速なfind_by, where JSONに無い型でJSONから讀み込む polymorphic STI (Single
Table Inheritance)
ActiveHash 出來ない事↓ join index ⾼速なfind_by, where JSONに無い型でJSONから讀み込む polymorphic STI (Single
Table Inheritance) なので出來る樣にしました。
ActiveHash class Sample < ActiveHashExt::Base column :id, :integer, comemnt: “ID”
column :name, :string, comment: “名前” column :start_at, :datatime, comment: “開始時刻” end Sample.find_by name: “Ruby”
イェーイ!