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
440
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ActiveHash
ActiveHash
さっちゃん
July 27, 2017
More Decks by さっちゃん
See All by さっちゃん
火星曆
ne_sachirou
0
26
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
1.7k
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
1.4k
path 依存型って何?
ne_sachirou
0
830
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
730
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
130
名實一致
ne_sachirou
0
740
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
3.3k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
1.1k
Other Decks in Programming
See All in Programming
ローカルLLMを使ってB2Bサービスを作っていての学び
yaotti
0
170
運用エージェントは "作る" から "育てる" へ - 記憶と自己進化の3層設計パターン / self-evolving-agents-three-layer-agent-design
gawa
12
3.6k
A2UI という光を覗いてみる
satohjohn
1
130
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
120
肥大化するレガシーコードに立ち向かうためのインターフェース分離と依存の逆転 / JJUG CCC 2026 Spring
hirokunimaeta
0
540
Lessons from Spec-Driven Development
simas
PRO
0
180
AIで効率化できた業務・日常
ochtum
0
130
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
570
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
540
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
2
670
Vite+ Unified Toolchain for the Web
naokihaba
0
290
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
250
Featured
See All Featured
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
270
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
380
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
How Software Deployment tools have changed in the past 20 years
geshan
0
34k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
610
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
580
Discover your Explorer Soul
emna__ayadi
2
1.1k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
200
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
130
Everyday Curiosity
cassininazir
0
230
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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”
イェーイ!