I'm using Cloud Firestore (NoSQL) to store profile information for users like:
{
"uid": "abc123",
"name": "...",
"friends": [
"uid": "x234",
]
...
}
Now I'm wondering how to structure a direct chat from user to user. I'm thinking of either:
Adding an addional field for each user document like:
"chats": [
{
"from": "name",
"message": "...",
...
},
...
]
Or instead of using Firestore for the chat, I consider using Firebase realtime database with a similar structure.
The last approach would have the benefit, that the user-document would not be "bloated" with lots of chat protocols.
I'd need some advice which would structure/implemention would suit this usecase best.