内核 实时更新 + 多表 JOIN:终结"反范式化噩梦"
- 一句话
- 主键模型的行级 upsert + 真 CBO + 全向量化执行,让频繁更新的维度表与事实表任意多表 join 在亚秒内完成——ClickHouse/Druid 用户被迫建的宽表和 Flink 预 join 管道可直接删掉。Primary-key row-level upserts + a real CBO + fully vectorized execution deliver "dimension tables that update constantly, fact tables joined across arbitrary tables" in sub-second time — ClickHouse/Druid users can delete the wide tables and Flink pre-join pipelines they were forced to build.
- 窄场景
- 用户行为分析、AdTech/MarTech、客户-facing 仪表盘:维度(campaign 名、用户标签)三天两头变,分析师要任意维度组合即席查;被 ClickHouse"把表打宽"或 Druid"预聚合+immutable segment"折磨过的数据工程师。User-behavior analytics, AdTech/MarTech, customer-facing dashboards — dimensions (campaign names, user tags) change constantly while analysts query arbitrary dimension combinations ad hoc; data engineers burned by ClickHouse's "widen the table" or Druid's "pre-aggregate + immutable segments".
- 机制
- 三件套——主键模型做高效 upsert(late-arriving 数据秒级可见);自研 CBO(join reorder、broadcast/shuffle/colocate 代价选择、runtime filter);全向量化 C++ 执行。ClickHouse 弱项是机制性的:无 CBO、JOIN 是"最后手段",官方最佳实践就是反范式化成宽表——代价是 Demandbase 的宽表数据膨胀 100 倍。The three-part fix — a primary-key model for efficient upserts (late-arriving data visible in seconds); a home-grown CBO (join reordering, broadcast/shuffle/colocate cost choices, runtime filters); fully vectorized C++ execution. The result: star schemas stay normalized, JOINs happen at query time. ClickHouse's weakness is mechanistic: no CBO, JOINs are a last resort, and the official best practice is to denormalize into one wide table — at the cost Demandbase paid: 100x data inflation, and a dimension change (a customer rename) means rewriting vast history.
- 生产验证
- Pinterest(2024,Druid→StarRocks,广告主看板):p90 延迟降 50%、服务器降至 32%、3 倍 query-per-dollar,新鲜度 ~10 秒;去掉了 Druid 的外部 MapReduce ingestion job 和 JSON 配置(https://medium.com/@indomitability/why-starrocks-is-better-than-apache-druid-for-real-time-analytics-c38f19b8ff02);Airbnb(Druid→StarRocks,Trust & Safety + 全公司 BI):分钟级查询变秒级,退役大量预聚合表(https://medium.com/@indomitability/why-starrocks-is-better-than-apache-druid-for-customer-facing-analytics-bbe049856935)。诚实备注:案例经 IndoMITability(Mark Anderson)系列文章转述,属 StarRocks 生态方内容营销;公司名与迁移事实可信度高,具体倍数未经独立复现,请打折听。Pinterest (2024, Druid→StarRocks, advertiser Partner Insights dashboards): p90 latency down 50%, server count down to 32%, ~3x query-per-dollar, ~10-second data freshness; removed Druid's external MapReduce ingestion jobs and JSON configs (https://medium.com/@indomitability/why-starrocks-is-better-than-apache-druid-for-real-time-analytics-c38f19b8ff02); Airbnb (Druid→StarRocks, Trust & Safety + company-wide BI): minute-level queries became second-level; retired the mass of pre-aggregation tables built to dodge Druid's limits (https://medium.com/@indomitability/why-starrocks-is-better-than-apache-druid-for-customer-facing-analytics-bbe049856935). Honest note: cases arrive via IndoMITability (Mark Anderson)'s series — StarRocks-ecosystem content marketing; company names and migration directions are highly credible, but discount the exact multipliers: they were never independently reproduced.
- 竞品差距
- ClickHouse 无 CBO、JOIN 弱、更新靠重写分区;Doris 最接近(同样 MySQL 协议、主键更新、CBO)——基本打平,差异在生态;Snowflake/BigQuery JOIN 不弱但做不到"秒级新鲜度 + 高并发点查"的 serving 形态。"自建、实时更新、任意 JOIN、高并发 serving"四合一,31 款只有 StarRocks 与 Doris 做到。ClickHouse has no CBO, weak JOINs, partition-rewrite updates (mechanistic gap); Doris is the closest rival (also MySQL protocol, primary-key updates, CBO) — essentially tied, differences are ecosystem-side; Snowflake/BigQuery JOIN fine but can't do the "second-level freshness + high-concurrency point-query" serving form. "Self-hosted + realtime updates + arbitrary JOINs + high-concurrency serving" in one — only StarRocks and Doris among the 31.
- 证据等级
- 社区共识(多家公司迁移事实交叉印证)+ 生态方转述(数字未独立复现,已标注)Community consensus (multiple company migration facts cross-confirm) + ecosystem-reported figures (not independently reproduced, as noted)
- 最后核验
- 2026-10-012026-10-01