2. 設立: 2017年7月4日(火)
拠点: 品川区北品川5-13-15
事業内容:
✓ 高性能データ処理ソフトウェアの開発と販売
✓ GPU&DB領域の技術コンサルティング
✓ オープンソースソフトウェアの開発と普及
自己紹介
海外 浩平 (KaiGai Kohei)
Chief Architect & CEO of HeteroDB
PostgreSQL, Linux kernel 開発者 (2003~)
PG-Stromのメイン開発者(2012~)
興味範囲:Big-data, GPU, NVME, PMEM, Curling, …
about myself
about our company
PG-Strom
Apache Arrow Tokyo meetup 2019 ~ PostgreSQLだってビッグデータ処理したい!!2
3. PG-Stromとは?
Apache Arrow Tokyo meetup 2019 ~ PostgreSQLだってビッグデータ処理したい!!3
【機能】
集計/解析ワークロードの透過的なGPU高速化
SQLからGPUプログラムを自動生成し並列実行
SSD-to-GPU Direct SQLによるPCIeバスレベルの最適化
列ストレージによるI/Oと並列計算の効率化
PG-Strom: GPUとNVMEの能力を最大限に引き出し、数十TB単位の
データ処理を高速化するPostgreSQL向け拡張モジュール
App
GPU
off-loading
for IoT/Big-Data
for ML/Analytics
➢ SSD-to-GPU Direct SQL
➢ Columnar Store (Arrow_Fdw)
➢ Asymmetric Partition-wise
JOIN/GROUP BY
➢ BRIN-Index Support
➢ NVME-over-Fabric Support
➢ Procedural Language for
GPU native code (PL/CUDA)
➢ NVIDIA RAPIDS data frame
support (WIP)
➢ IPC on GPU device memory
4. ログ収集デーモン:
ターゲット:IoT/M2Mログの集計・解析処理
Apache Arrow Tokyo meetup 2019 ~ PostgreSQLだってビッグデータ処理したい!!4
Manufacturing Logistics Mobile Home electronics
なぜPostgreSQLか?
シングルノードで処理できるならそっちの方が運用が楽
エンジニアが慣れ親しんが技術で、運用ノウハウの蓄積が豊富
JBoF: Just Bunch of Flash
NVME-over-Fabric
(RDMA)
DB管理者
BIツール(可視化)
機械学習アプリケーション
(E.g, 異常検知など)
共通データ
フレーム PG-Strom
17. 背景① データはどこで生成されるのか?
ETL
OLTP OLAP
伝統的なOLTP&OLAPシステム - データはDBシステムの内側で生成される
Data
Creation
IoT/M2M時代 - データはDBシステムの外側で生成される
Log
processing
BI Tools
BI Tools
Gateway Server
Data
Creation
Data
Creation
Many Devices
Apache Arrow Tokyo meetup 2019 ~ PostgreSQLだってビッグデータ処理したい!!17
DBシステムへのデータのインポートが、集計処理以上に時間のかかる処理に!
Data
Import
Import!
18. 背景② PostgreSQLのデータ構造は結構無駄が多い
Apache Arrow Tokyo meetup 2019 ~ PostgreSQLだってビッグデータ処理したい!!18
8kB
HeapTuple
Table Segment Block
HeapTupleHeader nullmap 列A 列B 列D 列E
Tuple
SELECT B FROM this_table WHERE E like ‘%hoge%’;
要る?
20. Apache Arrowとは(2/2)– データ型のマッピング
Apache Arrowデータ型 PostgreSQLデータ型 補足説明
Int int2, int4, int8
FloatingPoint float2, float4, float8 float2 is an enhancement of PG-Strom
Binary bytea
Utf8 text
Bool bool
Decimal numeric
Date date adjusted to unitsz = Day
Time time adjusted to unitsz = MicroSecond
Timestamp timestamp adjusted to unitsz = MicroSecond
Interval interval
List array types Only 1-dimensional array is supportable
Struct composite types
Union ------
FixedSizeBinary char(n)
FixedSizeList array types?
Map ------
大半のデータ型はApache Arrow PostgreSQLの間で変換可能
Apache Arrow Tokyo meetup 2019 ~ PostgreSQLだってビッグデータ処理したい!!20
25. 《補足》PostgreSQLデータベースからArrowファイルを生成する
✓ 基本的な使い方は、-cで指定したSQLの実行結果を、
-oで指定したファイルに書き出す。
$./pg2arrow -h
Usage:
pg2arrow [OPTION]... [DBNAME [USERNAME]]
General options:
-d, --dbname=DBNAME database name to connect to
-c, --command=COMMAND SQL command to run
-f, --file=FILENAME SQL command from file
-o, --output=FILENAME result file in Apache Arrow format
Arrow format options:
-s, --segment-size=SIZE size of record batch for each
(default is 256MB)
Connection options:
-h, --host=HOSTNAME database server host
-p, --port=PORT database server port
-U, --username=USERNAME database user name
-w, --no-password never prompt for password
-W, --password force password prompt
Debug options:
--dump=FILENAME dump information of arrow file
--progress shows progress of the job.
Pg2Arrow により、SQL実行結果をArrow形式で書き出す事ができる。
Apache Arrow
Data Files
Arrow_Fdw
Pg2Arrow
Apache Arrow Tokyo meetup 2019 ~ PostgreSQLだってビッグデータ処理したい!!25