39
“Good for you. Good for me. Mmm, good.” Key-Value Store For Local Environment 誰でも使える技術で使える ローカル環境向け Key-Value Store こしば としあき

Key Value Store For Local Environment

  • Upload
    bash0c7

  • View
    2.392

  • Download
    3

Embed Size (px)

DESCRIPTION

2009-07-17 RubyKaigi2009 LightningTalks

Citation preview

Page 1: Key Value Store For Local Environment

“Good for you. Good for me. Mmm, good.”

Key-Value StoreFor Local Environment

誰でも使える技術で使えるローカル環境向けKey-Value Store

こしば としあき

Page 2: Key Value Store For Local Environment

mostimportant

Page 3: Key Value Store For Local Environment

most important

Good for you. Good for me. Mmm, good.

俺に良し

お前に良し

みんなに良し

Page 4: Key Value Store For Local Environment

about me

Page 5: Key Value Store For Local Environment

about me

TOSHIAKIkoshiba

こしば としあき

twitter:bash0C7

hatenaid:bash0C7

Page 6: Key Value Store For Local Environment

about me

• RubyKaigi2009 実行委員– 受付/オペレーション担当

• 東京Ruby会議01 スピーカー

–「オフィスで踏み出すRubyの世界」

Page 7: Key Value Store For Local Environment

about me

• 最近の趣味–プロジェクトを設計すること

• 昼の仕事–ソフトウェア開発

• 金融業/運輸業 適用業務システム開発

– IBM COBOL on CICS

–MFCOBOL on MTP

–RPG on AS/400

• その他、Web、開発ツール開発

–社員の提案・不満の収集窓口

Page 8: Key Value Store For Local Environment

about me

•IBM COBOL on CICS

•MFCOBOL on MTP

•RPG on AS/400

Page 9: Key Value Store For Local Environment

outline

Page 10: Key Value Store For Local Environment

outline

Ruby Script

This KVS

User

Entity Layer

Rich Client(GUI)

local file

Page 11: Key Value Store For Local Environment

requirement

Page 12: Key Value Store For Local Environment

requirement

• store hash

• business person integrate

• on memory running

• without Web Application

• max_size < 1,000,000

Page 13: Key Value Store For Local Environment

design

Page 14: Key Value Store For Local Environment

design

This KVS

<<Entity>>middle ware

Rich Client(GUI)

API

local file

Page 15: Key Value Store For Local Environment

implement

Page 16: Key Value Store For Local Environment

implement

This KVS Class

XLS_KVS

Win32OLE

<<Entity>>Microsoft Excel

<<Presentation>>Microsoft Excel

COM API

Excel Workbook

concealedInternal processing

Page 17: Key Value Store For Local Environment

Microsoft Excel

Entity & Presentation

Page 18: Key Value Store For Local Environment

feature

Page 19: Key Value Store For Local Environment

feature

• store key-value

• on memory running

• edit stored values

Page 20: Key Value Store For Local Environment

storekey-values

Page 21: Key Value Store For Local Environment

store key-value

defined same method as "Hash"–[](key)

–store(key, value)

–delete(key)

Page 22: Key Value Store For Local Environment

store key-value – find(1)

YAML.load(@app.WorksheetFunction.VLookup(YAML.dump(key),

@sheet.Range(KEYVALUE_COLS), 2, false ))

Page 23: Key Value Store For Local Environment

store key-value – find(2)

@sheet.range(KEY_COLS).Find(YAML.dump(key),

@app.ActiveCell,

-4163, #xlValues,

1, #xlWhole,

1, #xlByRows,

1, #xlNext,

true,

false)

Page 24: Key Value Store For Local Environment

store key-value – insert

get tail row offset in worksheet

max_row = @sheet.UsedRange.Row + @sheet.UsedRange.Rows.count

@sheet.range("A#{max_row}").value =YAML.dump(key)

@sheet.range("B#{max_row}").value =YAML.dump(value)

Page 25: Key Value Store For Local Environment

store key-value – update

range = find(key)

range.offset(0, 1).value = YAML.dump(value)

Page 26: Key Value Store For Local Environment

store key-value - delete

target_row = find(key).Row

sheet.Range("#{target_row}:#{target_row}").Delete (-4162)

Page 27: Key Value Store For Local Environment

on memoryrunning

Page 28: Key Value Store For Local Environment

on memory running

• if call XLS_KVS#new–create XLS_KVS::Hash instance

–lunch Microsoft Excel

• if call XLS_KVS::Hash#Close–save&close Excel Workbook

–unload Microsoft Excel

Page 29: Key Value Store For Local Environment

editstored values

Page 30: Key Value Store For Local Environment

edit stored values

kvs = XLS_KVS.load(@xls_file, 1, false)

kvs.store(1, [Time.now, 'new running', 19])

kvs.store(2, [Time.now, 'I am Koshiba', 9])

kvs.store(3, self)

Page 31: Key Value Store For Local Environment

edit stored values

kvs = XLS_KVS.load(@xls_file, 1, false)

kvs.store(1, [Time.now, 'new running', 19])

kvs.store(2, [Time.now, 'I am Koshiba', 9])

kvs.store(3, self)

edit directly!

Page 32: Key Value Store For Local Environment

edit directly!

edit stored values

kvs = XLS_KVS.load(@xls_file, 1, false)

kvs.store(1, [Time.now, 'new running', 19])

kvs.store(2, [Time.now, 'I am Koshiba', 9])

kvs.store(3, self)

Excel is usefulfor many people!engineers,business personsstudents,my mother, etc

Page 33: Key Value Store For Local Environment

edit stored values

Microsoft Excel is

many people's friend

Page 34: Key Value Store For Local Environment

summary

Page 35: Key Value Store For Local Environment

summary

•Ruby is programmer's friend

Page 36: Key Value Store For Local Environment

summary

•Ruby is programmer's friend

•Excel is many people's friend

Page 37: Key Value Store For Local Environment

summary

•Ruby is programmer's friend

•Excel is many people's friend

•Ruby × Excel =everyone's friend

Page 38: Key Value Store For Local Environment

"everyone's friend"Ruby × Excel

XLS_KVSKey-Value Store Library

coming soon!

Page 39: Key Value Store For Local Environment

Thank youfor

listening.

ご清聴ありがとうございました