Episode 079: Getting Started with Google Firebase | CloudSkills.fm

In this episode I catch up with Gareth Brown who is a front-end web developer and an expert when it comes to building apps with Google Firebase.

Gareth Brown is a software engineer with years of experience developing all kinds of web applications. We’ve partnered with Manning Publications to give away five (5) copies of Building Web Applications with Firebase. Just email [email protected] and the first 5 people will get a copy of the course.

Don’t forget to subscribe to our mailing list at cloudskills.io/subscribe for weekly updates, exclusive training, and advice on how to amplify your career.

Full Transcript:

Mike Pfeiffer:
Hey, what’s up everybody. It’s Mike Pfeiffer. Welcome back to another episode of the CloudSkills.fm podcast. Appreciate you tuning in again. And in today’s episode, I’m talking to Gareth Brown. Gareth is a Manning author, he is a front end web developer, and he’s got a ton of experience with Google Firebase. Gareth, how’s it going?

Gareth Brown:
Yeah, I’m good. Thanks. How are you?

Mike Pfeiffer:
Doing good. Yeah. Excited to have you on the show. It’s going to be a lot of fun. We’ve been doing so much Azure and AWS content lately. It’s fun to talk to somebody that’s working on some different technologies and maybe you could share with us your background. I know you’re a front end developer, but maybe you could talk about how you got into that and the stuff that you’re working on today.

Gareth Brown:
Yeah. So in a past career I was actually a primary school teacher in Australia. So I did that for… I was teaching for five years and throughout that time I started building what educational resources, and to try and promote those online I got into building website for it. I built websites in the past for a few side projects, a few hobbies, some music that I made, things like that. So I probably started in web development with Mozilla Composer, I think, which was a bit of a WYSIWYG back in the day. And from there learned Dreamweaver, this was all while I was still teaching, and then started building websites with WordPress as well. So when I was looking for a career change, I had done a fair bit of web development using WordPress for my own projects and just really enjoyed that whole process, started getting into the code a bit, the HTML a bit.

Gareth Brown:
So I thought that was the direction I wanted to head in. And then around about six years ago, I started just doing online courses, teaching myself HTML, CSS, and JavaScript. And just from there progressed into doing a diploma of software development. I also had a few little jobs here and there before becoming a software developer full time, such as I was in digital marketing for a little bit. I was a reporting officer doing a lot of Excel coding with VBA at one point, and became a data analyst with a lot of SQL before settling on being a software engineer and software developer.

Mike Pfeiffer:
That’s a great story. I’ve seen a lot of stories, similar people making a career transition into a web development type of role. That’s awesome. I think it’s really cool too, because you’ve been able to draw on your previous experience as a school teacher to bring that into the tech world. Have a good time doing things, presenting this content, creating different things for people to consume?

Gareth Brown:
Yeah, definitely. My previous history as a primary school teacher, I think, has had a far bigger impact on my software development career as I would have guessed, I think. I mean, originally when I told people I was coming a software developer, they were like, “Oh, well, that’s kind of polar opposite of being a primary school teacher. That’s a very big change.” But there’s a lot of skills I’ve picked up from being a teacher in my role as a software engineer now, but also as a tech lead on my team in the way I handle things, explain things, speak to the client, and general communications like that. And it also definitely is a benefit when doing a video course like I’m doing at the moment on Firebase. Some of the feedback I’ve got from Manning has been the way I’ve delivered the content has been really good. I’ve gone through a logical sequence and things I’m talking about are making sense. So I think it’s come through there as well.

Mike Pfeiffer:
That’s awesome. The reason I was wondering is because I went the reverse way. I started in tech and obviously I’m still in tech, but then I started teaching probably 10 years into my career, and that was about 10 years ago and that really changed my perspective of the way I was looking at technology, talking about it with other people, and when you’re a teacher or when you’re teaching, it really changes the way you look at technology. So I love that and I’d like to just bring that up and then it’s cool to hear about your experience, but let’s get into Firebase. So for somebody that doesn’t really know anything about Firebase or not paying attention, what is Firebase itself actually?

