# tsar0705/news-feed-system-hld architecture

> Architecture diagram of the GitHub repository tsar0705/news-feed-system-hld, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tsar0705/news-feed-system-hld
- Repository: https://github.com/tsar0705/news-feed-system-hld

## Overview

This repository is a news-feed system design submission, not an implementation. Its principal workflow is content creation followed by asynchronous fan-out and ranked feed reads; it also documents user and follow management, engagement, search, and media. The graph represents the documented target architecture. Only the README was available as evidence, so relationships not explicitly stated there are omitted; the documentation paths identify where the design is described, not inspected implementation modules.

Main entry points: [`docs/TECHNICAL_DESIGN.md`](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md) (Kafka), [`docs/HLD.md`](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md) (Feed service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_product["Product services"]
  node_user["User management<br/>[HLD.md]"]
  node_content["Content creation<br/>[HLD.md]"]
  node_engagement["Engagement<br/>[HLD.md]"]
  node_search["Search and discovery<br/>[HLD.md]"]
  node_media["Media service<br/>[HLD.md]"]
end

subgraph group_async["Async processing"]
  node_fanout["Hybrid fan-out"]
  node_queue["Kafka"]
  node_notifications["Notifications"]
  node_search_index["Search indexing"]
  node_counters["Engagement counters"]
end

subgraph group_storage["Data and storage"]
  node_relational[("PostgreSQL<br/>[HLD.md]")]
  node_distributed[("Posts and feed store<br/>[HLD.md]")]
  node_elasticsearch[("Elasticsearch<br/>[HLD.md]")]
  node_object_store[("S3 media storage<br/>[HLD.md]")]
end

subgraph group_delivery["Read delivery"]
  node_feed["Feed service<br/>[HLD.md]"]
  node_ranking["Feed ranking"]
  node_cache[("Redis cache")]
  node_cdn["CDN"]
end

node_client(("User"))

node_client -.->|"manages account"| node_user
node_client -.->|"creates content"| node_content
node_client -.->|"requests feed"| node_feed
node_client -.->|"engages"| node_engagement
node_client -.->|"searches"| node_search
node_content -->|"decouples writes"| node_queue
node_queue -->|"dispatches fan-out"| node_fanout
node_queue -->|"dispatches indexing"| node_search_index
node_queue -->|"dispatches counter updates"| node_counters
node_queue -->|"dispatches notifications"| node_notifications
node_fanout -->|"updates feed"| node_feed
node_feed -->|"merges and ranks"| node_ranking
node_fanout -->|"updates incrementally"| node_cache
node_user -->|"stores users"| node_relational
node_user -->|"stores follows"| node_relational
node_content -->|"stores posts"| node_distributed
node_feed -->|"stores feeds"| node_distributed
node_engagement -->|"stores engagement"| node_distributed
node_search_index -->|"indexes content"| node_elasticsearch
node_media -->|"stores media"| node_object_store
node_media -->|"delivers media"| node_cdn
node_feed -->|"caches feed pages"| node_cache
node_engagement -->|"caches hot posts"| node_cache
node_user -->|"caches profiles and sessions"| node_cache
node_search -.->|"searches index"| node_elasticsearch

click node_user "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md"
click node_content "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md"
click node_engagement "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md"
click node_search "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md"
click node_media "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md"
click node_feed "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md"
click node_ranking "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md"
click node_cache "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md"
click node_fanout "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md"
click node_queue "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md"
click node_notifications "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md"
click node_search_index "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md"
click node_counters "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md"
click node_relational "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md"
click node_distributed "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md"
click node_elasticsearch "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md"
click node_object_store "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md"
click node_cdn "https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_user,node_content,node_engagement,node_search,node_media,node_client toneBlue
class node_fanout,node_queue,node_notifications,node_search_index,node_counters toneAmber
class node_relational,node_distributed,node_elasticsearch,node_object_store toneMint
class node_feed,node_ranking,node_cache,node_cdn toneRose
```

## Components

### Product services

- [User management](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md): `docs/HLD.md`
- [Content creation](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md): `docs/HLD.md`
- [Engagement](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md): `docs/HLD.md`
- [Search and discovery](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md): `docs/HLD.md`
- [Media service](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md): `docs/HLD.md`

### Async processing

- [Hybrid fan-out](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md): `docs/TECHNICAL_DESIGN.md`
- [Kafka](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md): `docs/TECHNICAL_DESIGN.md`
- [Notifications](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md): `docs/TECHNICAL_DESIGN.md`
- [Search indexing](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md): `docs/TECHNICAL_DESIGN.md`
- [Engagement counters](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md): `docs/TECHNICAL_DESIGN.md`

### Data and storage

- [PostgreSQL](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md): `docs/HLD.md`
- [Posts and feed store](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md): `docs/HLD.md`
- [Elasticsearch](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md): `docs/HLD.md`
- [S3 media storage](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md): `docs/HLD.md`

### Read delivery

- [Feed service](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/HLD.md): `docs/HLD.md`
- [Feed ranking](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md): `docs/TECHNICAL_DESIGN.md`
- [Redis cache](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md): `docs/TECHNICAL_DESIGN.md`
- [CDN](https://github.com/tsar0705/news-feed-system-hld/blob/main/docs/TECHNICAL_DESIGN.md): `docs/TECHNICAL_DESIGN.md`

### Other components

- **User**

## Connections

- User → User management: manages account
- User → Content creation: creates content
- User → Feed service: requests feed
- User → Engagement: engages
- User → Search and discovery: searches
- Content creation → Kafka: decouples writes (evidence: `README.md`)
- Kafka → Hybrid fan-out: dispatches fan-out (evidence: `README.md`)
- Kafka → Search indexing: dispatches indexing (evidence: `README.md`)
- Kafka → Engagement counters: dispatches counter updates (evidence: `README.md`)
- Kafka → Notifications: dispatches notifications (evidence: `README.md`)
- Hybrid fan-out → Feed service: updates feed (evidence: `README.md`)
- Feed service → Feed ranking: merges and ranks (evidence: `README.md`)
- Hybrid fan-out → Redis cache: updates incrementally (evidence: `README.md`)
- User management → PostgreSQL: stores users (evidence: `README.md`)
- User management → PostgreSQL: stores follows (evidence: `README.md`)
- Content creation → Posts and feed store: stores posts (evidence: `README.md`)
- Feed service → Posts and feed store: stores feeds (evidence: `README.md`)
- Engagement → Posts and feed store: stores engagement (evidence: `README.md`)
- Search indexing → Elasticsearch: indexes content (evidence: `README.md`)
- Media service → S3 media storage: stores media (evidence: `README.md`)
- Media service → CDN: delivers media (evidence: `README.md`)
- Feed service → Redis cache: caches feed pages (evidence: `README.md`)
- Engagement → Redis cache: caches hot posts (evidence: `README.md`)
- User management → Redis cache: caches profiles and sessions (evidence: `README.md`)
- Search and discovery → Elasticsearch: searches index
