Slide 1

Slide 1 text

ActiveHash

Slide 2

Slide 2 text

イェーイ!

Slide 3

Slide 3 text

.。oO(さっちゃんですよヾ(〃l _ l)ノ゙☆)

Slide 4

Slide 4 text

Elixir書いてます

Slide 5

Slide 5 text

⽇本の休⽇ {: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}

Slide 6

Slide 6 text

ActiveHash

Slide 7

Slide 7 text

ActiveRecord == べんり

Slide 8

Slide 8 text

マスターデータ V.S. ユーザーデータ

Slide 9

Slide 9 text

マスターデータ V.S. ユーザーデータ ソーシャルゲームのマスターデータは↓ 數週間に⼀回等、偶にしか更新しない。 ⼀元して更新を制御出來る。 所詮は各テーブル數萬件しか無い。 Readが凄く多い。

Slide 10

Slide 10 text

マスターデータ V.S. ユーザーデータ ソーシャルゲームのマスターデータは↓ 數週間に⼀回等、偶にしか更新しない。 ⼀元して更新を制御出來る。 所詮は各テーブル數萬件しか無い。 Readが凄く多い。 ↓ Memoryに持ってしまえ

Slide 11

Slide 11 text

ActiveHash gem 'active_hash'

Slide 12

Slide 12 text

ActiveHash on memoryなKVS

Slide 13

Slide 13 text

ActiveHash sample1: id: 1 name: sample class Sample < ActiveYaml::Base end Sample.find 1

Slide 14

Slide 14 text

ActiveHash 出來る事↓ ⾼速にfindする find_by, where belongs_to, has_many create, save, delete_all (on memory) FactoryGirl

Slide 15

Slide 15 text

ActiveHash 出來ない事↓ join index ⾼速なfind_by, where JSONに無い型でJSONから讀み込む polymorphic STI (Single Table Inheritance)

Slide 16

Slide 16 text

ActiveHash 出來ない事↓ join index ⾼速なfind_by, where JSONに無い型でJSONから讀み込む polymorphic STI (Single Table Inheritance) なので出來る樣にしました。

Slide 17

Slide 17 text

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”

Slide 18

Slide 18 text

イェーイ!