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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
さっちゃん
July 27, 2017
Programming
0
430
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.4k
path 依存型って何?
ne_sachirou
0
750
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
670
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
110
名實一致
ne_sachirou
0
710
まかれるあなとみあ ―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
Fragmented Architectures
denyspoltorak
0
150
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
970
Apache Iceberg V3 and migration to V3
tomtanaka
0
150
Oxlint JS plugins
kazupon
1
750
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
170
Basic Architectures
denyspoltorak
0
660
AI時代の認知負荷との向き合い方
optfit
0
150
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
150
AgentCoreとHuman in the Loop
har1101
5
220
AIエージェントのキホンから学ぶ「エージェンティックコーディング」実践入門
masahiro_nishimi
4
320
Patterns of Patterns
denyspoltorak
0
1.4k
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
What does AI have to do with Human Rights?
axbom
PRO
0
2k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
170
RailsConf 2023
tenderlove
30
1.3k
Making Projects Easy
brettharned
120
6.6k
Writing Fast Ruby
sferik
630
62k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
430
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Code Reviewing Like a Champion
maltzj
527
40k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
120
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
160
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”
イェーイ!