No video

How to Design Firebase Collection and Documents for Chat App

  Рет қаралды 14,785

dbestech

dbestech

Күн бұрын

How to Design Firebase Collection and Documents for Chat App
Flutter Chat App Udemy Course
www.udemy.com/...
📕📕📕Learn about our excellent course
Flutter Multi Vendor App
www.dbestech.c...
Flutter Single Vendor App
www.dbestech.c...
📕📕📕📕📕

Пікірлер: 49
@emranimam92
@emranimam92 Жыл бұрын
Good video! 👍 One issue with the fields in your message collection, you set from_name, from_picture, to_name etc. but if the user update those information you have to update your whole message collection when those values changes. You could only set just the id and query user to retrieve those informations.
@dbestech
@dbestech Жыл бұрын
actually when I update, I do update based on id, nothing else
@emranimam92
@emranimam92 Жыл бұрын
@@dbestech is it a better design? If you have more collection then you have to update those too.
@dbestech
@dbestech Жыл бұрын
@@emranimam92 well, in this app I don’t have. It’s this app’s perspective
@emranimam92
@emranimam92 Жыл бұрын
@@dbestech yeah its fine for just a simple chat app but faced this issue myself in a big app. Wish Firestore was relational rather than just collection and sub collections system.
@anazi
@anazi 4 ай бұрын
Actually in firebase you charged by updating a document only, even if the document is in a large collection with million other document. Also for a document that contains sub-collections they are not affected by the parent document updates. Yes with each message you send you are charged by "adding a document" + updating fields in a document. Two writes to the database. Which is normal in Firestore and any NoSQL db. This structure can be enhanced with "read, unread, received" properties to both the main document (AKA chat) and each message can have an indicator as well. But notice that you will be updating two documents again when user opens the unread message.
@Qoor1994
@Qoor1994 2 ай бұрын
Thank you for sharing your knowledge!
@dbestech
@dbestech 2 ай бұрын
My pleasure!
@annieincarnated
@annieincarnated Ай бұрын
So helpful
@dbestech
@dbestech Ай бұрын
Glad you think so!
@annieincarnated
@annieincarnated Ай бұрын
@@dbestech is there a way to contact you? I have a small thing on firebase I am stuck with but can't find a solution on the docs or youtube.
@dbestech
@dbestech Ай бұрын
@@annieincarnated you may leave any questions here. I will reply. But if you want to have meeting, we charge 50 usd per hour.
@annieincarnated
@annieincarnated Ай бұрын
@@dbestech not a meeting, don't know how exactly to explain it. A screenshot with the actual description would be easier so you could see the error it shows. I think I have the set up correctly ut the bug keeps telling me there is still a problem. So I am not sure if it is a problem or mistake I made or if it might be a synchronisation problem that is coming from either firebase or the platform I am using. I did put the screenshot on GIT and the community from the platform for like a week now and nobody replied.
@imyogisingh
@imyogisingh Жыл бұрын
thank you sir ! this will help us a lot ☺
@dbestech
@dbestech Жыл бұрын
Most welcome 😊
@abdallamowlid7762
@abdallamowlid7762 Жыл бұрын
Keep going brother
@dbestech
@dbestech Жыл бұрын
Thank you, I will
@brainiactech7139
@brainiactech7139 Жыл бұрын
I love your videos bro. Do the video from the beginning pls😭
@dbestech
@dbestech Жыл бұрын
kzbin.info/www/bejne/fGPbpaWJaN2GgtE here we go
@user-sb9hb2bb7o
@user-sb9hb2bb7o Жыл бұрын
Hello Sir, thanks for the video. @ 1:38: Why do you have an id in the user document? Could you not just use the document id as the user id? Thank you!
@bobbynwm
@bobbynwm 10 ай бұрын
that is for message alignment - if that uid belongs to the logged in user then it the chat bubbles sit on the right, otherwise on the left
@adscript4713
@adscript4713 5 ай бұрын
To add to what bobbynwn said, simply put you need a way to distinguish one user from another when creating and retrieving chat messages. Using the Document ID generated for each message wouldn't work as it's not associated with a particular user and needs to be unique.
@Qoor1994
@Qoor1994 2 ай бұрын
These two guys above are missing the points. I do not see why he used a separate user ID where he could use the document ID as a user ID. I would personally use document ID as a user ID.
@paininmydroid4526
@paininmydroid4526 4 ай бұрын
Wa Alaykum Salaam Wa Rahmatulahi Wa barakatuhu.
@dbestech
@dbestech 3 ай бұрын
like and share
@probelens1842
@probelens1842 Жыл бұрын
This is really amazing I wish you could explain how you did it via code
@dbestech
@dbestech Жыл бұрын
kzbin.info/www/bejne/fGPbpaWJaN2GgtE this is the complete tutorial
@MaTlaBAdda
@MaTlaBAdda 3 ай бұрын
but how does the receiver will know, that it has received a message, you will have to search in all the documents in message collection, don't you think, that is cumbersome?
@dbestech
@dbestech 3 ай бұрын
firestore auto updates new messages. You don't need to search anything. You need to use StreamBuilder in the frontend
@MaTlaBAdda
@MaTlaBAdda 3 ай бұрын
@@dbestech I found a better way to create a chatroom between two users, without any extra read and write operations in the cloud firestore
@user-kb3dd3nb6k
@user-kb3dd3nb6k Жыл бұрын
Hello. Tell me what the theme in yours IDE. Thank you.
@wilsontoussile519
@wilsontoussile519 Жыл бұрын
Hello and 🙏. User id seems to differ from user uid. How to get that id. It that id unic?
@dbestech
@dbestech Жыл бұрын
Can you tell me the time line? we are using id as uid if you see the database structure
@zakariyedaauud5527
@zakariyedaauud5527 Жыл бұрын
Thank sir
@dbestech
@dbestech Жыл бұрын
You are welcome
@MaTlaBAdda
@MaTlaBAdda 3 ай бұрын
bhai github ka link bhi daal dete, garibo ki madad ho jati
@dbestech
@dbestech 3 ай бұрын
Brother, I don't speak hindi
@MaTlaBAdda
@MaTlaBAdda 3 ай бұрын
@@dbestech I am saying, please insert github link for the code, it would be helpful
@mariyananjelo2948
@mariyananjelo2948 Жыл бұрын
Where is the coding?
@peshawaamin3083
@peshawaamin3083 Жыл бұрын
❤️❤️
@deepeshv.p4179
@deepeshv.p4179 Жыл бұрын
Sir plz give ur github link
@Qoor1994
@Qoor1994 2 ай бұрын
This video is clearly about learning about the database model not having a source code. I would prefer learn a concept from this video and do it on your own rather than just copying and pasting.
@OmranMosa
@OmranMosa 7 ай бұрын
source code
@dbestech
@dbestech 7 ай бұрын
You may consider buying the source code which will help you and me more
@OmranMosa
@OmranMosa 7 ай бұрын
source code 😮
@dbestech
@dbestech 7 ай бұрын
You may consider buying the source and get free access to the course.
@OmranMosa
@OmranMosa 7 ай бұрын
@@dbestech Resolved for free 😆 thank u
Collection Group Queries in Firestore
8:19
Fireship
Рет қаралды 88 М.
白天使选错惹黑天使生气。#天使 #小丑女
00:31
天使夫妇
Рет қаралды 15 МЛН
When you discover a family secret
00:59
im_siowei
Рет қаралды 22 МЛН
Get 10 Mega Boxes OR 60 Starr Drops!!
01:39
Brawl Stars
Рет қаралды 19 МЛН
Blue Food VS Red Food Emoji Mukbang
00:33
MOOMOO STUDIO [무무 스튜디오]
Рет қаралды 20 МЛН
Firestore Data Modeling - Five Cool Techniques
11:44
Fireship
Рет қаралды 255 М.
Build an AI Chat App With Gemini (Android Tutorial)
48:11
Ahmed Guedmioui
Рет қаралды 11 М.
Cloud Firestore Data Modeling (Google I/O'19)
40:37
Firebase
Рет қаралды 172 М.
How to Structure Your Data | Get to know Cloud Firestore #5
13:57
No Code App Development is a Trap
9:31
Coding with Dee
Рет қаралды 223 М.
Flutter Basics by a REAL Project
25:42
Flutter Guys
Рет қаралды 460 М.
Database Structure for Messaging Application
10:58
TechMan
Рет қаралды 34 М.
Database Design for Chat Application
10:01
Database Star
Рет қаралды 62 М.
白天使选错惹黑天使生气。#天使 #小丑女
00:31
天使夫妇
Рет қаралды 15 МЛН