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
400
ActiveHash
ActiveHash
さっちゃん
July 27, 2017
Tweet
Share
More Decks by さっちゃん
See All by さっちゃん
みんなのオブザーバビリティプラットフォームを作ってるんだがパフォーマンスがやばい #mackerelio #srenext
ne_sachirou
0
1.5k
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
1.3k
path 依存型って何?
ne_sachirou
0
700
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
650
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
100
名實一致
ne_sachirou
0
690
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
3.2k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
1k
Monitoring Containerized Elixir
ne_sachirou
1
1k
Other Decks in Programming
See All in Programming
ALL CODE BASE ARE BELONG TO STUDY
uzulla
27
6.7k
Webサーバーサイド言語としてのRustについて
kouyuume
1
4.8k
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
3
720
Software Architecture
hschwentner
6
2.3k
Leading Effective Engineering Teams in the AI Era
addyosmani
7
600
Android16 Migration Stories ~Building a Pattern for Android OS upgrades~
reoandroider
0
130
開発組織の戦略的な役割と 設計スキル向上の効果
masuda220
PRO
8
1.5k
CSC509 Lecture 06
javiergs
PRO
0
270
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
450
Pythonに漸進的に型をつける
nealle
1
120
他言語経験者が Golangci-lint を最初のコーディングメンターにした話 / How Golangci-lint Became My First Coding Mentor: A Story from a Polyglot Programmer
uma31
0
340
Six and a half ridiculous things to do with Quarkus
hollycummins
0
210
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.8k
Become a Pro
speakerdeck
PRO
29
5.6k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
The Straight Up "How To Draw Better" Workshop
denniskardys
238
140k
GraphQLとの向き合い方2022年版
quramy
49
14k
Build your cross-platform service in a week with App Engine
jlugia
233
18k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Statistics for Hackers
jakevdp
799
220k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.7k
Java REST API Framework Comparison - PWX 2021
mraible
34
8.9k
Music & Morning Musume
bryan
46
6.9k
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”
イェーイ!