關係型表「縱向延伸」(行增長) → HBase 表「橫向延伸」(列族/列動態擴展)。
car_id + create_at)。Oracle 來源表:<car_id, x, y, create_at, org_id, type> (x/y 經緯度,type=1 報警/2 正常)
查詢需求:
a) 指定天+車輛 → 軌跡查詢
b) 指定天+機構 → 所有報警點下載
| RowKey | Column Family |
|---|---|
car_id + create_at + org_id + type | location (單 CF) |
列名編碼:seq_no → 值為 x,y 序列化 (Protobuf)。
查詢映射:
a) RowKey 前綴 car_id + create_at 範圍掃描 → 軌跡
b) RowKey 前綴 create_at + org_id + type=1 範圍掃描 → 報警點
此設計利用 RowKey 字典序與前綴掃描,以最少 CF 滿足核心查詢,避免全表掃描。