Building a Multi-Source News Aggregation System: Architecture and Real-Time Distribution in Practice

    This article walks through the design and implementation of a multi-source news aggregation and real-time distribution system. It defines the core goals of unified ingestion, effective deduplication, low-latency distribution, and stability, then breaks the architecture into five layers: ingestion, processing, storage, distribution, and operations. You will see how to normalize heterogeneous data sources, apply two-level deduplication with exact and near-duplicate matching, distribute content through a message queue plus push channel, and keep the system reliable with elastic scaling, circuit breaking, and observability built on metrics, logs, and alerts.

    1. Background and Problem Definition

    In an environment of information overload, news content is clearly multi-source, heterogeneous, and high-frequency: data formats vary widely across sources, update cadence is inconsistent, and duplicate and noisy content make up a large share. Pushing this content directly to end users creates three typical problems: duplicate information disrupts the reading experience, inconsistent formats raise front-end rendering costs, and system stability suffers under sudden traffic spikes.

    The core goals of a multi-source news aggregation and real-time distribution system can be abstracted into four points:

    • Unified ingestion: Hide protocol and format differences across data sources.
    • Effective deduplication: Identify and merge duplicate content within an acceptable delay.
    • Real-time distribution: Push new content to subscribers with low latency.
    • Stability and control: Maintain service quality during traffic spikes and provide observability.

    2. Overall Architecture

    A practical system is typically divided into five layers:

    1. Ingestion layer: Pulls or receives data from multiple source types, supporting both scheduled polling and event callbacks.
    2. Processing layer: Handles cleaning, normalization, deduplication, classification, and tagging.
    3. Storage layer: Retains raw content, structured indexes, and short-term cache separately.
    4. Distribution layer: Delivers content to subscribers through a message queue and push channels.
    5. Operations layer: Provides monitoring and alerting, log tracing, and elastic scaling.

    On the cloud, these layers can be composed from general-purpose capabilities: object storage for archiving raw content, a message queue for decoupling and peak shaving, a container platform for stateless processing services, and log and monitoring services for observability. General-purpose offerings from cloud providers such as Baidu AI Cloud can serve as candidate implementations for each layer.

    3. Data Source Ingestion and Normalization

    The key to the ingestion layer is not “ingesting a lot” but “ingesting reliably.” It helps to abstract a unified data source interface:

    1. class DataSource:
    2. def fetch(self) -> list[dict]:
    3. raise NotImplementedError
    4. def normalize(self, raw: dict) -> dict:
    5. # Unified fields: id, title, summary, source, publish_time, raw
    6. return {
    7. "id": raw.get("id"),
    8. "title": raw.get("title", "").strip(),
    9. "summary": raw.get("summary", "").strip(),
    10. "source": raw.get("source", "unknown"),
    11. "publish_time": raw.get("publish_time"),
    12. "raw": raw,
    13. }

    Three points deserve attention in engineering:

    • Time normalization: Sources differ in time zone and format, so convert everything to a standard time with a time zone.
    • Encoding and character cleaning: Remove control characters and normalize whitespace to avoid downstream parsing errors.
    • Failure isolation: A single failing source should not break the whole job; set timeouts and a retry limit.

    4. Deduplication and Content Merging

    Deduplication is the core value of an aggregation system. The common approach has two levels:

    • Exact deduplication: Use a content ID or content hash to quickly block fully identical items.
    • Near deduplication: Normalize the title and summary, compute similarity, and merge items above a threshold into the same event cluster.

    Illustrative logic:

    1. def is_duplicate(new_item, existing_items, threshold=0.85):
    2. for item in existing_items:
    3. if similarity(new_item["title"], item["title"]) >= threshold:
    4. return True
    5. return False

    In real systems, to control compute cost, a lightweight index first narrows the candidate set before similarity is computed. A time window is also applied so that near comparison runs only on recent content, preventing historical data from slowing down processing.

    5. Real-Time Distribution and Push

    The distribution layer is best built as a combination of “message queue + push channel”:

    • The processing layer writes qualified content into a message queue, decoupling producers and consumers.
    • The distribution service consumes by subscription topic and maintains long connections or uses a push gateway.
    • For high-concurrency scenarios, batch aggregation and merged pushes reduce connection pressure.

    It is worth stressing that the push strategy should support rate limiting and graceful degradation: when sudden traffic exceeds a threshold, prioritize the core path, and delay or merge non-critical notifications.

    6. Elastic Scaling and Stability

    News traffic has clear peaks and valleys, so elasticity is a must:

    • Statelessness: Keep processing and distribution services stateless for easy horizontal scaling.
    • Auto scaling: Trigger scale-out and scale-in based on metrics such as queue backlog and response latency.
    • Cache-first: Put hot content in cache to reduce repeated computation and storage reads.
    • Circuit breaking and isolation: Apply circuit breakers to failing sources or downstream dependencies to prevent fault propagation.

    7. Observability and Operations

    At minimum, cover three types of signals:

    • Metrics: Ingestion rate, deduplication hit rate, end-to-end latency, and queue backlog.
    • Logs: Structured logs carrying content identifiers and trace IDs.
    • Alerts: Threshold-based alerts for latency spikes, sustained backlog growth, and consecutive source failures.

    8. Conclusion

    The essence of a multi-source news aggregation system is building a stable, controllable pipeline between heterogeneous data and a real-time experience. Developers should focus on a unified ingestion abstraction, two-level deduplication, peak-shaving distribution, and observability, and rely on general-purpose cloud capabilities for elasticity and operational automation. Following the layered approach above, you can build an information aggregation and distribution platform with clear logic that is easy to extend.