Design Tinder
System design for a location-based matching app like Tinder.

On this page
- 1. Requirements
- Functional Requirements
- Out of Scope
- Non-Functional Requirements
- 2. Capacity Estimation
- 3. API Gateway
- 4. User Profile Service
- Upload Flow
- Data Model
- Indexing Strategy
- Bottlenecks in the Profile Service
- 5. Location Service
- The Problem with Raw Coordinates
- Geohashing
- Redis GEO
- Location Updates
- Bottlenecks in the Location Service
- 6. Discovery Service
- The Already-Seen Problem
- Bloom Filter for Seen Profile Exclusion
- Full Discovery Pipeline
- Bottlenecks in Discovery
- 7. Swipe Service
- Swipe Flow
- Data Model
- Bottlenecks in the Swipe Service
- 8. Chat Service
- Protocol will be WebSockets
- The Multi-Server Problem
- Message Storage
- Online Presence
- Bottlenecks in the Chat Service
- 9. Full Data Flow Summary
- 10. Resilience and Fault Tolerance
- 11. Technology Choices Summary
1. Requirements
Functional Requirements
- User profile management like photos, bio, age, gender, relationship preferences
- Location-based user discovery like finding potential matches within a configurable radius
- Swipe right (like) and swipe left (pass) on profiles
- Match detection. Mutual like triggers a match
- Real-time chat between matched users only
Out of Scope
- Tinder Gold / Boost (paid profile promotion in discovery)
- Video calls
- Advanced ML ranking for swipe ordering (acknowledged but not designed)
- Push notifications (same APNs/FCM architecture the last Instagram article already covered), and I have a separate article for a proper notification system.
Non-Functional Requirements
- High availability: Discovery and chat must never go down
- Low latency: Profiles must appear on screen within 100ms of opening the app
- Location accuracy: Discovery must reflect the user's current position in near real-time
- No repeated profiles: A user must never see a profile they have already swiped on
- Strong consistency for match detection: A match must never be missed or double-triggered
- Eventual consistency is acceptable for profile updates and like counts
2. Capacity Estimation
| Metric | Value |
|---|---|
| DAU | 10 million |
| Swipes per day | ~50 swipes per user -> 500 million swipes/day -> ~5,800 swipes/second on average, more at peak |
| Match rate | ~1-2% of right swipes -> ~5 million matches/day (if around half of all swipes are right swipes) |
| Total registered users | ~50 million |
| Photos per user | ~5 photos at ~1 MB each -> 5 MB per user |
| Total media storage | 50 million × 5 MB = ~250 TB total (profiles are written once, updated rarely) |
| Messages per day | Matched users exchange ~10 messages/day -> 50 million messages/day (relatively low volume) |
Key observations from these numbers. Swipe volume at 500 million per day is the dominant load in the system. Every swipe must be recorded, checked for a match, and used to ensure that profile is never shown again. Media storage is manageable since profiles are created once and rarely updated. Chat volume is surprisingly low because only matched users can chat and the match rate is small. This means the system must be optimized primarily for the discovery and swipe paths, not for media serving or messaging.
3. API Gateway
All client requests enter through the API Gateway, which handles authentication, rate limiting, and routing to the correct downstream service. The same constraint applies as in every other design, the API Gateway must never be in the path of binary media payloads. Profile photo uploads bypass the Gateway after authentication, using a presigned S3 URL for direct client-to-S3 upload. The Gateway handles only lightweight request orchestration.
4. User Profile Service
The Profile Service manages everything about a user's identity on Tinder; their photos, bio, age, gender, and discovery preferences.
Upload Flow
When a user uploads profile photos:
- Client sends an upload request to the API Gateway, which authenticates the user and forwards it to the Profile Service
- The Profile Service generates a presigned S3 URL and returns it to the client
- The client uploads photos directly to S3, the backend never touches the binary payload
- S3 triggers a processing event via Kafka
- A Photo Processing Worker generates multiple resolution variants (thumbnail for the discovery card stack, medium for full profile view) and stores all variants back in S3
- The CDN sits in front of S3 and serves profile photos to clients globally with high cache hit rates, since profile photos change rarely
Data Model
Users Table (PostgreSQL)
Users
user_id UUID, primary key
name VARCHAR
bio TEXT
age INTEGER
gender ENUM('male', 'female', 'non_binary')
looking_for ENUM('male', 'female', 'everyone')
relationship_type ENUM('casual', 'serious', 'friendship')
min_age_pref INTEGER
max_age_pref INTEGER
radius_km INTEGER
created_at TIMESTAMP
last_active TIMESTAMP
Photos Table (PostgreSQL)
Photos
photo_id UUID, primary key
user_id UUID, foreign key -> Users
s3_url TEXT
order_index INTEGER
uploaded_at TIMESTAMP
Photos are stored as a separate table with an order_index so users can reorder their photo stack without updating the Users row.
Indexing Strategy
Discovery queries filter on gender, looking_for, relationship_type, and age. A composite index on (gender, looking_for, relationship_type, age) lets a query that searches the whole table by those filters do a single index scan instead of a full table scan.
Additionally, frequently accessed profiles (users who appear in many discovery stacks) are cached in Redis with their full metadata, so the database is not hit for every profile hydration request.
Bottlenecks in the Profile Service
The Profile Service is not a high-throughput write path as users update their profiles rarely. The read path is the concern, since profile metadata is fetched constantly during discovery and feed hydration. Redis caching in front of PostgreSQL absorbs the vast majority of this read load.
5. Location Service
Location is the foundational layer of Tinder's discovery system. Every discovery query begins with proximity: find users near me before applying any other filter.
The Problem with Raw Coordinates
Storing user locations as raw latitude and longitude pairs (e.g. 19.0760, 72.8777 for Mumbai) makes radius queries extremely expensive. Finding all users within 50km requires a range scan across two floating-point columns simultaneously, which does not index well and becomes catastrophically slow at scale.
Geohashing
Geohashing solves this by converting a 2D coordinate into a single alphanumeric string that encodes both latitude and longitude. The world is recursively divided into a grid of rectangular cells, and each cell is assigned a short string code. The key property is that geographically close locations share a common geohash prefix:
te -> a large region of western India (~1,250 km × 625 km)
te7u -> Mumbai region (~39 km × 20 km)
te7u3 -> a specific neighborhood in Mumbai (~5 km × 5 km)
te7u3x -> a few city blocks (~1.2 km × 0.6 km)
Finding users near Mumbai becomes a simple prefix query, WHERE geohash LIKE 'te7u%', rather than a complex two-dimensional radius calculation. A geohash precision of 4-5 characters gives cells of roughly 5-40 km, which suits Tinder's typical discovery radius.
One catch: two people standing on either side of a cell boundary can be a few metres apart but have completely different prefixes. So a proximity search always checks the user's own cell plus its 8 neighbours, then filters the results by actual distance.
Redis GEO
Rather than implementing geohashing manually in a relational database, the Location Service uses Redis GEO, which is a native Redis data type that stores coordinates and supports radius queries out of the box. Under the hood Redis GEO uses geohashing internally, storing coordinates in a sorted set scored by their geohash value, and it handles the neighbouring-cells problem for you.
Key operations:
# add user_123 at Mumbai coordinates (longitude first, then latitude)
GEOADD users:locations 72.8777 19.0760 "user_123"
# all users within 50 km of those coordinates
GEOSEARCH users:locations FROMLONLAT 72.8777 19.0760 BYRADIUS 50 km ASC
(GEOSEARCH is the modern form of the older GEORADIUS command, which still works but has been deprecated since Redis 6.2.)
Location Updates
Tinder users move constantly. Home in the morning, office at noon, gym in the evening. The Location Service updates a user's position in Redis GEO whenever the client detects significant movement (typically more than 500 meters) or whenever the user opens the app. This is a simple GEOADD call that overwrites the previous position atomically.
Location updates are also written asynchronously to a Locations Table in PostgreSQL for audit and history purposes, but the hot path for discovery always reads from Redis GEO.
Bottlenecks in the Location Service
Redis GEO is in-memory and extremely fast for both writes and radius reads. The main concern is memory. Storing coordinates for 10 million active users in Redis is manageable (roughly 100 bytes per user, ~1 GB). The secondary concern is location update frequency. If every client sends location updates every few seconds, the write volume becomes significant. This is mitigated by client-side throttling. Only send a location update if the user has moved more than 500 meters since the last update, or when the app is opened.
A single users:locations key also lives on a single Redis node, so every discovery query in the world would hit that one node. In practice the key is split by region (for example users:locations:te7u per geohash prefix, or per city), which spreads both memory and traffic across the cluster.
6. Discovery Service
The Discovery Service is the heart of Tinder. When a user opens the app, it must produce a stack of 20 profiles, filtered by proximity, age, gender, and relationship preference, and excluding everyone they have already seen, in under 100ms.
The Already-Seen Problem
Unlike Instagram where every user sees the same celebrity post, Tinder's discovery stack is unique per user and must never repeat a profile the user has already swiped on. This exclusion check is the most technically interesting requirement in the system.
A naive approach like querying a Swipes table in PostgreSQL with WHERE swiper_id = X AND swiped_id IN (candidate_list) is far too slow at scale. A user who has been on Tinder for a year may have swiped on tens of thousands of profiles. Joining against that history on every discovery request is prohibitively expensive.
Bloom Filter for Seen Profile Exclusion
A Bloom Filter is a probabilistic data structure that answers one question extremely efficiently: "have I seen this item before?"
It uses a fixed-size bit array and multiple hash functions. When user A swipes on user B, user B's ID is run through 3-4 hash functions, each producing an index, and those bits are set to 1 in the array. To check "has user A seen user B?", the same hash functions are applied and all resulting bit positions are checked. If all bits are 1, the answer is "probably yes." If any bit is 0, the answer is "definitely no."
Bit array: 0 1 0 0 1 0 1 0 0 1 0 0
↑ ↑ ↑ ↑
BF.ADD user_B: hashes to positions 1, 4, 6 → set to 1
Check user_C: hashes to positions 1, 4, 9 → all 1 → "probably seen"
Check user_D: hashes to positions 2, 4, 6 → position 2 is 0 → "definitely not seen"
Key properties:
- No false negatives: a profile the user has seen will always be excluded. They will never be shown the same profile twice.
- Small false positive rate: occasionally a profile is excluded when the user has not actually seen it (like user_C above). On Tinder this is completely acceptable. Occasionally skipping a valid candidate is far better than showing a rejected profile again.
- Extremely memory efficient: storing 100,000 user IDs in a Redis Set might take several MB. A Bloom Filter for the same data at a 1% false positive rate takes about 120 KB (roughly 10 bits per ID, no matter how long the IDs are).
Redis supports Bloom Filters natively via the RedisBloom module:
BF.ADD seen:user_A user_B # record that user A has seen user B
BF.EXISTS seen:user_A user_B # 1 (probably seen) or 0 (definitely not seen)
BF.MEXISTS seen:user_A user_B user_C user_D # check many candidates in one call
Full Discovery Pipeline
When user A opens Tinder in Mumbai, the following sequence occurs:
flowchart TD
A[User A opens app] --> G["1. Redis GEO: users within 50 km"]
G -->|thousands of candidates| B["2. Bloom filter: drop already-seen"]
B --> P["3. Preference filter: age, gender, relationship type"]
P -->|20-50 user IDs| H["4. Redis MGET: hydrate profiles"]
H --> R["5. Return 20 profiles, photos via CDN"]
Step 1 (Proximity Query): The Discovery Service calls GEOSEARCH users:locations FROMLONLAT 72.8777 19.0760 BYRADIUS 50 km on Redis GEO. This returns a list of all user IDs within 50km, potentially thousands of candidates.
Step 2 (Bloom Filter Exclusion): The Discovery Service checks the candidates against seen:user_A, in batches with BF.MEXISTS rather than one call per candidate. Any candidate that returns 1 is excluded from the pool immediately. This reduces the candidate list significantly before any database involvement.
Step 3 (Preference Filtering): The remaining candidates are passed to a PostgreSQL query that filters on age, gender, and relationship type. Matching has to work in both directions, so the query also checks that each candidate is looking for someone like user A:
SELECT user_id FROM Users
WHERE user_id IN (candidate_list)
AND gender = 'female' -- what A is looking for
AND looking_for IN ('male', 'everyone') -- candidate is looking for A's gender
AND relationship_type = 'serious'
AND age BETWEEN 24 AND 30 -- A's age preference
AND 27 BETWEEN min_age_pref AND max_age_pref -- A's age fits the candidate's preference
LIMIT 50;
Because the query starts from a fixed list of user IDs, the database looks each one up by primary key and checks the filters on those rows, which is fast for a list of a few thousand. The composite index from earlier matters for the opposite kind of query, one that scans the whole table by preference. To keep this step cheap, the candidate list is capped before it gets here (see bottlenecks below), and many systems keep these filter fields next to the location data, or in a search engine, so the filtering happens in the same step as the radius query.
Step 4 (Profile Hydration): The filtered candidate list (now a manageable set of 20-50 user IDs) is hydrated by fetching full profile metadata from Redis using a single MGET call:
MGET profile:user_1 profile:user_2 ... profile:user_50
MGET fetches all records in a single round trip. On a cache miss for any profile, the Discovery Service falls back to PostgreSQL, fetches the missing record, and writes it back to Redis.
Step 5 (Response): The Discovery Service returns 20 fully hydrated profiles to the client: name, age, bio, photo URLs (pointing to CDN), distance. The client renders the card stack instantly.
Bottlenecks in Discovery
The Bloom Filter and Redis GEO operations are sub-millisecond. The PostgreSQL preference filter is the only step that touches a disk-based store. The remaining concern is the candidate pool size: in a dense city like Mumbai, a radius query might return 100,000 users within 50km. Checking 100,000 IDs against the Bloom Filter is cheap, but sending 100,000 IDs into a SQL IN clause is not. So the pool is capped before the SQL step, for example by taking the nearest few thousand (GEOSEARCH ... COUNT 5000 ASC) or only recently active users, and for extreme density the radius can be dynamically reduced.
7. Swipe Service
The Swipe Service handles the highest-volume write path in the system, 500 million swipes per day, or roughly 5,800 per second on average. Every swipe must be recorded durably, used to update the Bloom Filter, and checked for a mutual match.
Swipe Flow
Step 1 (Receive Swipe): Client sends POST /swipes with { swiper_id, swiped_id, direction: 'left' | 'right' } to the Swipe Service via the API Gateway.
Step 2 (Publish to Kafka): The Swipe Service immediately publishes a swipe.created event to Kafka. This decouples the hot path from all downstream processing and provides durability, even if downstream services are temporarily slow, no swipe is lost.
Step 3 (Update Bloom Filter): BF.ADD seen:user_A user_B records that user A has now seen user B. This ensures user B never appears in user A's discovery stack again.
Step 4 (Match Detection, right swipes only): Each user has a Redis Set of the people who have liked them: likes:user_B holds everyone who swiped right on user B. When user A swipes right on user B, the Swipe Service checks whether B has already liked A, that is, whether B is in A's set:
SISMEMBER likes:user_A user_B
- If it returns 1 -> match detected. The Swipe Service writes the match to the Matches DB, publishes a
match.createdevent to Kafka, and the Notification Service picks this up to alert both users via APNs/FCM. - If it returns 0 -> no match yet. The Swipe Service records A's like in B's set, so it's there when B swipes:
SADD likes:user_B user_A.
The check and the add must run as one atomic step. If they are two separate commands and A and B swipe right on each other at the same moment, both checks can run before either add, both see "no like yet", and the match is silently missed. Running both commands inside a small Lua script makes Redis execute them together with nothing in between:
-- KEYS[1] = likes:user_A, KEYS[2] = likes:user_B
-- ARGV[1] = user_B, ARGV[2] = user_A
if redis.call('SISMEMBER', KEYS[1], ARGV[1]) == 1 then
return 1 -- match
end
redis.call('SADD', KEYS[2], ARGV[2])
return 0 -- no match yet
(In a Redis Cluster, a script can only touch keys stored on the same node, and likes:user_A and likes:user_B will usually live on different nodes. A common way around this is to key likes by the pair instead, for example likes:{user_A:user_B} with the smaller ID first, holding whichever of the two has liked the other. The check and the add then touch one key, and the script works anywhere in the cluster.)
Step 5 (Async Persistence): A Kafka consumer writes all swipes asynchronously to the Swipes Table in PostgreSQL (the permanent record of every swipe in the system). This write happens off the hot path and does not affect swipe latency.
Data Model
Swipes Table (PostgreSQL)
Swipes
swipe_id UUID, primary key
swiper_id UUID, foreign key -> Users
swiped_id UUID, foreign key -> Users
direction ENUM('left', 'right')
swiped_at TIMESTAMP
Matches Table (PostgreSQL)
Matches
match_id UUID, primary key
user_1_id UUID, foreign key -> Users
user_2_id UUID, foreign key -> Users
matched_at TIMESTAMP
UNIQUE (user_1_id, user_2_id) -- always stored with the smaller ID first
Storing each pair in a fixed order (smaller ID in user_1_id) plus the UNIQUE constraint means the same match can never be recorded twice, which covers the "never double-triggered" requirement even if an event is retried.
Bottlenecks in the Swipe Service
The hot path, the Bloom Filter update and the Redis Set check, is entirely in-memory and handles thousands of operations per second comfortably. Kafka absorbs the write burst and smooths it out for downstream consumers. The async PostgreSQL write is the only disk operation and happens off the critical path. The main Redis memory concern is the likes Sets: a very attractive user might accumulate hundreds of thousands of pending likes. This is managed by capping the likes Set size per user and periodically evicting old entries that are unlikely to result in a match.
8. Chat Service
Only matched users can chat with each other. Chat volume is relatively low, like 50 million messages per day across 5 million daily matches, but the latency requirement is strict. Messages must feel real-time. (The Chat System design goes deeper into this kind of service.)
Protocol will be WebSockets
HTTP is a request-response protocol where the client asks, the server answers. For real-time chat, the server needs to push messages to the client without waiting for a request. WebSockets provide a persistent, bidirectional connection between the client and server that stays open for the duration of the session. Once a WebSocket connection is established, the server can push messages to the client at any time with sub-millisecond overhead.
The Multi-Server Problem
WebSocket connections are stateful. A user is connected to a specific Chat Server instance. User A might be connected to Chat Server 1 in Mumbai, and User B might be connected to Chat Server 3. When User A sends a message to User B, Chat Server 1 has no direct connection to User B. It cannot push the message to User B's WebSocket connection because that connection lives on Chat Server 3.
The solution is Redis Pub/Sub. Every Chat Server subscribes to a Redis channel for every active conversation on that server. When User A sends a message:
- Chat Server 1 receives the message
- Chat Server 1 publishes the message to Redis channel
chat:{match_id} - Chat Server 3 is subscribed to
chat:{match_id}and receives the message instantly - Chat Server 3 pushes the message to User B's WebSocket connection
No direct server-to-server communication is needed. Redis acts as the message bus between Chat Servers.
Message Storage
Messages need to be stored persistently so users can scroll back through conversation history. The access pattern is always "give me messages for conversation X in chronological order, paginated". This is a perfect fit for Cassandra.
Messages Table (Cassandra)
Messages
match_id UUID, partition key
message_id TIMEUUID, clustering key (ordered by time)
sender_id UUID
content TEXT
sent_at TIMESTAMP
Partitioning by match_id means all messages for a conversation are stored together on the same Cassandra node, making conversation history fetches extremely fast. The message_id clustering key orders messages chronologically within the partition. That only works if the ID itself sorts by time, which is why it's a time-based ID (a TIMEUUID, or a Snowflake ID) rather than a random UUID.
For the active conversation view, the most recent 50 messages are also cached in a Redis Sorted Set:
- Key:
conversation:{match_id} - Member:
message_id - Score: timestamp
ZREVRANGE conversation:{match_id} 0 49 # 50 most recent messages, newest first
This returns the 50 most recent messages in a single Redis call. Older messages are fetched from Cassandra on scroll.
Online Presence
Users need to know if their match is currently online (the green dot indicator). Online presence is stored in Redis:
- Key:
presence:{user_id} - Value:
{ status: "online", last_seen: timestamp } - TTL: 30 seconds
The client sends a heartbeat to the Chat Service every 15 seconds while the app is open. Each heartbeat resets the Redis key's TTL to 30 seconds. If a user closes the app or loses connectivity, they stop sending heartbeats. After 30 seconds the key expires naturally, and the user appears offline, so no explicit logout needed, and no polling required. This handles unexpected disconnections gracefully.
Because the whole key expires, the last_seen inside it disappears at exactly the moment it's needed ("last seen 5 minutes ago"). So last seen is also written to a separate key without a TTL, as in the Chat System's presence design.
Bottlenecks in the Chat Service
WebSocket connections are long-lived and stateful, which means each Chat Server instance can only hold a finite number of concurrent connections, typically 10,000-50,000 per server depending on memory. At 10 million DAU, with a fraction of them online at once, this requires dozens to hundreds of Chat Server instances. A load balancer with sticky sessions (or consistent hashing on user ID) ensures that a user always reconnects to the same Chat Server instance after a brief disconnection, avoiding session loss. Redis Pub/Sub would only become a bottleneck if a single conversation received extreme message volume. In practice this is not a concern for a dating app where conversations are between exactly two users.
9. Full Data Flow Summary
Profile Upload Flow:
Client -> API Gateway (auth) -> Profile Service -> presigned S3 URL
Client -> S3 (direct upload)
S3 -> Kafka -> Photo Processing Worker -> S3 (thumbnail + medium variants)
Profile Service -> PostgreSQL (user metadata)
Profile Service -> Redis GEO (GEOADD user location)
Discovery Flow:
Client opens app -> Discovery Service
-> Redis GEO GEOSEARCH (nearby user IDs within radius, capped)
-> Redis Bloom Filter BF.MEXISTS (exclude already seen users)
-> PostgreSQL (filter by age, gender, relationship type, both directions)
-> Redis MGET (hydrate profile metadata)
-> CDN (profile photo URLs served directly)
-> 20 profiles returned to client in <100ms
Swipe Flow:
Client right/left swipes -> Swipe Service
-> Kafka (swipe.created, durability)
-> Redis BF.ADD seen:user_A user_B (update Bloom Filter)
-> If right swipe (one atomic Lua script):
Redis SISMEMBER likes:user_A user_B
-> Match: write to Matches DB + Kafka match.created -> Notification Service -> APNs/FCM
-> No match: Redis SADD likes:user_B user_A
-> Kafka consumer -> PostgreSQL Swipes Table (async persistence)
Chat Flow:
Client -> WebSocket connection -> Chat Server
Message sent -> Chat Server 1
-> Redis Pub/Sub publish chat:{match_id}
-> Chat Server N (subscribed) -> WebSocket push to recipient
-> Cassandra (persistent message storage)
-> Redis Sorted Set ZADD conversation:{match_id} (recent message cache)
Presence Flow:
Client heartbeat every 15s -> Chat Service
-> Redis SET presence:{user_id} TTL 30s
-> Key expires on disconnect -> user appears offline
10. Resilience and Fault Tolerance
- Redis GEO for location means location data is in-memory and extremely fast, but Redis on its own is not durable enough to be the only copy. Location data is also asynchronously written to PostgreSQL, so on a Redis failure, the Location Service can rebuild from the persistent store. Location data is also low-stakes, a brief period of slightly stale location during a Redis recovery is acceptable.
- Bloom Filter durability is a nuanced concern. If the Redis Bloom Filter for a user is lost, they might temporarily see profiles they have already swiped on until the filter is rebuilt. This is acceptable. It is a minor UX issue, not a data integrity issue. The permanent swipe history in PostgreSQL can be used to rebuild the Bloom Filter for a user on cache miss.
- Kafka decoupling throughout the swipe and upload pipelines means every downstream consumer can fail and recover independently without data loss. Swipes are never lost, they sit in Kafka until the consumer processes them.
- Cassandra replication for chat messages ensures no message is lost even under node failures. Replication factor of 3 across availability zones is standard.
- WebSocket reconnection is handled gracefully. If a Chat Server goes down, clients reconnect automatically via the load balancer to a new server instance. The new server subscribes to the relevant Redis Pub/Sub channels and Redis Sorted Set for recent messages, rebuilding state without any data loss.
- Match detection consistency: Redis executes one command at a time, and a Lua script runs as a single command, so wrapping the mutual-like check and the add in one script means two simultaneous right swipes between user A and user B can never both miss the match. One runs first and adds its like; the second finds it there. The
UNIQUEpair constraint on the Matches table then guarantees the match is recorded exactly once.
11. Technology Choices Summary
| Component | Technology | Why |
|---|---|---|
| API Gateway | Kong / AWS API Gateway | Auth, rate limiting, routing |
| Blob Storage | AWS S3 | Immutable profile photos, durable, CDN-native |
| CDN | CloudFront / Akamai | Edge caching for profile photos, high cache hit rate |
| Decoupling | Apache Kafka | Swipe durability, photo processing fanout, match events |
| Location Store | Redis GEO | In-memory radius queries, real-time location updates |
| Seen Profile Exclusion | Redis Bloom Filter | Memory-efficient already-seen tracking, no false negatives |
| Pending Likes Store | Redis Set + Lua script | O(1), atomic mutual like detection, match triggering |
| User / Profile DB | PostgreSQL with composite indexes | Structured data, preference filtering |
| Swipes / Matches DB | PostgreSQL | Permanent swipe and match history |
| Chat Protocol | WebSockets | Persistent bidirectional connection, real-time message delivery |
| Chat Message Bus | Redis Pub/Sub | Cross-server message routing between WebSocket servers |
| Message Storage | Cassandra | High write throughput, partition by match_id, chronological ordering |
| Recent Message Cache | Redis Sorted Set | Sub-millisecond recent conversation fetch |
| Online Presence | Redis with TTL + heartbeat | Automatic offline detection on disconnect |