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
320
ActiveHash
ActiveHash
さっちゃん
July 27, 2017
Tweet
Share
More Decks by さっちゃん
See All by さっちゃん
作ってよかったgraceful shutdownライブラリ #kyotogo
ne_sachirou
0
830
path 依存型って何?
ne_sachirou
0
290
野生の onbording と onbording 設計 #kyototechtalk
ne_sachirou
0
470
メトリックはいかにして見え續ける樣になったか #devio2022
ne_sachirou
0
54
名實一致
ne_sachirou
0
560
まかれるあなとみあ ―Mackerel のしくみを理解する 30 分― @ Hatena Engineer Seminar #16
ne_sachirou
0
2.9k
tacit programming : Point-free, Concatenatives & J
ne_sachirou
0
650
Monitoring Containerized Elixir
ne_sachirou
1
810
Let's create stateful systems, by Elixir
ne_sachirou
1
750
Other Decks in Programming
See All in Programming
スクラムガイドのスプリントレトロスペクティブを改めて読みかえしてみた / Re-reading the Sprint Retrospective Section in the Scrum Guide
mackey0225
3
410
SwiftUIで使いやすいToastの作り方 / How to build a Toast system which is easy to use in SwiftUI
lovee
3
140
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
490
サイコロで理解する統計的仮説検定の考え方
tatamiya
4
920
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
360
Tailwind CSSを本気でカスタマイズする方法
fsubal
13
5.2k
Apache Hive 4 on Treasure Data
ryukobayashi
0
170
PostmanでAPIの動作確認が楽になった話
h455h1
0
170
SIMD Parallel Programming with the Vector API
josepaumard
0
150
코틀린으로 멀티플랫폼 만들기
pangmoo
0
150
Ruby Pattern Matching
bkuhlmann
0
920
大規模Reactアプリのリアーキテクチャ~8万行のTanStack Query移行の軌跡~
kj455
4
950
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
648
58k
Testing 201, or: Great Expectations
jmmastey
28
6.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
24
2k
Producing Creativity
orderedlist
PRO
337
39k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
9
8.3k
Large-scale JavaScript Application Architecture
addyosmani
504
110k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
25
2.3k
Robots, Beer and Maslow
schacon
PRO
155
7.9k
Building a Modern Day E-commerce SEO Strategy
aleyda
17
6.4k
Web development in the modern age
philhawksworth
202
10k
Done Done
chrislema
178
15k
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”
イェーイ!