Dating App & Matching
Problem statement
Profiles, swipes, mutual match notifications, chat after match, safety reporting, and geo-based discovery with privacy and scale.
How it works
- Discovery: show candidates within radius excluding already swiped / blocked.
- Swipe right writes like row; on mutual, create match + enable chat channel.
Analogy: Speed dating cards — you circle yes/no; the organizer (matching service) only opens conversation when both circled yes.
High-level design
Rendering diagram…
Components explained — this design
| Component | What it is | Why we use it here |
|---|---|---|
| API + Geo | Location-aware discovery endpoints. | Applies privacy bucketing before exposing distances. |
| Redis GEO nearby | Fast candidate pool by distance. | Interactive map performance at scale. |
| PostgreSQL swipes/matches | Durable graph of likes/matches/blocks. | Relational integrity for reporting, safety bans, and unique mutual match detection. |
| Kafka MatchCreated | Async fan-out after match. | Enables chat channel creation, push, analytics without blocking swipe response. |
| Trust & Safety ML | Classifiers for abusive images/text. | Runs async to avoid blocking swipe UX on every request. |
Shared definitions: 00-glossary-common-services.md
Low-level design
Candidate generation
- Redis GEO for coarse nearby set → filter in app server using preferences (age, gender prefs) from PostgreSQL or feature store.
Swipe throughput
- Append-only likes table partitioned by hashed swiper_id; async mutual check via Kafka to decouple write ack from push.
Safety
- Report user workflow → human review queue + automated image hash matching (PhotoDNA integrations where legal).
Anti-fraud
- Device farm detection — rate limit per device; graph analysis of like clusters.
E2E: mutual match
Rendering diagram…
Tricky parts
| Problem | Solution |
|---|---|
| Stalker location | Blur distance buckets; exact location never shown |
| Biased ranking | Periodic re-randomization; fairness metrics |
| Gender options beyond binary | Data model flexibility + search filters inclusive |
Caveats
- GDPR right to be forgotten — hard delete cascades across photos CDN, messages, analytics.
- Underage safety — age verification legally required in some jurisdictions.
Managed
- Amazon Location for geofencing; Rekognition moderation (careful bias review).