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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Statistics for Hackers
jakevdp
799
230k
Odyssey Design
rkendrick25
PRO
1
490
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
270
Making the Leap to Tech Lead
cromwellryan
135
9.7k
SEO for Brand Visibility & Recognition
aleyda
0
4.2k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.2k
The Curse of the Amulet
leimatthew05
1
8.4k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
430
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