Masterclass Firebase for Flutter Apps

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
yes so we are right now also on YouTube live um I shared with you Frank in the chat um so thank you okay um yeah then I think we can start with the yeah yes so yeah hello flutter developers and welcome to this uh special live stream today so the first topic as you can see we have is building apps with flutter so basically we have Frank with us who will talk about Firebase yeah so welcome to this masterclass uh live stream Frank hey there everyone Yeah so basically we are having a Q&A session where we will be uh covering so many invaluable tips like that can potentially help you uh elevate your flutter development U yeah uh skills with Firebase and all the things like you'll learn uh how to uh make make your apps better with Firebase what kind of features you can Implement using Firebase all the things you will you you'll see so all right so without further Ado let's move to our I guess the first question uh we have already seen like we have prank so yeah the first question we have is um yeah what are the best practices to follow when using Firebase with flutter wow we're starting Broad I like that um and especially I'd like it that we do it at at the start of a master class um Firebase is a a pretty broad platform I would say right we we've been around since well since 2012 but um part of Google since 2014 so we're going on 10 years at Google and Firebase is a platform of backend Services right so you write your flutter app um but apps become more fun if if you have multiple users in the app Firebase has a set of services for that right and so we have an online database that you can access directly from your flter code and uh we we have an authentication Service that you can use for signin we have like file storage right so you can share images with each other and like there there's tons more features right press reporting Dynamic linking um app check which sure that abuse gets gets uh uh well definitely reduced we can't prevent it completely but there sponsor of these types of services and the best practice of course depend on the service right I I I wish I could give you one thing um honestly the one thing I can probably give you is read our documentation and our guidance right we have like lots of explanations of how to implement the service correctly and um for example right we have a checklist that uh that has like it's a checkl right like it has bullet points of things you should do before you publish the app and there's a pretty decent chance that a lot of like people who have Fus apps in in production never followed their checklist and it's like doesn't mean you did it wrong but the chances of doing it right become a lot better if you follow the checklist right right and that's sort of thing I would recommend people doing um yeah so we'll also I guess share go ahead yeah so we'll also share I guess uh these checklist the link of this checklist so that you guys can see like what are these checklist and uh what kind of things we should follow before publishing our app so yeah that's about these points let's move to right is this the correct one yes it is yeah okay then we share this link to everyone yeah so yeah we should I guess move to our second question so yeah you have already like gave the overview but still like okay what are the core Firebase Services commonly used in flutter app development and uh how they contribute like in different aspects of functionality for example push notification you talk about app check uh farb functions Cloud functions all the things I did not mention two of those three actually so good point uh now the most common one that people know best by the way is our online database um if you're using it in the master class it's probably going to be fir store that's that's a great database um and Fir store right it's an online database that you access directly from your app and that means you don't have toop a server for most interactions that your users do and that makes a big difference to your app development time so so so that's a great place to get started uh to be able to uh secure the data you typically want to know who your user is so you will sign them in so you use Firebase authentication for that that means that you can associate the data in your database with a specific user right so so that only that user can do let's say if we're building a chat app which I think well you're building a chat Bo but if we're building a chat app right you probably only you want everyone to be able to read all the chat messages but you probably only want the person who sent the message to be able to modify or delete it that type of uh interaction so you already said about push notifications great great one F Cloud messaging is the product we use for that and just to give you an idea even at um I actually Wonder Kam do you want to take a guess how many messages fire Cloud messaging sends per second yeah as like the Firebase is really old enough like 10 years I would say maybe probably Millions yeah it's in fact it's uh now 18 million messages per second um and FAS Cloud messaging is our actually allers product it predates Firebase it it used to be called Google CL messaging and we started it when we started Android and uh it's 15 years old now I'm not sure if we published that but just internally celebrating so um but uh our Peak uh load actually was during the World Cup soccer last year or at least the peak load that I know of and we sent 48 million messages per second in the World Cup final U so so that was amaz yeah these are amazing numbers and just so you know not every one of these shows up as a push notification actually the majority doesn't right for example I I did video on this where um I like to when when it's a game where the Netherlands where I'm from originally uh placed in I like to pin the score on my Android phone's home screen and all those updates are also sent through fibus Cloud messaging so but 48 million QPS even at Google that's a high number that's number where people are like what so um and you said Cloud functions and Cloud functions is a great example of how to do a server backend right serverless used to be a hyp word a few years ago now now luckily people accept it but Cloud functions are a way that you can run your code on my server is what I always joke and um the easiest way to do this is in response to things that happen in your application so most people are used to write when you have an API endpoint sayp URL that you can call from your application code but with Cloud functions the the honestly the more recommended pattern is actually to make everything respond to things that happen so if we think of chat messages for example right um You can run some code when somebody sends a chat message uh for example to call uh Cloud messaging to send push notification if the other user like left the app right and and that's a very common thing to do with Cloud functions they're a short run short like it's not necessarily short code but they're typically shortlived uh invocations and then they happen in the background it's almost like like the content of your app comes alive so um but there's many we have app quality products um we have products to help you like like essentially promote your app Remote config is sort of I always call it the sleeper hit of Firebase because it's it's a product that we had at Google before we made it a public product because at Google we have a rule that says that you um you can't ship a feature while you also ship code so so which sounds very odd it's like how do you ship a feature if you can't ship the code but we actually ship the code without the feature enabled and then we have a what we call remote config now a a a dashboard where we said okay the code doesn't cause problems right now let's enable it for people and that's remote config um and we have all kinds of Road areas for that so honestly it's it's a quite extensive platform yeah yeah there are so many services so guys you can also check Firebase there are so many services so yeah that's about this question and yeah that's incredible by the way the knowledge you have shared so uh let's move to the third question uh yeah the third question we have the what are the best practices for uh structuring the Firebase projects and organizing data with Firebase F St to optimize performance scalability and security yeah o that's a good question question uh it's also a very broad question though so um for fire store honestly we're just some friends here right I can be real like a lot of people start with Firebase because we have a free tier right and I'll be completely honest about that and that doesn't mean they necessarily wanted a nosql database but they end up with a nosql database right and then you get all these things of like how do I do joints and uh if you haven't used fir store uh here's here's a short talker you can't we don't join your data um one of the reasons we that no SQL databases scale so well is that they optimize they essentially only offer operations that they can scale that they can do with a certain performance level and that um means essentially that they should require very very little CPU on the server that's pretty much what it is right and um so so so fir store doesn't do joints it um actually last year couldn't do or queries it still now is limited in the types of queries it can do um but we have something really cool coming out next week for that uh keep an eye out for that but but um so you need to organize your data differently than if you come from a background in relational databases and SQL and uh for example I often tell people that it's best to think of what you see on the screen of your app and roughly replicate that in your data datase so if you have a list of chat messages in your app then have a list of chat messages in your database but if you have a home screen let's say that you have a news app where you show on your home screen five categories of news and five headlines for each article then you could read TW so fire fire story is document based right so you could read 25 documents one for each news article you could also make a document that represents the homepage and has 25 headlines then you need to update that document a lot more but every user only has to read one and this is sort of the trade-off that you always have to do with with no SQL databases we have some great guidance on this so always start on our documentation but I also recommend um there there's a a video series it's a bit old now but but it explains it really well uh it's called get to know Cloud fir store but honestly I at some point took a vanity URL for it because it's that good I didn't make it um and it's called firestore do video so so uh if you go to that one a bit of a long playlist I really uh uh think though that that if you follow that one you're going to learn a lot about the tradeoffs the trade-offs are different for every end that's also why when I answer a lot of questions on stof Flow and from developers and I try to help them but often it's like I have this domain right a restaurant review thing right what's the best data model and you can't answer that for a no SQL database because the best data model is literally a different for the use cases of your app so you need to look at every use case and often you need to change your data model for many of the use cases uh usually because the database doesn't have the feature that you thought you needed right so so you need to model your data slightly different to be able to implement it that's not because our database is is like incomplete it's a honestly quite complete no SQL database by now uh it's literally because um uh we need to guarantee the performance the one thing I want to say I should probably have started with this one like firestore has a unique performance guarantee that that you don't find in most databases in fact I don't think I find it found it which is um oh the internal saying is just horrible I I'll use better words but essentially um let's say that you want to grab the last 100 documents from a collection so a collection is like our our grouping and a document is a a single item of data and let's say that reading under documents takes um five seconds today it's not not a great number but like it doesn't really matter uh and let's say that today you have actually 100,000 documents you're taking the most recent 100 out of 100,00 that takes five seconds then we we say that 5 seconds is guaranteed so even if you have a million documents or a billion documents it will take five seconds to get those latest home which is a a quite unique guarantee that also means that after you've done some basic like development and the first like few users on board you essentially know your performance for the lifetime of your long answer we're not going to get through entire list of yeah we have like a long list of questions but yeah maybe we can uh skip some of the questions so yeah let's move to the another question uh yeah another question we have what challenges might FLIR developers face when integrating Firebase how they can uh troubleshoot and resolve them oh there's always going to be many questions uh um fun fact uh uh I I discovered Firebase back in 2012 2013 maybe um 2012 actually 2012 I was one of the first data users I lik the technology I started playing with it then I saw that people were starting to ask questions on stof Flow so I answered them and I didn't work for five base at the time and then at some point they reached out and said we like that you're answering questions do you want to come work for us so I found job helping developers probos shoot Firebase or discover data modeling issues and um I mentioned this because asking people for help on stof row is a really good reason way to get help it can also be a very frustrating way to get help don't don't don't get me wrong I know about all the troubles people might have there I still recommend though asking in a public forum just follow the rules of the Forum there um a common problem uh honestly it's it's getting stuff working initially it's one of my bigger problems uh I must admit um we have great tooling these days to make that easier um it's also right making sure that the product works for the platform that you want to support So flutter works on more platforms than Firebase works for example so you want to make sure that it's available there and um and then there's lots of integration issu I see people having lots of build issues and for example I'm not the best person to help with those uh I'm I'm very much more focused on coding but but lots of the actually more experienced flutter Engineers on our teams are much like more uh experienced and helping there um yeah yeah try to do your own basic troubleshooting if you can't figure it out ask somebody who has more experience in if they're not sitting close to you a public forum is a good place to do that but be sure to give them what we call a minimal reproduction so show them what you've done and show them the eror you get so that they can actually see um the problem that that you have and of course search for the error message that you get by the way um you'd be surprised how many people forget to do that when they've posted their question I essentially copy the error message into a Google Search and the first link I get is actually what they need to do right and that's not because they're dumb developers they're not it's literally like they typically type the title of the question last and by that time their mind is trained to actually summarize the problem well so after you type the question one more search you might find the answer nowadays people use CH GPT yeah that's for sure too oh please lose J use Gemini now um yeah Gemini it's free that's that's true so chat indeed but and uh honestly um we're also using such tools of course ourselves for us a bit Gemini more and and it's it's a great tool to use I must admit the the codee advice I get is typically not what I want but configur ation type questions these tools are for me even really helpful I notice right because they give me a set of things to consider right and and that's really I like that let's let's cherry pick from the from the I think 12 questions what random number question do you still want want you to add seventh question let's go to the seventh question Oh I like that it's about monetization oh no wait this one oh security measures you picked a good we for for this um yeah yeah all the security measures I need to be careful here my my legal council might be sitting here in no just just kidding there but you can see me thinking because I need to pick my words because I want to make sure you you you you have the best chance of having a successful weon not having trouble with fireb you get a database that you can access directly from your flutter app which is amazing but it's also a responsibility right because it also means that um if you can access it from your flut app that means that the configuration data of your database must be in that flut app that means that any malicious user can find the configuration data and use that to somehow connect to your database now we give you a a programming language to secure access to your database so you need to when you implement your use cases in your Flo app you need to make sure that you also Implement those in your security rules essentially what I've been telling people and believe me I've told a lot of googlers that this week uh that the the pattern to ensure that your data is secure that your user's data is secure I should say is to start with a database that is completely not accessible from the internet really insecurity rules that's if false like nobody can access it then you start coding your first use case and when you run that first use case guess what you're going to get permission denied and that's good right because that means that your database is secure right now you go to the security rules and you make the change that allows only that code to work so all other codes still should fail but you change your security rules to allow only that code and keep in mind your security rules go hand inand with your front-end source code the security rules are essentially your backend source code so now you run the app again right and guess what that one use case works so you go to the Second Use case you implement your frontend flutter codes you run it and guess what you get permission denied so you again make the change to your security rules to only allow that extra use case right if you do this you'll never have any data leak and this called the the um principle of minimal privilege right like like um so so only the least essentially means that there's never any data that can be accessed that that should not be accessible minimal privilege and um if you follow this P you're never going to like be in the news as a lot of big companies were earlier this week uh because they had a lot of user data accessible in their database and the thing to keep in mind there it's like we allow you to connect it to the internet but that comes with a responsibility if you don't like that responsibility don't use a database that can be connected straight to the internet right like it's it's I I can't make it any any clear than that um this is the biggest one we see there's like the whole security checklist has tons of other things there right it's it's making sure that your API Keys can't be abused um uh honestly there's a lot there U but but this is the biggest one that we see regularly it's about every I'll say every 12 month a security report shows up of websites that are unprotected um every time it hurts every time it takes me a lot of time to both intern externally like like educate people about this but it's the cost that we get for allowing you to build an app that directly talks to a cloud hosted datab right it's like I always internally also tell people it's like this is the business we're in right it's it's and we need to help developers right protect their database um so this too is the type of question where people can try to help but you will have to treat your your backand security rules in the same way you treat your frontend source code they are an in integral part of your application uh business logic and so so you need to make sure that you you write them and and check them for security Halls from day one and until well day whenever your your ATB loot great great well that yeah that's a great advice like uh because security is the should be the number one priority if you are dealing with users data yeah and and some of the biggest Firebase app rides have had this uh it's not uncommon and I get it right you're building feature by feature by feature you want to launch right I've been when I was doing a talk at a conference uh uh right I've been struggling to get my security RS finished on time before I walked on stage right it's like that's not ideal but don't right even if you're slightly late remember when your app goes viral lots of eyol are going to be there and they want access to your user dat yeah okay right so let's move to the another question I guess uh I would select ninth question odd number again totally fine yeah so what advice would you give to flutter developers learning Firebase to build effective apps probably you have already shared a lot but if still if there is any uh we would like to hear no flutter flutter developers are in that sense um I I help develop on a lot of platforms I happen to know flut really well but but um I I'm a polyglot I speak lots of languages essentially a program language I only speak two two other normal languages fluently but um it's don't be afraid to try things I should say and and I see that more on other platforms than on floa developers most floa developers are pretty good at actually just trying stuff um but on on some other platforms it's more common that people want to understand everything about technology before they start using it which is okay um but it means that something like a master class can help you but in a Q&A type format I cannot it's very inefficient to to teach people uh things right I can help troubleshoot that's where something like an online site like sto flow or or uh slack is is really useful but it's not a great teaching platform I can see people who want to like know everything right so so on on stof Flow like I see that they post a question I have an answer that's the answer they wanted five minutes later there's the next question right it's and it's just a stream of questions where they're learning the platform like it's not a very efficient use of of my time right it's like I I really just read the documentation from front to to back if you want you don't have to um I recommend not being afraid to try stuff especially on a platform like Firebase where you can get started with everything for free right create a project don't put it on the paid plan just keep it on the on the free plan that means that you can never be charged at di also means you can't use cloud fun but right that's the only product that you can't use there right and just start playing with it right what's the worst you can do right as long as you're still playing right like wipe P database who cares right it was just your own testing data just you're playing with and that's how I learn for example right we have new features coming out uh I immediately start trying them out in uh some like used to be Dart pad nowadays I do z. Runner or project idx right or in a stack Blitz page for web but and I start uh playing with these apis and yeah that's how you learn best how to use them and essentially that's how I help developers right if they have a question about something and I don't know the API yet quite often you'll see me set up my own minimal reproduction of it in in a tool like like idx with. run where I just try the thing and then I shareed link with them right and and I get that not everyone can can easily do that but it's a great learning tool yeah so technology I guess this that for the technology this is the right way if you want to learn then you have to be curious and you should play around with the things so yeah let's move to the last question now I guess we'll move to the last question we have uh yeah we can pick yeah this is also amazing question uh like what are where we can basically find the resources tutorials and communities to learn about Firebase and to stay updated great question great question indeed uh your your one starting point for learning about Firebase is of course firebase.com that's the main website um and and where you can get started uh I honestly recommend uh our documentation is really really quite good it's just also really really extensive right so if you're more of the learning by doing type then take one of the code Labs we have a few of those we actually have quite a few of those but also find thirdparty tutorials by now right Firebase is a mature platform there's a ton of third- party content like the ha flutter content right and there's many of these so right people often ask me it's like what tutorial do you recommend it's like how about typing it in your favorite search engine and just seeing what the top result is because probably it's not a bad one because it wouldn't be a top result otherwise right and and uh so one way to do it um and then I see communities and for communities I always recommend the Google developer group network um where where there's also lots of flutter groups of course around the world the flutter communities and just find your your Regional Community and and go hang out with them right whether it's in person or online I hope we're back to in person in many places right but uh and and and learn from them um I I know that uh that's where I meet a lot of developers right I I travel around the world and when I can I try to join the the local meetups also not just the bigger conferences but also the the the the smaller groups because it's just where you learn so much more from what people are actually working on and what people are excited about so there's no better way to to learn about new technology than to be together with with fellow I think I can say Geeks fellow Geeks right and and and just geeking out about it just having fun so always recommend doing that so let's see resources tutorials communities I think I covered all three yeah yeah that's amazing so I guess we are done with the questions do you have anything to maybe announce just to tell for the no well we are definitely working hard on new things at Firebase so we a conference season is starting as as as I often say but keep in mind conference season starts about every quarter I think but for me the the big two upcoming events are Google Cloud next which is early April in Las Vegas here where we are going to be launching lots of new Firebase features and even some complete new products and then the next one is Google IO which is probably the more famous One amongst the group we have here and Google iio is in Mountain View and uh I'm going to be speaking at both of these um it's my first time speak first time well i' I've spoken at Google IO before but not for a few years so it's my first time in a while and uh I'm going to be co-hosting the what's new in Firebase so I know all the releases that are coming in there and and there's so much cool stuff coming there so join us uh online or if you're there in person of course come find me in my yellow shirt uh and and we we can GE out together yeah yeah well that's amazing so yeah I guess that's the end of the uh this SE this session so yeah thank you so much Frank and all the people who are watching this live stream and yeah we'll see you next time thank you so much
Info
Channel: HeyFlutter․com
Views: 1,263
Rating: undefined out of 5
Keywords:
Id: sPpalg6dutc
Channel Id: undefined
Length: 30min 28sec (1828 seconds)
Published: Sat Mar 23 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.