Firebase - Multi Path Updates or Cloud Function Listeners

After watching a lot of YouTube videos, it looks like Google is in favor of multipath updates when data stored in multiple locations changes, however, the more I confused with cloud-based features, the bigger they look and even more viable as they might just sit in the back and listen to changes in a specific link and push changes as needed to other links in real time. Does it make sense to follow this route? Just wondering why Google doesn't recommend them for this use case.

+3


source to share


1 answer


UPDATE NEWER: Literally when I was writing this, I got an answer from Google for my questions. It is too late to reverse the direction of our applications at this point, but it might be useful for someone else.

If your function doesn't return a value, the server doesn't know how long to wait before discarding it and ending it. I would quickly guess that this might be the reason why DB calls are not being called.

Note that since it DatabaseReference.set()

returns a promise, you can simply return it if you like.

Alternatively, you can add .catch()

and log output to check that the set()

op does not fail.

~ firebase-support@google.com

UPDATE: My experience with cloud features over the last month or so has been kind of a love hate. A lot of our denormalized data relied on cloud functionality to keep everything in sync. Unfortunately (it was a bad idea from the beginning) we were dealing with transactional / monetary data and storage, which was inconvenient in several areas. When we had problems with cloud functions i.e. Doing them in a DB listener was not 100% reliable, we knew Firebase would not work, at least for our transaction data.



Overall the concept is amazing. They work surprisingly well when they fire, but due to some inconsistencies in how they are run, they are not robust enough for our use case.

We currently use SQL for our transactional data and then store user data and other objects that need to be maintained in real time in Firebase. This has worked very well for us so far.

0


source







All Articles