feat(go): remove mysql realtime kv

This commit is contained in:
lingniu
2026-07-03 15:52:53 +08:00
parent f292d4c0d6
commit 2b5de65e31
9 changed files with 33 additions and 310 deletions

View File

@@ -64,6 +64,7 @@
- 索引:不在 `vehicle_realtime_location` 维护经纬度组合索引;实时表只回答当前态,地理范围和轨迹类查询走 TDengine 历史位置。
- 查询:`/api/realtime/snapshots``/api/realtime/locations` 默认不执行 `COUNT(*)``total` 表示本页返回条数;只有需要精确总数时传 `includeTotal=true`
- 写入:车牌从 `vehicle_identity_binding` 按 VIN 主键直查,并使用 VIN 级短 TTL 内存缓存,避免实时帧每条都打 MySQL缓存不作为事实来源。
- 不写 MySQL KV 投影表;实时全量字段保留在 Redis KV历史全量字段走 TDengine raw fields。
- 生产:项目上线前可直接重建这两张 MySQL 表,实时数据会从 Kafka 新消息继续投影。
7. Redis realtime 只服务已定位 VIN 的正式车辆。