Design the graph layer for billions of edges—follows, likes, and recommendations—supporting point lookups, traversals, and feed generation. Balance OLTP graph updates with offline analytics and ranking features.
Functional requirements
- Store directed relationships with timestamps and weights
- Fast existence and degree queries for edges between nodes
- Bounded-hop traversals for recommendations and search
- Fan-out to messaging or feed services on graph changes
- Bulk import, backfill, and incremental CDC into analytics
Non-functional requirements
- Horizontal sharding by vertex ID or domain-specific cuts
- Low latency for interactive graph reads at huge scale
- Consistency model clear for concurrent follows/unfollows
- Efficient batch exports for ML and ranking pipelines