Gareth Brown:
Well, it’s backend as a service. So it’s a cloud platform which can act as your backend for whichever client you want to connect to it. So there’s a lot of… It’s used for a lot of mobile applications and where a developer wants access to a database or cloud storage, authentication, things that. But you can also use it for websites as well. I’m not sure if this is the nicest way of putting it, but it’s almost the younger sibling of Google Cloud Platform. This is kind of how I think of it. Where it is owned by Google. It’s got a lot of similar services, for example, the Firestore is the database for Firebase, and you can also access Firestore through the Google Cloud Platform. And it’s a far more accessible cloud platform than something like Google Cloud or AWS or Azure, for example.

Gareth Brown:
So you can vary easily get up and running, and if you’re a front end developer, for example, you can access the Firestore, access the database and the cloud storage just by writing frontend code. So you don’t even need to write any server side code or write any cloud functions or anything that. You can just get started using front end code, and there’s very little configuration you need to run through. It’s very easy to get up and running, but also all the services interact with each other very well. I would say seamlessly. For example, you can get your authentication set up on your web application using Facebook, Google, Twitter, and a few other services, and then that is very easily inbuilt into making requests to the database if you’re using Firestore, or making requests to cloud storage, for example. And then you can just use the free static hosting on Firebase to host your web app as well. So it’s very easy to get up and running with.

Mike Pfeiffer:
Yeah, that’s really interesting fleet of services, just looking the product page right now at firebase.google.com. For other people listening that happens when paying attention to what Microsoft and Amazon and others may have been doing in this space, it seems they’re wrapping up a lot of common services into Firebase here. So if I was working in Azure and I wanted to do some of this stuff, I might be doing some of my front end code out of app service or out of a storage account as a static website. It looks they’ve got the hosting built in, they’ve got the data persistence built in, so you can easily get your front end code up and running on the web and then you have an easy way to store persist your data, not only just from a NoSQL database perspective, but there’s also an object store solution, cloud storage. So it’s all these things that are one umbrella and it makes it really easy for especially front end developers to get going. So it’s not like they have to be complete cloud experts. They could focus on writing code. And it sounds like you’re just using some front end language to interact with the Firebase services, so you’re using something JavaScript.

Gareth Brown:
Yeah, yeah, definitely. There’s a cloud functions as well, which I haven’t actually used and I don’t cover in my course, but if you want to get into writing more service side specific code, then you can use those, you can write it using cloud functions. And I think they use cloud functions you can write in JavaScript, TypeScript, and also another language, which I’m not sure.

Mike Pfeiffer:
That’s good coverage, though, those are common languages. So if I’m just using it to build maybe a simple website, do I just need to know HTML and JavaScript and CSS or something like that, or is even more basic than that?

Gareth Brown:
You definitely need to know JavaScript. Just your standard front end code, as you said, HTML, CSS, JavaScript. You can very easily integrate with your front end frameworks as well like React, Angular, Vue, anything you want really. The documentation is very good. I can’t say enough good things about the documentation, sorry about the documentation. I definitely draw on it a lot. And the example are very clear and easy to read. So I feel like it’s something that even if you feel like you’re quite new to JavaScript, you can still pick this up relatively easy. I think if there’s any key part of JavaScript that you’d need to learn, if you are a beginner, it would be how to use promises just to get that asynchronous data requests and responses and everything going if you are a real beginner to JavaScript and just doing UI stuff, but it’s not a huge leap to get connected with a database and cloud storage and authentication and everything else you need to create a full stack web app.

Mike Pfeiffer:
Okay. That’s really interesting. And I was actually going through your… I know that the course is in a Manning early access program, meaning you’re still working on it. So it’s called Building Web Applications with Firebase, and it will be in the show notes as usual, but I was going through the content and it looked you had a chapter in there about setting up your environment and you talk about using NPM to build your project and get all set up. So it sounds you got to have Node installed locally and you’d go in there and create a project that way and just get up and running pretty quick, right?

