How to assess
yourcloud native workloads
for migration to
a Distributed SQL Database
Thu. 31/3/2022
Distributed SQL Summit Asia
#distributedsqlsummit #DSSAsia #distributedsql
2.
About me
1
Masaki Yamakawa
ULSystems, Inc.
Managing Consultant
{
“Sector” :”Financial(Stock, FX)”
“Skills” :[“Distributed system”,
“In-memory computing”]
“Note” :”Apache Geode Committer”
}
3. 自動シャーディングのHashキー指定
23
◼更なる性能向上を求める場合はHashキーを明示的に指定
CREATE TABLEnew_order (
no_w_id int NOT NULL,
no_d_id int NOT NULL,
no_o_id int NOT NULL,
PRIMARY KEY (no_w_id, no_d_id, no_o_id)
);
CREATE TABLE new_order (
no_w_id int NOT NULL,
no_d_id int NOT NULL,
no_o_id int NOT NULL,
PRIMARY KEY (no_w_id HASH, no_d_id, no_o_id)
);
CREATE TABLE new_order (
no_w_id int NOT NULL,
no_d_id int NOT NULL,
no_o_id int NOT NULL,
PRIMARY KEY ((no_w_id, no_d_id) HASH, no_o_id)
);
Hashを指定していない場合、PRIMARYキーの1番目がHashキーになる
倉庫IDと配達区域で別のシャード(tablet)にデータが配置されると
効率が悪いため、明示的にHashキーを指定する
PostgreSQLの
DDLを
そのまま使用
Hashキー
指定