Thank you for the kind words, Cindy! We're happy to hear you enjoyed this 🙂
@zackarybrumfield22 жыл бұрын
This man NEVER needs to be replaced.
@jace10374 жыл бұрын
Cloud functions are also a great way to hide privileged API keys from clients. Your client makes a request to the cloud function, your cloud function then verifies the client and user and formats a request to a 3rd party service using credentials that you want to keep hidden from clients.
@averagehelper4 жыл бұрын
It’s a joy working with Cloud Functions. We use them all the time in my company’s projects, and it’s been great to keep our Firestore rules manageable. And when things go wrong 😅 it’s super easy to publish a fix so all of our clients can start using the new code almost immediately.
@blocky36642 жыл бұрын
His stickers on his laptop are fabulous
@codinginflow4 жыл бұрын
Thank you Firebae
@AkhilKumar-ys3ph4 жыл бұрын
What are the big websites that are using cloud firestore as a backend?
@lukecross54393 жыл бұрын
@@AkhilKumar-ys3ph Big? None, the big websites are currently using AWS or Azure with other SaaS
@_mono4 жыл бұрын
0:48 #1 Simplifying security rules 4:55 #2 Syncing denormalized data 7:30 #3 Routine maintenance 9:40 #4 Running on top of a legacy database 14:00 #5 Build a custom API
@leeboyin9454 жыл бұрын
Thank you
@connorflewitt83772 жыл бұрын
How do I know this wasn't done by a cloud function?
@overnightmares3 жыл бұрын
I wish I could work with this guy one day. He explains things so clearly. He seems like he can be a very good mentor.
@kevinkumar35204 жыл бұрын
We need a video about caching. I as a beginner struggle a lot to figure out how you can save reads of data which is constantly queried. Thanks for the other tutorials tho, which helped a lot
@cristianberroeta98664 жыл бұрын
There are great patterns and ideas about Cloud Funtions in the video Todd, thanks! I'm also using Cloud Functions to: - populate my Firestore database (with some constants), and - to apply Firestore "schema" (or data) migrations consistently across multiple environments (development, staging, and production). That also allows me to easily have the migration documented, as the Cloud Function file is included in the project's git repository
@davidstackio4 жыл бұрын
How are you triggering the migration functions? I'm hoping to do the same for database "schema" updates
@cristianberroeta98664 жыл бұрын
@@davidstackio , I'm glad that you've replied, because I'm just starting to use Cloud Functions for this Firestore migrations use case that I mentioned above, in an app that is not yet published. And in fact, I'm also wondering what would be the best triggering method. Here is the hacky technique that I'm using: This is how my migration Firebase Functions start: exports = module.exports = functions.firestore.document('thisCollectionShouldNotBeCreatedEver/{docId}') .onWrite(async (change, context) => { So it is a Cloud Function that can be triggered by a Firestore document write. However, I never write into that collection. Instead, I use the GCP console to manually trigger it. I go to the Cloud Functions section, press on my migration Cloud Function, then go to the Testing tab and press the "Test the function" button. Hopefully someone will recommend a better way
@davidstackio4 жыл бұрын
@@cristianberroeta9866 ah, so just using the console then. Simple, but effective. What about using a callable function that loops through all the documents that need to be changed?
@cristianberroeta98664 жыл бұрын
@@davidstackio I think that a callable function could also be used. You would have to: - create the UI for calling the callable function - make sure that only authorized users are allowed to trigger the migration. Any user can call a callable function, so you would have to stop them (if they are not a person that you have given the permission to) before triggering the migration in your code. For instance, inside the callable function you could get the caller user's email, and compare it to the authorized user email. Only if they are the same, the code would continue to apply the migration
@sutikshnadubey3 жыл бұрын
Keep those humor snippets coming. We developers are sad lot, we need them :)
@dylanking000archive2 жыл бұрын
thanks so much for this series
@EstebanCodes4 жыл бұрын
I've use cloud functions to setup an admin api to my dashboard app (the app that controls my real client app) that can query and write everything without worrying about security rules
@AkhilKumar-ys3ph4 жыл бұрын
What are the big websites that are using cloud firestore as a backend
@lalalarara92094 жыл бұрын
already exciting
@Ondal14 жыл бұрын
Still missing a good tutorial on testing cloud functions locally using the emulator. In former videos Google has suggested TypeScript as the preferred way of creating cloud functions, but all examples and semi-tutorials seem to be plain javascript. My direct problem is testing indirect changes, where a function updates another collection. For instance a user updating their name, and this has an effect on review names as in the restaurant on going domain.
@rubenheymans19884 жыл бұрын
Yeah so many plain js examples, and the new extensions code is also plain js, doesn't make any sense
@rubenheymans19884 жыл бұрын
This video is awesome! Learned a lot, got some work flows confirmed, thanks!
@QuangCôngLê-y7v Жыл бұрын
Great series! Thanks Todd
@fredericrebel4 жыл бұрын
Would add that having multiple triggers available for a CF is very usefull to ensure Correctness. As it became very straightforward/easy to schedule/run Correctness check batches against same code used by our front-end
@rubenheymans19884 жыл бұрын
A video on multi tenancy would be nice too 😊
@ValAllenSamonte4 жыл бұрын
is multi tenancy with hosting now possible? darn i just wish we can have dynamic subdomains.
@rubenheymans19884 жыл бұрын
@@ValAllenSamonte yes it should be possible, I'm going to implement it for my app I'm working on soon. At this point I just have no idea how the auth flow will work
@rubenheymans19884 жыл бұрын
@@ValAllenSamonte dynamic subdomains would be nice too
@ValAllenSamonte4 жыл бұрын
@@rubenheymans1988 cool! was actually thinking of auth as well, but yeah re. auth, they offer custom JWT tokens anyway so it really is possible.
@davidstackio4 жыл бұрын
I'm trying to set this up too. I've opted to go with creating one project per tenant. So more like "multi-single-tenant". Managing all the projects will be a pain, but I'm thinking of building out a management console (as another project) to orchestrate all of them
@puruvijay61854 жыл бұрын
That laptop skin is from Spirited Away!! You are awesome Todd Kerpelman
@ijneklim4 жыл бұрын
I'm using cloud functions to detect doc change to perform certain operations. But it seems the cloud functions miss some of the operation due to high numbers of invocations. I doubt the reliability of cloud functions... 🤔
@craftrobot4 жыл бұрын
So genuinely grateful
@abdonasr12224 жыл бұрын
back with a Great video!! Thanks Todd 2020
@Tettoffensive4 жыл бұрын
One issue that I've run into with using cloud functions for denormalized data is that I still end up having to make changes in my write function on the client to keep certain data in sync that is visible to the user. Otherwise, it can look like whatever the change the user made was not successful until the cloud function syncs all the data back up and the client fetches the new data. Are there any strategies for dealing with this in a clean way? I feel like I end up with a lot of spaghetti code keeping everything in sync.
@ayyappaj81114 жыл бұрын
He is back to form!!!
@hadifromlebanon38124 жыл бұрын
You help more than compilers do
@ShivamJha003 жыл бұрын
LoL what
@nataliayarysheva7316 Жыл бұрын
cool laptop skin from Spiritted away :D
@Squad2ND8 ай бұрын
Is there a reason to "hide" all implementation details behind a Cloud Function? E.g. read from Firestore. But if I do this, I say Good Bye to any offline capabilities?
@hawarhekmat11744 жыл бұрын
I live cloud functions but can not understand admin sdk or client sdk I used https request and call request I love it so much wish you can make a video how to use them I am new to firebase and love it
@TheMateusrex4 жыл бұрын
Great video! Hilarious, informative, and useful.
@chased_productions Жыл бұрын
2:28 I don't understand. I have to make a new database entry every time a player makes a move? Wouldn't I soon have a million documents with arbitrary player move data that will never be used again?
@rafaelfreitastrad97464 жыл бұрын
Awesome video, as usual xD
@leonardopillay42004 жыл бұрын
Absolutely love firebase. Is there a way to efficiently detect if a user interacted with a document. e.g liked a post, watched a video etc. I know that there a 20k field limit in a document so storing the ids of the documents and checking them on the fly seems inefficient and created render issues when scrolling a feed for instance.
@sebastiandaza98263 жыл бұрын
Hi great videos, i've a question if i use the admin sdk inside cloud functions to create or update document, is cloud functions runs ? or in the same way as the rules the admin sdk ignore it
@L1nkk9E3 жыл бұрын
oof, half abandoned dreams hit hard :D
@jackdbd4 жыл бұрын
I have a question regarding the scenario described at 4:55. Let's say that all I need from the review's author comes from the claims in the JWT issued by Firebase Auth. In that case, any update to the user's profile (i.e. the user's profile at the federated identity provider) would trigger firebase.auth().onAuthStateChange(), so any UI component would automatically update if it takes the review's author from firebase.auth().currentUser Would this be enough to avoid the whole cloud function de-normalization shebang?
@Balamurugan-rr3is4 жыл бұрын
Sir, I have a one doubt please clear to me... We have create a Android Application backend database is firebase...how to buy a fribase hosting or any other hosting are using in firebase??? Please help me sir we are upload a Android project to playstore but we dont have host and we dont know how to buy host...
@ibearua10524 жыл бұрын
though unrelated to the above vdeo, i have a current challenge of counting a number of documents of about 300k No. in a single collection, good news is that all the suggestion i had seen suggest maintaining a counter field or using fieldValue is a separate collection that keep track of the each write (or maybe read) in the previous collection, bad news however, is that i had never implemented that. my question is there any work around to get the total of the documents(300k) using cloud functions?
@dhanniekristanto4 жыл бұрын
what is the best practice for the database structure, to have a calculated field in your database or do the calculation on the client side? e.g total sum of numbers.
@jace10374 жыл бұрын
If it's something that you want to be accurate you can't trust the client to do it. Take for example gold in a game. If the client were to add up the gold a clever player could exploit it and give themselves endless in game gold.
@karlwheeler90764 жыл бұрын
I keep getting a DEADLINE_EXCEEDED error from my firebase function. What does this mean?
@KonesThe2 жыл бұрын
Hello, so I've got a question. I have no experience with Databases and I want to run a sensor with a SIM module to communicate with the Realtime Database. With Cloud Functions I want to update the Firestore Database, for every entry on the Realtime Database. I have also an App that will read the information from the Firestore Database. As a starting point, I will only have one client sending data to the Realtime Database, but hopefully this will increase when we sell more of these systems. Will increasing the number of clients present any issue with Cloud Functions? Or will it be able to handle this without an issue. Also, if you guys have any pointers on where to start, I would really appreciate it. I'm fairly new with Firebase and DBs. so I'm watching all the videos and reading documentation to get a feel for it. Like I know I'll probably have to learn TS as well.
@HoussamElbadissi Жыл бұрын
I guess that would be okay, given that Cloud Functions, at least from what I understand, are made to be called very frequently and scale effortlessly with your userbase (and hence, database). As for getting started, start from whatever language/platform you'll be using on these devices (make sure it's one with a client-side API), and start with the official docs, to make some simple programs in your computer that contact the database and experiment with reads, writes, and more (in both Realtime and Firestore Databases). You can then try experimenting with Cloud Functions to apply some conversions, sync data between Realtime and Firestore Database, and make sure they work as intended, and don't go above your expectations when it comes to pricing. After this warm up, you can get started with building the actual code that'll live on these systems, testing it from your computer with dummy data, then wiring things up and putting it in the devices themselves. Assuming these are meant to be always connected, it would be great if they could self-update to accommodate any changes you might need to make later on. On the mobile end, you could do the same process as above. Test the APIs and listeners available in the client libraries, build your security rules, and then write and extensively test the actual production code for any security issues. This is a VERY broad "pointer" here, but I hope it can clear things up a bit! (although it's been 7 months now..) This is a really interesting use case, wish you luck!
@ExtraServingsBTS3 жыл бұрын
Some code for denormalizing data in functions would be most appreciated.
@akashkv414 жыл бұрын
I have created app with newsfeed and chat.I want to create user following and unfollow.how can i do this with firestore?
@michelkant4 жыл бұрын
Hey! Great video. I saw a reply by someone mentioning hiding api keys by leveraging cloud functions. Which solves for that problem when communicating externally. 👍 I do am very interested in your advice with pubsub. Would you rather have chains of functions communicate through the pubsub api by chaining them via push, a pubsub listener function or not at all and have the functions communicate directly with each other? I am also starting to wonder about the need for subcollections at all 🤔 based on your series I'm getting more and more into just redoing my whole setup to work with only a bunch of main collections, filtering it down with proper queries, security rules and have some functions to act on changes there. Instead of clients as master collection with the same sub sub sub collection structure. Last one, would you recommend building an external facing api with auth and all with/on firebase or rather leverage cloud run? I'd love to see a short series on this if you'd use firebase for it.
@FrankMartinez-uo5yh Жыл бұрын
6:35 🎉
@archit76064 жыл бұрын
Need more practical sessions firebase team
@wilmerramirez36314 жыл бұрын
Hello Everyone! how Can I format text that is stored on a firestore collection... I am rendering some posts which contains properties such as Title, description, content, etc via mapping them on my component but when I render content for example it just display the whole text with the same format... I would like to be able to insert some styling to some sections of that text... I'd appreciate your help.
@eric-ampire4 жыл бұрын
Cloud Function it's very interesting 🎉🙏
@voraponwadsoi34824 жыл бұрын
How to get collection id for web ?
@rubenheymans19884 жыл бұрын
I use createId to create a uid on the client, add a property uid to the object. Update the doc in the collection with that uid. Now everytime I fetch the collection, all my docs have the uid as a property
@voraponwadsoi34824 жыл бұрын
@@rubenheymans1988 thank you. I'll try it.
@1teamrealtors4 жыл бұрын
@@rubenheymans1988 Bad idea.
@tilakmadichettitheappdeveloper4 жыл бұрын
1 thing firebase sucks at: auto complete text search it really doesn't make sense to go for algolia a third party service becoz its such a basic feature we all expect to get it natively In firebase
@damiangowala56814 жыл бұрын
I really wish there was a feature resembling Firestore Security Rules, but filtering the data instead. Having three user groups with different privileges wishing to access the same document (with all the benefits of a real-time listener), currently there is no way to pass only the chosen fields of the document instead of the whole one. There are so many use cases I have for this feature and cloud functions aren't really a solution here - no real-time support + cold start latency negatively impacting the user experience. Security Rules with direct database querying filters would be an amazing and powerful combination.
@CoderBhavy4 жыл бұрын
i have error in firebase cli login error in CMD
@markgoho4 жыл бұрын
that got dark 😂😂😂
@CoderBhavy4 жыл бұрын
Hello
@dharmarajr244 жыл бұрын
37 hours more -_+
@sexyeur4 жыл бұрын
AWESOME! Thank you!!!
@dominikfrackowiak51703 жыл бұрын
Hello everyone, I need to sort data stored in a collection by the frequency of the occurrence of the words from that data and then send it to my front-end in a form of an array of, let's say 20, most commonly used words. How can I force firebase to do that for me ;) ? Thank you in advance for any tip.
@mehulbisht97084 жыл бұрын
what an awesome session ! enjoyed it with Todd in live chat !