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
MarketStore_LT.pdf
Search
dakimura
December 21, 2018
0
190
MarketStore_LT.pdf
Alpacaが開発する時系列データ特化型データベースMarket Storeのチュートリアル
dakimura
December 21, 2018
Tweet
Share
More Decks by dakimura
See All by dakimura
[GoCon2019autumn]Mercari sponsor session
dakimura
0
270
Featured
See All Featured
Technical Leadership for Architectural Decision Making
baasie
3
300
Claude Code のすすめ
schroneko
67
220k
Code Reviewing Like a Champion
maltzj
528
40k
ラッコキーワード サービス紹介資料
rakko
1
2.8M
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
230
Bridging the Design Gap: How Collaborative Modelling removes blockers to flow between stakeholders and teams @FastFlow conf
baasie
0
490
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Are puppies a ranking factor?
jonoalderson
1
3.2k
Design in an AI World
tapps
0
180
30 Presentation Tips
portentint
PRO
1
260
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
75
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Transcript
5分で完全理解! MarketStore Daito AKIMURA (@akkie30)
自己紹介 - Daito Akimura • 本職: メルカリ の Backend Engineer •
副業: 先月からAlpaca Japanにて MarketStore開発 • 仕事では Java, Python, PHP, Go を使っています • Twitter: @akkie30 • GitHub: dakimura
次回は「MarketStoreなにもわからない」になります
MarketStoreとは • 金融取引に関わる時系列データに特化した超高速データベースサーバ ◦ Alpacaがゼロから設計開発 ◦ 実装はGolang • QueryとWriteが可能 •
公式クライアントはPythonで書かれた pymarketstore
MarketStoreの特徴 • QueryはPythonのデータ解析フレームワークPandasのDataFrame型を返却する • 3rd partyの(go) pluginを開発できる ◦ バックグラウンド処理 /
トリガ処理 • 既にAlpacaで本番運用実績がある
なにはともあれ使ってみよう
起動 $ docker run -i -p 5993:5993 alpacamarkets/marketstore:latest
pymarketstoreインストール $ pip install pymarketstore
Data Write & Query >>> import pymarketstore, numpy, pandas >>>
data = numpy.array([(1544400000, 10.0)], dtype=[('Epoch', 'i8'), ('Ask', 'f4')]) >>> cli = pymarketstore.Client() >>> data = numpy.array([(1544400000, 10.0)], dtype=[('Epoch', 'i8'), ('Ask', 'f4')]) >>> cli.write(data, 'TEST/1Min/Tick') # write data >>> cli.query(pymarketstore.Params('TEST', '1Min', 'Tick')).first().df() # read data Epoch Ask 2018-12-10 00:00:00+00:00 10.0
一緒に開発しましょう! https://github.com/alpacahq/marketstore