Design a nearby feed for a dating app
built it: Discovery + Global Feed1 · CLARIFYRadius, freshness window, how preferences filter, expected scroll depth, and whether paid users see more.
2 · SHAPEGateway → Go feed service. Geo query narrows candidates, preference filter trims, Redis holds ranked pages so scroll is a cache read.
3 · DATA & HOT PATHMongo geo index + aggregation for retrieval; Redis sorted sets for ranking; posts carry a 24h TTL so the feed self-cleans.
4 · FAILURE & SECURITYStale ranking is acceptable for seconds; a cache miss falls back to Mongo. Media via presigned URLs, never public.
TRADE-OFF I’D ACCEPTEventual freshness in the ranked cache in exchange for a 10 ms p50 read path.
client → gateway → feed(go)
├─ mongo (geo + prefs)
└─ redis (ranked pages, TTL)