Design a federated search system across heterogeneous data sources
Instruction: Outline the architecture of a federated search system that can query and aggregate results from multiple heterogeneous data sources.
Updated
Official answer
Define searchable sources, query features, freshness, authorization and response deadline. Decide whether queries fan out to live sources, use a consolidated index, or combine both. Live federation preserves source control but inherits latency, availability and inconsistent query capabilities.
Authenticate the caller and authorize each source query. Connectors translate a bounded query into source-specific parameters and return a normalized result with source-qualified identity, provenance, permitted snippet and a source continuation token. Use parameter binding or structured query APIs, not concatenated user input.
Run bounded parallel requests with deadlines, rate limits and cancellation. Expose partial results and unavailable sources explicitly. A timeout is not evidence that the source had no matches. Permission checks must also protect snippets, counts, cached responses and subsequent document retrieval.
Scores from unrelated engines are not directly comparable. Use an evaluated fusion method, such as rank-based fusion, or a calibrated reranker, then deduplicate with defined identity rules. Pagination needs stable per-source continuation and merge state; a fresh top-k query for each page can repeat or omit results.
For example, a private document found by one connector must not reappear through an unscoped shared cache. Key caches by the relevant permission context and invalidate them on access changes. Measure relevance, coverage, partial-response rate, freshness and tail latency with representative queries. Clicks alone are biased by exposure and do not establish retrieval quality.