Gareth Brown:
Yeah. It was quite a difficult balance to make between assumed knowledge of a minimally qualified learner and what I was going to teach them. So when I wrote the proposal originally for Manning and I had to outline what the minimal qualified learner was, so what skills did they know? And then as I’m going through the course, I wanted the course to be built around a project, because I’ve done a lot of courses, I quite enjoy doing courses, but I really the courses where I’m building a project using the technology that I’m learning. So rather than just going through each concept individually, I wanted to create an application around all the concepts and all the services I was teaching about Firebase.

Gareth Brown:
But then you hit something like, “Oh, okay, I need to bundle my files.” I don’t really want to use Webpack because that can be a little bit complex, so I’m just going to use Parcel, which is easy to use. But then I wanted to avoid going into too much detail about Parcel, so some of those stuff, I just go over very quickly so you don’t need to understand it. You can just write the code that I’m writing and it still gets you up and running. It’s good to know things NPM, just to know what’s going on, but it’s not critical knowledge. You can still just follow the steps to get to the Firebase concepts I’m actually teaching.

Mike Pfeiffer:
Got it. Yeah, that seems it happens quite a bit, where a lot of application frameworks use NPM and you don’t have to be an expert with Node and you just have to know how to run a few commands to get going. So that’s cool. So what’s one of the most interesting apps that you’ve seen built on this platform or that you’ve built, to give people a frame of reference of what you can do with this in terms of building an application.

Gareth Brown:
The first thing that comes to mind, which is mainly what Firebase was built on originally before Google took it over, was it centered around this real time database where you would update the database, but then you could subscribe to an observer that would then update your database as soon as the database was updated. So then you could very easily create chat type apps. And that’s what it was very good for. So I suppose the best application that springs to mind to use with Firebase is any application that needs that real time interaction such as a chat. And the first application I built for it was just a bit of a side project for teachers, where a teacher could write a class list of their students and they could create a new list which would automatically have all their students and it might be a list for the spelling. So you could tick off which students brought their spelling in that day.

Gareth Brown:
And then you could select a check box, just to check them off. Or you could change the color of what the student said, in case you wanted to group them somehow. And the idea was that multiple teachers could use the same application. So let’s just say there’s a sports day and one teacher’s out in the oval with their phone, and they can check off when a student reaches the finish line and then someone back in the office can see if a student’s reached the finish line or something that, where it would have that automatic update because of the real time database. And the real time database is actually… I think you can still use it on Firebase, but that kind of got taken over by the Firebase Firestore, which was a bit of the next level database for Firebase.

Mike Pfeiffer:
And you write about Firestore, or not write about it, but you teach that in the course. You get into Firestore and basically working with… That’s a database service, right?

Gareth Brown:
Yeah, yeah, that’s right. When I first looked at Firebase, it was that real time database, which basically stored… So it was a NoSQL database, and it stored all the data in a single JSON file, basically. And I think people who do apps with real time database got to a certain number of users and it just couldn’t expand anymore. So it couldn’t scale very well and it had a lot of downfalls because of this, which is why I think Google built the Firestore to be the next database level up.

Mike Pfeiffer:
Got it. And you mentioned you did a lot of WordPress work in the past, which means you probably got sucked into relational database work with MySQL or something, and I’m curious about your perspective, Firestore DB versus something like a relational database like MySQL. Is it a big difference for you, like a huge departure as a developer?

Gareth Brown:
I feel like I had to read a lot of documentation and work with it a fair bit to wrap my head around it. And especially how Firestore stores data as opposed to the real time database. I mean, if you go straight to the real time database, for example, you’re pretty much looking at a JSON object, so if you’re a JavaScript developer and you understand JSON, then I think the leap to an object, or rather a leap to a NoSQL database is a lot smaller. I mean, I’m still undecided about the pros and cons between both types of database, because I do like the relational databases where you’ve got a different… Each table is for a very specific thing, a table just of customers and a table just of orders, for example. Because I’ve found the challenge with more, NoSQL databases or document databases, there’s a question between, do you go deep or do you go wide?

