How do I Enable Offline Support? | Get to know Cloud Firestore #9

  Рет қаралды 101,205

Firebase

Firebase

Күн бұрын

Пікірлер: 112
@immortaleternal5125
@immortaleternal5125 5 жыл бұрын
Really had me there with the buffering, almost contacted my ISP.
@leeboyin945
@leeboyin945 4 жыл бұрын
01:11 What it means when you go into offline mode? 01:45 Read data 04:30 Write data *Questions* 07:00 How large of a cache do we actually keep to store all that offline data? 08:33 Why are you seeing a lot of duplicate data calls? 09:55 What's up with the web, why isn't offline mode enabled by default? *Gotcha* 11:13 With document writes, the callback to a document doesn't get called until the write has actually been confirmed on the server. 12:14 Transactions will fail when you're offline. 12:42 On the cache right now, there are no indexes.
@AleXoTroN
@AleXoTroN 5 жыл бұрын
The buffering part was nice😂💪🏼
@TawfekDaghistani
@TawfekDaghistani 5 жыл бұрын
it tricked me successfully :D
@kewaldangal8750
@kewaldangal8750 3 жыл бұрын
Thank you
@rumahbejo
@rumahbejo 10 ай бұрын
lol i think i lost my connection
@codinginflow
@codinginflow 4 жыл бұрын
Success listeners for write operations not getting called while offline is indeed tricky. I'm glad I heard that here because I had some places where it broke my offline functionality.
@kirill4531
@kirill4531 5 жыл бұрын
The best "documentation" on a library ever :)
@bennyswayofficial
@bennyswayofficial 3 жыл бұрын
Most people who searched for this video about billing, your answer is here: 13:15. Yesm we are devs, we think like this, and yes we would provide a bad user experience for the app to bill us less :)
@JakeCrawfordOfficial
@JakeCrawfordOfficial 5 жыл бұрын
Best intro ever in a tutorial video 😂
@wesleybarnes5376
@wesleybarnes5376 4 жыл бұрын
This is so cool. I don't have to go and setup a local db, try and sync it with a server (so much work) ,and this works by default! Turned on flight mode and the magic happens.. and I did not even know about this feature.. Respect!
@brialcorp8448
@brialcorp8448 4 жыл бұрын
Not just the buffering part was nice, but the overall video is helpful. When the video was buffering(for real) for the second time, you got me there also.
@ARITRAMUKHERJEEjan1989
@ARITRAMUKHERJEEjan1989 5 жыл бұрын
The buffering part was lit btw great content as usual
@ericharrison4583
@ericharrison4583 4 жыл бұрын
You are really good at your job.
@KelvinWKiger
@KelvinWKiger 5 жыл бұрын
To avoid the "last write win" from the conflict resolution, you talked about security rules and cloud function.. I guess "transaction" can also do the work right ? I look forward your blog post on that.
@amrojjeh
@amrojjeh Жыл бұрын
Transactions would just fail since data has to be up to date
@codinginflow
@codinginflow 5 жыл бұрын
I love the humor 😂
@arpitanand6534
@arpitanand6534 4 жыл бұрын
@@SimplifyUE true
@codinginflow
@codinginflow 4 жыл бұрын
Thank you guys 💚
@PeterBernardin
@PeterBernardin 3 жыл бұрын
This is absolutely hilarious... I wish all tutorials were like this
@kenargo
@kenargo 3 жыл бұрын
The one thing about offline support is that it's much harder to debug (especially security rules). I've reverted to adding await() call so that errors are seen as exceptions otherwise I haven't found a way to see runtime errors in the debugger, they just silently fail
@mariolopes6262
@mariolopes6262 5 жыл бұрын
incredible. there is no miracle, but this offline technology is close to heaven.
@HaizadAnnuar
@HaizadAnnuar 2 жыл бұрын
My question would be can Firestore detect which data should be applied first after the offline data gets sync if the device's clock is incorrect when the offline data was stored on the device?
@jibin2706
@jibin2706 2 жыл бұрын
The entire series is so informative & funny :)
@theincompletecircle
@theincompletecircle 5 жыл бұрын
For get we have an option to fetch only from server. Why is it not possible to do the same for real-time onSnapshot listener? There are a couple of places where query is extremely slow for me because of caching and speed is way more important for me in those cases. Please add this option because I get a lot of complains regarding speed and it's not possible for me to disable caching because offline writes are very important for my app.
@KelvinWKiger
@KelvinWKiger 5 жыл бұрын
Does a query against the cached data cost money?
@matsid007
@matsid007 5 жыл бұрын
No
@Nikon1101
@Nikon1101 5 жыл бұрын
Thanks a lot for a great playlist of lessons! Real pleasure to watch, listen and study
@bitwisedevs469
@bitwisedevs469 5 жыл бұрын
Pending writes work only on delete() in my android app, calling set() doesnt do anything when I get back online. Can someone explain to me what should I do.
@trieunguyen336
@trieunguyen336 5 жыл бұрын
Really thank you!!! I wish there would be many mini-projects as examples for what you presented in Kotlin. As a beginner of Firestore, all 9 videos are too much information for me. I did try Friendly Eat Codelab, but got stucked at displaying data from Firestore.
@AzMahgs
@AzMahgs 3 жыл бұрын
I just needed content. But you gave me quality and entertainment
@caseywest7369
@caseywest7369 2 жыл бұрын
Is this offline supported for Flutter Desktop apps? Specifically Windows?
@axelpehl
@axelpehl Жыл бұрын
This is exactly the Information i Need as well. Anyone got the answer to this?
@caseywest7369
@caseywest7369 Жыл бұрын
For me it the answer was to not use Firebase haha. Used Supabase with SQLite for the local instance. Been working flawlessly, it is just Postgres and not a document based db. @@axelpehl
@factual01495
@factual01495 4 жыл бұрын
Really had me on the buffering part 👍👍
@leonardosibela
@leonardosibela 5 жыл бұрын
At 5:45, ... says that the data is synced when the user gets back online. That's not neccesarily true. In my recent tests, the app needs to be open and, apparently, the there must be an socket open or something. Anyone has an exactly answer to this?
@amankataria4609
@amankataria4609 5 жыл бұрын
I have a complex transaction with my database when it's offline, so I am using SQFLITE package, and I plan to use Firebase as an online database. If I create a sync method between these databases when there is internet connection, is it alright?
@tomasfilip984
@tomasfilip984 5 жыл бұрын
Waiting for unity offline support. Intended to be supported?
@kanundash
@kanundash 3 жыл бұрын
I love that loading buffer joke!
@saim6616
@saim6616 4 жыл бұрын
We have a Chat app (Android) developed based on firebase (Real time database) cloud. Currently chat history was coming only when we are in online, when we don't have internet it was showing blank. For getting the chat history in offline did we have develop any additional code in android app or simply we have to enable the offline mode option.
@amankataria4609
@amankataria4609 5 жыл бұрын
One more question, in my Firebase database, I have a document of my customers who have purchased items from me. And in the document's fields, I have various maps of different items. Now all these maps have "price" as one of the fields (field in maps), If I want to total of price all items(which are in form of a map in 1 document, is it possible? If no, what's the alternative? NOTE:1) Kindly assume I can't save these items as separate documents 2) The map has many fields
@abdurrosyidh
@abdurrosyidh 5 жыл бұрын
Aman Kataria store the total price in 1 separate property..
@pradeepc8838
@pradeepc8838 2 жыл бұрын
Hey, how to cache a stream of videos from firestore and then retrieve them, so that the videos don't buffer in flutter. For an app like tiktok.
@xyaless
@xyaless 5 жыл бұрын
Is it a viable strategy to use Caching to reduce the amount of Reads? Im trying reduce the amount of reads by enforcing document reads from the cache instead of listening to valueChanges/get requests to the Server. So what im trying to do is, - i have a fieldValue that is called 'lastEdit': 'Server Timestamp' (Server Timestamp for consistency) in all my Documents. I first query all my *cache* documents that im about to read from the server, and get the latest Server Timestamp(cache) and give that value as a variable to the function that checks if there are any documents that have a higher lastEdit than the one in the cache, if yes then i get them, which should automatically update my query to the newest documents and only read the minimum of necessary documents. Im not really sure if this is viable so i would like to hear some opinions. (I suppose it is already automated (a feature of firestore - to only get what is needed) but its not working quite well on my side? For example: I have a collection with 10 Docs, i go to the side where the docs are loaded for the first time => 10 reads, i add a new doc => 1 read, because of subscription, now i to the same site but (a different window?) settings and then back to the now 11 Docs => 11 reads, (Im kind of expecting that it would only charge me for reads when i read them for the first time or there are some changes and not for everytime i visit the page... (too costy to host when it reaches the amount of 800 documents (default amount)))
@lucasaraujo6.
@lucasaraujo6. 2 жыл бұрын
Is it possible upload data and read it while offline? I mean before conect to internet.
@kamaleshbasu3755
@kamaleshbasu3755 4 жыл бұрын
Great video. Does Realtime Database provide similar "auto caching" and "fetch only on change" features? Or is it only possible with FireStore?
@ezscootrr
@ezscootrr 4 жыл бұрын
Same question. My app is new and I'm thinking if I should switch to Firestore
@YoussefARRASSEN
@YoussefARRASSEN 3 жыл бұрын
5:27: it generally takes a few thousand writes, are you challenging me?
4 жыл бұрын
I'm not expecting an answer, but will ask the question anyway in the hope I will. I'm making an app where I want data to be available online and offline. That means I will have to have database on the device as well. And if the user goes online, then data gets updated on the firestore server automatically and across connected devices. But this will include files such as images, possibly videos and strings. So do I need to create ROOM database and somehow synchronise it with firestore? Or there is a way I can Implement this with firestore? Thanks.
@vrajendramandloi5917
@vrajendramandloi5917 4 жыл бұрын
hi, can you plz explain caching and how can that reduce my read cost ?? i have my website which is hosted on firebase , but a lot of users are viewing my website not buying much, for that i need caching at server of all docs and providing users a specific list of Docs only. Thanks great job ..
@8Kexperience
@8Kexperience 4 жыл бұрын
what about firebase cloud-storage offline support? My quick Google searches does not say anything about it.
@8Kexperience
@8Kexperience 4 жыл бұрын
@UCZ0SEPZzWkA2rSlxMfTUI_w awesome thank you!!!
@SyedKumailHaiderNaqvi
@SyedKumailHaiderNaqvi 4 жыл бұрын
If the data online is the same as offline cached data, and we perform read operations, do we still cost for the reads?
@vishalgaurav4411
@vishalgaurav4411 4 жыл бұрын
If I am fetching the same document again and again and it has not changed, will it cost me a one read everytime? Or will it use the local cache. I am on Android
@yonit.chauhan
@yonit.chauhan 4 жыл бұрын
How long are offline write requests saved in cache? 6:33 what if user is offline for several days (>7) and performs a write on day 1, will it still be uploaded on the 7th day(when the user is back online)
@wesleybarnes5376
@wesleybarnes5376 4 жыл бұрын
I'm sure it will work
@mavinis
@mavinis 2 жыл бұрын
So I'm developing an app with Flutter and Firebase, and I created a repository to manage local and remote data, and I'm using SharedPreferences to store data locally, and I created Streams to deliver local and remote data to the UI, and everytime I get some data from firestore I am saving it with SharedPreferences. And then I find this video. Are you telling me that firestore already does all of that automatically?
@DenisTRUFFAUT
@DenisTRUFFAUT 5 жыл бұрын
Excellent video, with very interesting use cases !
@mojikashani2545
@mojikashani2545 4 жыл бұрын
Love the guy!💕 google please make interesting tutorials for us. That's true we have to watch these videos, but shouldn't have we fun!?😉
@iancuvlad7368
@iancuvlad7368 4 жыл бұрын
Does Cloud Storage have a similar offline persistence mechanism, or it's just available for Cloud Firestore?
@vhoyer
@vhoyer 4 жыл бұрын
how do I disable offline mode on web? If I put one of those toggles for the user to choose if he/she wants or not to enable persistence, if this toggle is set to false, how do I turn the percistence off? is there a `disablePercistence()`?
@xixixiaojie
@xixixiaojie 2 жыл бұрын
Great video! Please does this also work for images? Writing an image to the Firestore while offline, displays the "cached" image then uploads to the Firestore when there's connection. Is this possible?
@Frank_van_Puffelen
@Frank_van_Puffelen 2 жыл бұрын
*firebaser here* That's definitely possible, and would already work for images that you store in Firestore. I wouldn't recommend storing images there though as they'd count against your global cache size there, and honestly there are better places to store images. For example, storing the images in Cloud Storage will be much cheaper, and it also comes with a Firebase SDK. If you store the images there they won't be cached on devices by default, but there are great caching libraries for all platforms too. Also check out this video where Todd and Susan explain offline behavior and strategies for all Firebase products: kzbin.info/www/bejne/jqPPpYNul7R7ipI
@kristianczepluch6147
@kristianczepluch6147 5 жыл бұрын
Does this unlimited cache when writing also apply to the firebase realtime database?
@KelvinWKiger
@KelvinWKiger 5 жыл бұрын
Haha.. Love the intro!
@jozce311
@jozce311 5 жыл бұрын
This might be an odd use case, but is this feature not available for node applications?
@croydon21H
@croydon21H Жыл бұрын
How can I try this? Is there an example? lets say my code is let query = store.collection("products"); const querySnapshot = await query.get(); How can I use cache or reduce number of reads ?
@mingzhu8093
@mingzhu8093 2 жыл бұрын
Is there a way to lock a document? Say it marked completed the not more update can be done on it.
@Frank_van_Puffelen
@Frank_van_Puffelen 2 жыл бұрын
Nothing is built in for that, but you can roll your own by adding a field to each document that says that it's finalized locked and then reject any further writes in security rules.
@wandiledlamini1214
@wandiledlamini1214 3 жыл бұрын
LOL nice intro, I thought I lost connectivity there for a sec
@seccat
@seccat 2 жыл бұрын
"I'm sorry he needs to go on the plane with me. 💻 He is a licensed emotional support server" 🤣🤣😆
@andresmontoya7852
@andresmontoya7852 5 жыл бұрын
Thanks! Does it support react native with expo?
@jinwooseong2862
@jinwooseong2862 4 жыл бұрын
Thanks for Korean subtitle.
@MuhammadAdil7
@MuhammadAdil7 4 жыл бұрын
First of all I loved that buffering part honestly, and I thought it is my network :D Well I have a question, I have a document name "SeasonOne" and it has further sub documents "Episodes1,2,3....70" So each Episode has a title and Url. Well I have written a simple query and my persistent database is enabled. So whenever I will run the application is it going to make server call every time? I have internet enabled all the time. One more thing I want to clear that is I just fetch "SeasonOne" and it gives me list of sub-documents(episodes). Is it going to be counted 70+1 reads every time I open application? I have a terrible situation at the moment and I really wants the answer.
@codinginflow
@codinginflow 5 жыл бұрын
Reminder that there is a Firestore tutorial on my channel: kzbin.info/aero/PLrnPJCHvNZuDrSqu-dKdDi3Q6nM-VUyxD
@truongsa405
@truongsa405 3 жыл бұрын
Cannot use import statement outside a module import firebase from "firebase/compat/app"; import "firebase/compat/auth";
@icode7334
@icode7334 3 жыл бұрын
Great Video
@Firebase
@Firebase 3 жыл бұрын
Thanks!
@kevinwakhisi7001
@kevinwakhisi7001 4 жыл бұрын
Just liked the intro damn so creative
@martinalcala4823
@martinalcala4823 4 жыл бұрын
Reads from the cache data are billied?
@karannagpal2442
@karannagpal2442 5 жыл бұрын
Very well explained. Thank you!
@moayadkom
@moayadkom 5 жыл бұрын
Could you please make how to connect firebase with swiftui 5.1?
@DebmallyaBhattacharya
@DebmallyaBhattacharya 5 жыл бұрын
Love these videos. However, they're too fewer in quantity. Also, anybody tell you that you look like Robin Williams?
@leventkantaroglu7892
@leventkantaroglu7892 5 жыл бұрын
Thanks for explanation of this issue
@prasadjadhav3906
@prasadjadhav3906 2 жыл бұрын
You know it's gonna be a fun video when they break the 4th wall
@ngabarra
@ngabarra 5 жыл бұрын
Does the same logic apply to the Realtime Database?
@lukecross5439
@lukecross5439 4 жыл бұрын
No
@driziiD
@driziiD 3 жыл бұрын
him: "if you put your server in offline mode you have bigger problems" me: cries in network partitions and CAP theorem
@MarkRonnelCamilon
@MarkRonnelCamilon 5 жыл бұрын
how to implement offline support for flutter?
@macgera
@macgera 3 жыл бұрын
your documentation is not full. This video explain nothing. :/
@devashishbahri3353
@devashishbahri3353 4 жыл бұрын
"if you are putting your server on airplane mode, you might have bigger problems" 😂😂
@sonalithakker6517
@sonalithakker6517 4 жыл бұрын
The buffering 😂😂😂
@kewaldangal8750
@kewaldangal8750 3 жыл бұрын
Not link online payment system
@shakirkasmani
@shakirkasmani 4 жыл бұрын
How to enable it for flutter?
@wesleybarnes5376
@wesleybarnes5376 4 жыл бұрын
Works on my flutter app by default. I have listview builders that bring up 100's of records from cache without having to do anything. Pretty cool!
@wesleybarnes5376
@wesleybarnes5376 4 жыл бұрын
Note, these were done with FutureBuilder returning a ListView.builder
@heshansandeepa9471
@heshansandeepa9471 6 ай бұрын
awesome
@samuelpeterson9534
@samuelpeterson9534 4 жыл бұрын
Genius!
@oiojin831
@oiojin831 5 жыл бұрын
Finally!!!
@aminchigara2854
@aminchigara2854 5 жыл бұрын
You got me good
@KrullMaestaren
@KrullMaestaren 3 жыл бұрын
Watched this at a location with poor Wifi, totally fooled me xD
@lucienmendela7390
@lucienmendela7390 5 жыл бұрын
Imagine the life of a developer without firebase.
@creative-commons-videos
@creative-commons-videos 5 жыл бұрын
the only worst thing of firebase is Vendor Lock :)
@Suraj12123
@Suraj12123 2 жыл бұрын
😁
@zervidasmc
@zervidasmc 3 жыл бұрын
There is Indonesian
@BooleanDev
@BooleanDev 3 жыл бұрын
wow, the video lagged at the same time the rest of youtube wouldnt load
@matiasolguin6705
@matiasolguin6705 3 жыл бұрын
@mjonausk
@mjonausk 5 жыл бұрын
lolz
@rajaramanv
@rajaramanv Жыл бұрын
The cartoon animation figures are not amusing ! They are only distraction in a technical presentation like this.
@swap-codes
@swap-codes 8 ай бұрын
bhai tu thora dekisugi he kya?
@lordswaggity1213
@lordswaggity1213 5 жыл бұрын
Simple answer: You don't! 😝😝😝
To Realtime or Not?  | Get to know Cloud Firestore #10
11:44
Firebase
Рет қаралды 119 М.
How do Cloud Functions work? | Get to know Cloud Firestore #11
18:21
Интересно, какой он был в молодости
01:00
БЕЗУМНЫЙ СПОРТ
Рет қаралды 3,8 МЛН
Cat mode and a glass of water #family #humor #fun
00:22
Kotiki_Z
Рет қаралды 23 МЛН
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 13 МЛН
Don't Miss Out on the Gemini 2.0 AI Deep Research Breakthrough
5:17
Teacher's Tech
Рет қаралды 2,9 М.
100 Firebase Tips, Tricks, and Screw-ups
24:31
Fireship
Рет қаралды 191 М.
Advanced offline caching techniques in Cloud Firestore
12:34
Firebase
Рет қаралды 18 М.
No Code App Development is a Trap
9:31
Coding with Dee
Рет қаралды 328 М.
How Do I Paginate My Data? | Get to know Cloud Firestore #7
10:16
How do Transactions Work? | Get to know Cloud Firestore #8
16:10
Firestore Data Modeling - Five Cool Techniques
11:44
Fireship
Рет қаралды 259 М.
Using Firestore as a backend to your Flutter app
11:42
Google for Developers
Рет қаралды 527 М.