Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ActiveHash
Search
さっちゃん
July 27, 2017
Programming
0
420
ActiveHash
ActiveHash
さっちゃん
July 27, 2017
Tweet
Share
More Decks by さっちゃん
See All by さっちゃん
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
1.6k
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
1.3k
path 依存型って何?
ne_sachirou
0
720
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
660
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
110
名實一致
ne_sachirou
0
700
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
3.2k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
1.1k
Monitoring Containerized Elixir
ne_sachirou
1
1k
Other Decks in Programming
See All in Programming
React Native New Architecture 移行実践報告
taminif
1
150
宅宅自以為的浪漫:跟 AI 一起為自己辦的研討會寫一個售票系統
eddie
0
490
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
380
関数実行の裏側では何が起きているのか?
minop1205
1
680
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
320
Cell-Based Architecture
larchanjo
0
110
Context is King? 〜Verifiability時代とコンテキスト設計 / Beyond "Context is King"
rkaga
7
1k
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
430
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
310
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
2
650
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
120
手軽に積ん読を増やすには?/読みたい本と付き合うには?
o0h
PRO
1
170
Featured
See All Featured
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.7k
Bash Introduction
62gerente
615
210k
How to Ace a Technical Interview
jacobian
280
24k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
700
Faster Mobile Websites
deanohume
310
31k
How STYLIGHT went responsive
nonsquared
100
6k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
970
Designing for Performance
lara
610
69k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.5k
Docker and Python
trallard
47
3.7k
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”
イェーイ!