Gareth Brown:
So if you create a JSON object, like a document to store information about a customer, for example, do you then store… You store all the customer details on that object, but then if they have an order, do you store the order in the customer document or do you store it at a higher level so you’ve got more of a flat hierarchy. So I almost feel relational database is a lot more easier to create and to decide how are you going to build a relational database than a document database. I think that’s the challenge I’ve found.

Mike Pfeiffer:
Yeah, I’ve noticed too, from coming up with my development experience in the relational database world, and then using ORMs, object relational mappers, things like in the Microsoft space, and we got a lot of .NET people that listen to the show, so Unity framework, it does a lot of the work for you. So I had to unlearn a lot of things when I first started dealing with these object databases or these NoSQL solutions. So I haven’t worked with the Firestore DB, but things like Cosmos DB over in Azure or Dynamo DB in AWS, those were definitely a big change for somebody myself. I had to unlearn some of the things that I’d learned in the past from relational database development. But I was just curious about that. And then from there also, I think one of the things that might be an easy stumbling block is you see cloud storage and you’re thinking, “Well, if I’m storing all my stuff in Firestorm DB, why do we need cloud storage?” But that’s really more about files, right?

Gareth Brown:
Yeah. That, that came up… While I was writing the course, we have a technical proofer. So the technical proof responded back to me with one of my storyboards for one of the modules, talking about “make sure you explain the difference between Firestore and cloud storage.” And then we had another technical proofer and I think they brought it up as well, or for me rather, because I’d learned those concepts, I didn’t think of that straight away. I didn’t think “I really should explain the difference.” But of course then remembering before I’d learned about Firebase, it’s definitely confusing. But basically I think of it as in Firestore is a database, it stores data that would be human readable. If you looked in the database, you could see someone’s name and someone’s date of birth, whatever data you’ve got in there. And cloud storage is basically an online folder system. So your folder system, file system on your laptop, you’ve got a holiday folder there with all your holiday photos and a friend folder there with all your friend photos. And if you just upload that folder system in the cloud storage, that’s what you’d use cloud storage for.

Mike Pfeiffer:
Got it. Yeah. So if you’re serving up a bunch of images or videos out of your web app, those assets could go into cloud storage, I guess?

Gareth Brown:
Yeah, definitely. And that’s the way I’ve explained it in the course. I think it’s just basically an online file system. Some people might argue there’s more to it than that, but I think that’s the best way to explain it anyway.

Mike Pfeiffer:
Yeah, no, that’s really good because a lot of navigating this world of cloud is just knowing what are people talking about with the naming. So I think probably on this one, it could be a little bit tricky, because Firebase and all of its related services are different than Google Cloud Platform services. They have other services that are similar to the database service, the cloud storage, that’s not specific to Firebase, I believe.

Gareth Brown:
I know Google Cloud Platform has Firestore. And as far as I know, because I haven’t looked yet too much into the Google Cloud Platform side of things, but I’m pretty sure it’s the same database.

Mike Pfeiffer:
Got it. Okay. So they’re just kind of piggybacking on what’s there and then same thing with, I guess, their cloud functions. Because to your point earlier, the cloud functions are really the backend. If you wanted to do C++ or something on the back end, you can do it in cloud functions. So that’s just a glue Google Cloud Platform service as well. So that’s kind of interesting. I think, going back to just understanding definitions and how they’re naming stuff, so people understand what they’re looking at when they’re working with it, that’s important.

Gareth Brown:
Yeah, definitely. I think some of the naming can be… I think it can be confusing as well. Cloud storage, for example, I mean, anyone new to the cloud, the word cloud itself is quite a very nondescript name of what it is. And serverless, of course, every time I read serverless in an article it’s usually followed by even though there are actually servers. So I think there’s a lot of language which is confusing, and I almost feel that’s where Firebase is… Firebase is a very, very good stepping stone as well for anyone who wants to learn about cloud. I’ve kind of recommended it for front end developers who want to start building some backend services for a web app or something. But I would also strongly recommend it for any backend developers, software engineers who want to start getting into the cloud and cloud services because then it’s probably not a huge leap from there to something Google Cloud Platform.

