I want make a social app like Tinder. I will use firebase Auth & firestore.
My match mechanism is:
- Every user data will saved in a individual firestore doc.
- In user data, will save "like" and "dontLike" field, both type are array.
- Each array will save user ID in it.
- When user A click like user B, My server will get the user B data.
- Check is user A's ID in user B's like array? If true, then A and B will be friend.
Problem:
I predict when user click more like or dontLike. The like array and dontLike array in firestore will grow bigger and bigger. This may cause the fee of firestore bigger and bigger.
The ideal result I want:
- The way to prevent the like array and dontLike array in firestore grow bigger and bigger.
- Or any smarter way to match A and B user.