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
390
ActiveHash
ActiveHash
さっちゃん
July 27, 2017
Tweet
Share
More Decks by さっちゃん
See All by さっちゃん
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
1.4k
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
1.2k
path 依存型って何?
ne_sachirou
0
630
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
630
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
89
名實一致
ne_sachirou
0
660
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
3.1k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
980
Monitoring Containerized Elixir
ne_sachirou
1
970
Other Decks in Programming
See All in Programming
Benchmark
sysong
0
140
機械学習って何? 5分で解説頑張ってみる
kuroneko2828
0
210
Parallel::Pipesの紹介
skaji
2
910
ReadMoreTextView
fornewid
1
360
無関心の谷
kanayannet
0
160
Create a website using Spatial Web
akkeylab
0
270
Perplexity Slack Botを作ってAI活用を進めた話 / AI Engineering Summit プレイベント
n3xem
0
640
ワンバイナリWebサービスのススメ
mackee
10
7.7k
複数アプリケーションを育てていくための共通化戦略
irof
10
3.8k
Use Perl as Better Shell Script
karupanerura
0
690
生成AIコーディングとの向き合い方、AIと共創するという考え方 / How to deal with generative AI coding and the concept of co-creating with AI
seike460
PRO
1
220
WindowInsetsだってテストしたい
ryunen344
1
120
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
900
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
20
1.3k
Six Lessons from altMBA
skipperchong
28
3.8k
Unsuck your backbone
ammeep
671
58k
Statistics for Hackers
jakevdp
799
220k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
47
2.8k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Git: the NoSQL Database
bkeepers
PRO
430
65k
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”
イェーイ!