Firestore Megachat - Let's Build a Chat App

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

Just a heads up... Megachat has been taken down temporarily because we exceeded the free limits of Firestore. This is a result of a user spamming writes to the DB, which has inspired a future video about preventing this type of issue.

Fireship
Автор

The opening song of your video is always appealing that makes me enjoy video even more!

deltav
Автор

This is a great solution. Lets face it, a doc for each message is a great way to do it, but 99% of the time you won't need the functionality you are missing out by doing it this way. I'm trying to solve a much bigger problem than this on my app across multiple chats and you've absolutely obliterated the problem and I THINK cut the costs of running my project. I would suggest that you use firebase to set your timestamp, doing it client side can cause all kinds of problems as a user can essentially insert chat messages anywhere they want if you're sorting with your client side timestamp. It would be great if like the other approach you could add an ID to each chat message, that way you could target that message for editing or read receipts. Then again, you could have another field in the doc for read receipts and just update it with a timestamp of when the doc was viewed, then every message that has a server timestamp after it will be marked as read! Just wondering, is it possible to get the file size of a doc in that cloud function? Rather than saying 'after 50 messages', you could just weigh the file and trigger the function if it's 5% off the limit or something? Also, you've now given me a super simple solution to pagination when that cloud function fires. You can just increment a backup doc by 1.

Thank you for this, I've been contemplating how to resolve my issue for a while now and you've inspired a few new ideas!

ockenden
Автор

I’m building a chat app to play and learn firebase :) This is just in time to help :) Thanks

mvvbuch
Автор

Awesome! Going to have a talk about firebase and will use this as my sample.

wobsoriano
Автор

Honestly dude, I'm impressed with your channel and you website overall. Most of the tutorial out there just show how to do basic thins like a todo list, but you take it father and literally show us how to do things that we are going to be used in the real word. Thank so much!! I just did 4 tutorials of yours in the past 3 days and I know my money would be worth for buying the pro membership of your channel. Do you have any student discounts?

patriciovargas
Автор

Great video! Can't wait for a real-time Google maps + firestore tracking app.

zvikarp
Автор

Getting my head around why didn't used the first approach. "the drawback you need to execute a document read for every message on the UI". Why don't just execute a query to get all messages. Even could limit with a Where case and get only the latest using a timestamp?

PureAlbania
Автор

What about billing? This will create many document writes that will increase the cost of the bill?

FarryEntertainment
Автор

i probably picked up a few tricks from this video! you're amazing!

josephsteve
Автор

I love this approach all my cloud function issue is fixed because of statement you made thanks men

will_abule
Автор

Nice job, keep on going. I like how you build on earlier vids :)

zozo
Автор

Thanks Jeff and very nice tips on rxjs especially when it comes to nested subscriptions 👍👍

salahalhaddabi
Автор

as always.. brevity is what I like about your videos...

jafar
Автор

Another really solid video. Had to sign up for a pro membership. Thanks for all the hard work Jeff!

troythompson
Автор

You gotta be careful using this structure because you also pay for egress traffic. Think about it: if the chat reaches 1MB (which it will if it's a very used chat app), then each new user will download 1MB. That'll quickly reach the GBs of download, which then becomes more expensive than paying for the individual reads/writes.

professorhuert
Автор

The issue with this approach is that partial documents aren't read in firebase. So each time the document is updated, the whole document will need to be downloaded for each user that is currently online and chatting. The network egress cost could be more or less equal to what this approach is trying to save.

A possible solution for that would be to use this approach along with a webrtc based text chat. The currently online users will get updated p2p while the users that come later will load the last 100 messages in one lump sum document.

I haven't tried this yet, so I am not sure what the cist diff would be. But it makes sense in my head. What do you think?

gautamsjain
Автор

every playlist of your video can connected one between one(little bit rxjs,

saravananr
Автор

Amazing content. Thanks a lot and Keep it up.

rajneesh
Автор

Thanks :) Can you make tut on Ionic chat app

shashank