# Tinder

## Func req

1. Store profiles (with images)
2. Recommend matches
3. Note when you find match
4. Direct messaging

## NFR

5 images per profile&#x20;

active users (and 0.1% of them are matching)

## Trade offs

### How to store images

#### Blob in DB

BLOB (Binary Large OBject) is a <mark style="background-color:orange;">data type used to store large binary data, such as images, audio files, video files,</mark> documents (e.g., PDF, Word), and other types of binary data.

:thumbsup:Transaction guaranties (but we will not be doing changes to the image :x:)

:thumbsup:indexes (search) but we will not search by photo :x:

:thumbsup:action control (but file system will also provide it)

#### Store on file system

:thumbsup:cheaper

:thumbsup:faster

:thumbsup:we can use CDN on top of it

:thumbsup:we can store in DB following info (profile ID, image ID, File URL)

## Specific technologies

### XMPP protocol (7 layer)

* XMPP protocol for sending messages. Bsed on XML
* It supports various message types, including text, multimedia, and structured data.&#x20;
* Shares online/offline status of user.&#x20;
* Can support file transfer, group chat, voice and video calls, IoT communication via extensions.&#x20;
* Decentralized protocol.
* Supports TLS. Works on TCP (somehow WebSocket is onvolved)
* Users can subscribe to receive updates about the presence status of other users

<figure><img src="/files/wGxu2FymIKa6KwoPx4I2" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://amartyushov.gitbook.io/tech/system-design/interview-preparation/plan/tinder.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
