What Is Federated Analytics?什么是联邦分析?
Place this specific workflow in context with the federated queries and data virtualization guide, which connects the definitions, alternatives, validation steps, and related implementation guides.
可通过联邦查询与数据虚拟化指南理解本专题在整体流程中的位置;该指南串联了定义、替代方案、验证步骤与相关实施文章。
Federated analytics is the use of a shared query and semantic layer to analyze data across autonomous sources while those sources remain separately owned and operated. BI tools or data-science clients submit one bounded question; the federation layer plans source queries, pushes down safe work, combines permitted intermediate results, and returns a governed answer with lineage.
联邦分析是通过共享查询与语义层分析自治来源数据,同时让这些来源保持独立所有和运营。BI工具或数据科学客户端提交一个有边界的问题;联邦层规划来源查询、下推安全工作、组合获准中间结果,并返回带血缘的受治理答案。
The phrase can also describe privacy-preserving computations that run locally at devices or institutions and release only aggregates. That is a legitimate but different intent. This page focuses on cross-source BI analysis and federated queries for data-science workflows. It focuses on query planning, semantic alignment, joins, governance, freshness, and validation.
该词也可表示在设备或机构本地运行、只发布聚合值的隐私保护计算,那是合法但不同的意图。本页面向数据科学工作流中的跨源BI分析与联邦查询,重点是查询规划、语义对齐、连接、治理、新鲜度与验证。
Design a Federated Analytics Architecture设计联邦分析架构
Dashboards, notebooks, and applications submit bounded queries against published metrics and views rather than unrestricted raw schemas.
仪表盘、Notebook与应用针对已发布指标和视图提交有边界查询,而不是访问无限制原始Schema。
Defines measures, dimensions, grain, keys, units, time zones, ownership, freshness, policy, and lineage across sources.
定义跨来源的度量、维度、粒度、键、单位、时区、责任、新鲜度、策略和血缘。
Rewrites requests, selects sources, estimates cost, pushes filters and aggregates, chooses join placement, and controls intermediate data movement.
重写请求、选择来源、估算成本、下推过滤与聚合、选择连接位置,并控制中间数据移动。
Translate types and dialects, enforce limits, preserve identity or service attribution, expose plans, and return observation metadata.
转换类型与方言、执行限制、保留身份或服务归属、暴露计划,并返回观察元数据。
Operational databases, warehouses, lakehouses, and approved APIs retain local ownership, policies, workloads, and change schedules.
运营数据库、数仓、湖仓和获批API保留本地所有权、策略、工作负载与变更节奏。
Returns the answer with source lineage, query identifiers, policy decisions, freshness, partial-result status, and reconciliation evidence.
返回答案及来源血缘、查询标识、策略决策、新鲜度、部分结果状态和核对证据。
Align Metrics, Grain, Keys, and Time Before Querying查询前对齐指标、粒度、键与时间
A successful distributed query can still produce a wrong business answer. Define every measure’s formula, additive behavior, currency, unit, inclusion rules, owner, and effective date. Define dimension keys and slowly changing behavior. Record whether “customer,” “active,” “revenue,” or “case closed” means the same thing across systems. Never join on similar labels without a governed mapping.
分布式查询成功仍可能产生错误业务答案。应定义每个度量的公式、可加性、货币、单位、纳入规则、负责人和生效日期;定义维度键及缓慢变化行为;记录“客户”“活跃”“收入”或“工单关闭”在不同系统中是否含义一致。不得在缺少受治理映射时按相似标签连接。
Time deserves a separate contract. Record event time, processing time, source observation time, time zone, late-arrival rule, reporting calendar, and acceptable cross-source skew. A dashboard should show when one source is delayed or cached. “Live” must be an explicit service level, not a visual impression.
时间需要单独契约。记录事件时间、处理时间、来源观察时间、时区、迟到规则、报告日历和可接受跨源偏差。一个来源延迟或使用缓存时,仪表盘应明确显示。“实时”必须是明确服务级别,而不是视觉印象。
Build Federated Analytics Step by Step逐步构建联邦分析
- Choose one decision. Define the BI or data-science question, consumers, required fields, latency, scale, and success criteria.选择一个决策。定义BI或数据科学问题、使用者、所需字段、延迟、规模和成功标准。
- Approve sources and policy. Confirm owners, legal purpose, permissions, source-load budgets, retention, exports, and expiry.批准来源与策略。确认负责人、法律目的、权限、来源负载预算、保留、导出和到期。
- Publish semantic contracts. Define grain, measures, dimensions, keys, time, nulls, duplicates, and reconciliation rules.发布语义契约。定义粒度、度量、维度、键、时间、空值、重复和核对规则。
- Configure and profile connectors. Test types, pushdown, cancellation, retries, identity, schema drift, and source-specific limits.配置并分析连接器。测试类型、下推、取消、重试、身份、Schema漂移和来源限制。
- Inspect real query plans. Verify source selection, filters, projections, aggregation, join placement, bytes moved, and result limits.检查真实查询计划。验证来源选择、过滤、投影、聚合、连接位置、移动字节和结果限制。
- Reconcile the answer. Compare against source-native control queries and known examples, including late data and partial failure.核对答案。与来源原生控制查询和已知样例比较,包括迟到数据与部分故障。
- Release with evidence. Monitor quality, freshness, source pressure, cost, policy decisions, cache use, failed queries, and consumer outcomes.带证据发布。监控质量、新鲜度、来源压力、成本、策略决策、缓存使用、失败查询和使用结果。
Control Pushdown, Data Movement, and Repeated Work控制下推、数据移动与重复工作
Push selective filters, projections, and safe aggregates to sources when connector semantics match. Avoid pulling large raw tables into the coordinator for unrestricted joins. Route repeated historical aggregates to governed materializations when freshness permits; keep fresh operational lookups virtual. Record which path answered each metric so cache and materialization do not hide staleness.
连接器语义匹配时,应把高选择性过滤、投影和安全聚合下推到来源,避免把大型原始表拉到协调器执行无限制连接。新鲜度允许时,将重复历史聚合路由到受治理物化;新鲜运营查询保持虚拟访问。记录每个指标由哪条路径回答,避免缓存与物化掩盖过期。
Benchmark cold and warm paths, concurrency, cancellation, a slow source, source unavailability, schema change, and a large intermediate result. Set admission control, timeouts, row and byte limits, and workload queues. A fast demonstration with cached data is not production evidence.
基准测试冷路径、热路径、并发、取消、慢来源、来源不可用、Schema变化和大型中间结果。设置准入控制、超时、行字节限制与工作负载队列。使用缓存数据的快速演示不能作为生产证据。
Example: Federated Revenue and Support Analytics示例:联邦收入与支持分析
A product team wants weekly revenue by customer segment alongside support backlog and renewal risk. Billing data remains in a finance warehouse, account attributes in PostgreSQL, and cases in a service platform. The semantic layer defines customer keys, recognized revenue, week boundaries, case status, and allowed segments. The planner pushes date and segment filters, aggregates each source at customer-week grain, then joins bounded results.
产品团队希望按客户分群查看周收入,同时分析支持积压和续约风险。账单数据留在财务数仓,账户属性在PostgreSQL,工单在服务平台。语义层定义客户键、已确认收入、周边界、工单状态和允许分群。规划器下推日期与分群过滤,在各来源按客户周粒度聚合,再连接有边界结果。
Validation covers unmatched customers, currency conversion, reopened cases, late invoices, accounts changing segment, a delayed source, and unauthorized rows. Dashboard totals are reconciled with finance and service control reports. Every refresh records source observation times and whether any approved cache or partial result was used.
验证覆盖未匹配客户、货币转换、重新打开工单、迟到发票、账户分群变化、来源延迟和未授权行。仪表盘总额与财务及服务控制报表核对。每次刷新记录来源观察时间,以及是否使用获批缓存或部分结果。
Choose Federation, Materialization, or a Hybrid Deliberately有意识地选择联邦、物化或混合方式
Use a federated path when the question needs current data, source ownership must remain local, copying is restricted, or the workload is exploratory and bounded. Prefer materialization when many consumers repeat the same expensive scan, transformations require a stable historical snapshot, source systems cannot absorb interactive load, or predictable dashboard latency matters more than immediacy. Most production programs use both: virtual access for fresh operational facts and governed tables or aggregates for repeatable history.
当问题需要最新数据、来源所有权必须保留在本地、复制受限,或工作负载具有探索性且边界明确时,适合采用联邦路径。当大量使用者重复执行同一昂贵扫描、转换需要稳定历史快照、来源系统无法承受交互负载,或可预测的仪表盘延迟比即时性更重要时,应优先物化。多数生产项目会同时使用两者:以虚拟访问获取新鲜运营事实,以受治理表或聚合承载可重复历史。
Make the routing decision metric by metric, not platform by platform. Record the approved execution path, maximum age, refresh owner, fallback behavior, and deletion rule. If a query silently switches from live access to a stale cache, users cannot interpret the result. The response should identify the data path and observation time so analysts can decide whether the answer is fit for the decision.
应按指标而不是按平台决定路由。记录获批执行路径、最大数据年龄、刷新负责人、回退行为与删除规则。如果查询从实时访问静默切换到过期缓存,使用者就无法正确解释结果。响应应标明数据路径与观察时间,让分析人员判断答案是否适合当前决策。
Treat Partial Failure as a Data-Quality State把部分故障视为数据质量状态
Cross-source analysis fails differently from a query against one database. One connector may time out while others succeed; a source can return an older snapshot; permissions may remove only part of a dimension; or schema drift can coerce a value without stopping execution. Define whether each metric must fail closed, may return a clearly labeled partial result, or can use an approved last-known-good value. Never present a partial total as complete.
跨源分析的失败方式不同于单数据库查询:某个连接器可能超时而其他来源成功;某来源可能返回较旧快照;权限可能只移除某个维度的一部分;Schema漂移也可能在不中止执行的情况下强制转换值。应定义每个指标是必须关闭失败、可以返回明确标注的部分结果,还是可以使用获批的最近正确值。绝不能把部分总计呈现为完整结果。
Expose source status, observation timestamps, missing partitions, policy filters, retry decisions, and reconciliation deltas with the result. Alert on semantic-contract changes as well as infrastructure errors. An analytics service is trustworthy only when consumers can distinguish a valid zero from missing data, a current answer from a cached one, and a complete population from an authorized subset.
应随结果公开来源状态、观察时间戳、缺失分区、策略过滤、重试决策与核对差异。除基础设施错误外,也要对语义契约变化告警。只有使用者能够区分有效的零值与数据缺失、当前答案与缓存答案、完整群体与授权子集时,分析服务才值得信任。
Use InfiniSynapse for Approved Cross-Source Analysis使用InfiniSynapse执行获批跨源分析
Prepare approved source connections, shared metrics, join keys, grain, access rules, freshness expectations, source-load limits, and control queries. Use InfiniSynapse for the supported multi-source analysis task. Keep production semantic governance, connector operations, policy enforcement, scheduled BI serving, and recovery with their accountable platform teams.
请准备获批来源连接、共享指标、连接键、粒度、访问规则、新鲜度期望、来源负载限制和控制查询,并使用InfiniSynapse完成受支持的多源分析任务。生产语义治理、连接器运维、策略执行、计划BI服务与恢复仍由对应平台团队负责。
Federated Analytics FAQ联邦分析常见问题
What is federated analytics in this guide?
本指南中的联邦分析是什么?
It is cross-source BI or data-science analysis performed through a shared query and semantic layer while autonomous sources remain separately owned and operated.
它是通过共享查询和语义层执行跨源BI或数据科学分析,同时让自治来源保持独立所有和运营。
Is federated analytics the same as federated learning?
联邦分析等同于联邦学习吗?
No. Federated learning coordinates model training across participants. This page concerns governed queries, metrics, joins, and BI results across data sources.
不等同。联邦学习协调参与方之间的模型训练;本页讨论的是跨数据源的受治理查询、指标、连接和BI结果。
Does federated analytics eliminate data copies?
联邦分析能消除所有数据副本吗?
Not always. Queries usually access sources in place, but governed caches or materialized aggregates may be used for performance. Every copy needs explicit purpose, refresh, policy, lineage, retention, and deletion.
不一定。查询通常原位访问来源,但可为性能使用受治理缓存或物化聚合。每个副本都需要明确目的、刷新、策略、血缘、保留和删除。
How do you validate a federated metric?
怎样验证联邦指标?
Define its formula, grain, dimensions, units, time, inclusion rules, and owner, then reconcile representative and edge-case results against source-native control queries.
定义其公式、粒度、维度、单位、时间、纳入规则和负责人,再用来源原生控制查询核对代表性及边缘案例结果。
When should data be materialized instead?
什么时候应该改用物化?
Materialize repeated heavy workloads, long historical scans, transformations that need stable snapshots, or queries that cannot meet source-load and latency budgets through federation.
重复重型工作负载、长期历史扫描、需要稳定快照的转换,或无法通过联邦满足来源负载与延迟预算的查询,应考虑物化。
Official and Primary Sources官方与第一方来源
- IBM Db2 federated-server documentationIBM Db2联邦服务器文档
- Trino query-pushdown documentationTrino查询下推文档
- Microsoft PolyBase guide for querying external dataMicrosoft PolyBase外部数据查询指南
- PostgreSQL foreign-data access documentationPostgreSQL外部数据访问文档
Capabilities differ across engines and connectors. Verify type mapping, pushdown, joins, security, caching, freshness, failure behavior, and commercial terms for the deployed version.
不同引擎和连接器的能力不同。应针对部署版本验证类型映射、下推、连接、安全、缓存、新鲜度、故障行为和商业条款。