Mike Pfeiffer:
I’m surprised we made it this far into the conversation without bringing up the term serverless. That’s great. I think some people to push back on that, and just to your point, happy to break it down and explain, yes, there are servers somewhere, but we’re just talking about you as a developer don’t have to think about servers because you’re just using this higher level service. So you don’t have to think about any infrastructure, no load balancing or scaling. It’s just focusing on code.

Gareth Brown:
Yeah. Security is interesting actually, because if you’re accessing a database from the backend, then you’ve usually got some API key or something like that. But of course, if you’re running all front end code, then all of your code is visible to the user. And Firebase handles that quite well where you’ve got Firestore rules are called rules for Firestore and cloud storage, so you can write the rules on the actual Firebase console to specify which users can access which part of the database and who has read access, who’s got write access. So yeah, just thought I’d throw that in after you’ve mentioned security.

Mike Pfeiffer:
That’s really good. Yeah. That’s interesting because I was going to ask you about how do you… One of the biggest challenges to me when building a web app is wiring up all the authentication and stuff. So I was going to ask you about… Is that less painful with this platform? It’s really interesting to hear about the security stuff, that you could just build a rules, and it seems like that ties into your identity system.

Gareth Brown:
Yeah, definitely. And I think it’s good as well. Setting up authentication is almost one of the easiest parts. If you authenticate with Google, I think it’s just a couple of lines of code and attach it to an event of a button and it’s done. And if you want to authenticate using email, there’s a little bit more to it. Same with Facebook and Twitter. You’ve got to go through the Twitter and the Facebook dev consoles and things like that. But I suppose the thing I like about Firebase is that once you’ve got the authentication set up and then you’re looking at Firestore, for example, if you need to access the documents, all the documents reference the authentication. So if you’re using Firebase authentication, then it’s already laid out in front of you in the docs exactly how to use Firebase authentication to access the Firestore, for example.

Mike Pfeiffer:
This is really cool stuff. So if somebody who’s completely brand new to this, but this is speaking their language, they’re interested and maybe kicking the tires, creating an app of their own, playing around with this, obviously they can watch your course, but what’s some other resources maybe that we could point listeners to, to get started with Firebase?

Gareth Brown:
I’d definitely jump on the Firebase website. So Firebase has documentation. It’s broken up into different SDKs. So there’s the iOS docs, the Android docs. But if you go to the web docs, they’re laid out very well and they’re quite easy to follow. The thing that got me started was the Google, I think they’re called Codelabs. So if you have a look at Firebase web Codelab, that is a very easy to follow tutorial as well. I think there’s a couple how to set up authentication, how to set up Firestore, things that. That’d be the first two places I’d go to. And Google also have a lot of YouTube videos that are really clear. So the documentation written by Google themselves has just been fantastic.

Mike Pfeiffer:
That’s awesome. Yeah, they definitely have some insanely good docs. I’ve noticed that as well. So we’ll link all that up in the show notes for everybody listening. And Gareth, is there anywhere, besides your course that we’ll include in the show notes, that we should send people to follow you online or connect with you on anything else you’re doing out there?

Gareth Brown:
I’m not hugely on social media, to be honest. I do have a Twitter account, which I very rarely look at.

Mike Pfeiffer:
Well, you’re busy doing all this coursework, I guess you don’t have time to… I’m the same way. I’m not always on Twitter. I am on there, but I’m usually building content and stuff that.

Gareth Brown:
Yeah. I really have to force myself to jump on Facebook and get into contact with friends and family and everything like that. But yeah, on the course in Manning there’s comments and stuff you can write, which will get back to me as well.

Mike Pfeiffer:
Perfect. Yeah, we’ll definitely hit that up and get it linked up in the show notes and everybody that’s listening, definitely check out the show notes as well, because there is a giveaway for copies of Building Web Applications with Firebase, the course from Manning that Gareth has been working on. So Gareth Brown, thanks so much for being on the CloudSkills.fm podcast. Appreciate it.

Gareth Brown:
Yep. Thank you.

Subscribe to the CloudSkills Weekly Newletter

Get exclusive access to special trainings, updates on industry trends, and tips on how to advance your career in the tech industry.