Firebase 101

Firebase 101

What is Firebase?

Cover design by Aswin Barath

Let us first understand how is a full-stack application built.
A full-stack application consists of a front-end component and a back-end component.
A front-end component is what we see, as a user interface(UI).
A back-end component communicates with the UI to send, receive, store and/or delete data.

Firebase is Back-End as a Service (BaaS).
Firebase gives you all the benefits of a back-end without the complexities of creating one up from scratch.

Benefits of Firebase

Reduce Development Time
Let’s face it. We can get impatient when we want a full-stack application as soon as possible. With Firebase, you can cut down development time.

Security

Firebase provides built-in security. If you configure it in the right way, your app will be a solid fortress.

High-Speed Caching
Your app deployed using Firebase hosting gets cached on solid-state drives (SSD) throughout the world. Your app loading time will become extremely fast that also helps with SEO.

Realtime Data
Cloud Firestore database updates all connected clients in real-time. The ability to get real-time updates makes applications a lot easier to implement.

Firebase core services

Cover design by Aswin Barath

Firestore database

Screenshot from Firebase Platform

Firestore is an excellent choice these days as almost every app needs persistent data. The following are the benefits of firestore:

  • Realtime

  • NoSQL

  • Security

Realtime
Realtime means that for every change made in the database, the connected users are updated with these changes. This feature saves you a lot of time when you are developing applications. It provides clear logic and reduces your code length.

NoSQL
Firestore is a NoSQL document database. There has been a surf of popularity for NoSQL databases. A lot of developers find them more comfortable to use.

Security
Firestore provides a set of security rules with which you can easily create restrictions for who can read, write, update, or delete data from your database.

Hosting

Screenshot from Firebase Platform

Firebase Hosting is an easy-to-use service even for beginners. Following are some impressive reasons to use this service:

  • SSL for Every Site

  • Fast Servers

  • Deploy From CLI

SSL for Every Site
The SSL certificate is automatically provisioned and configured for each site deployed.

Cached on SSDs
Sites deployed to Firebase Hosting are cached on SSDs (Solid State Drive) for a low latency reliable experience.

Deploy From CLI
Deploying your app to the web from a local directory only takes one command.

Storage

Screenshot from Firebase Platform

We love to share photos, videos, and gifs. Firebase storage enables your users to store and share these files through your app. Some of the features of the Firebase storage service are:

  • Handle Large File Sizes

  • Flexible File Type

Handle Large File Sizes
Firebase storage can scale up to petabytes.

Flexible File Type

There are no limitations on the types of files you can upload, which means you can use this service for images, videos, PDFs, etc.

Authentication

Screenshot from Firebase Platform

Building an authentication system from scratch is tiresome and can get tricky. Firebase offers a solution to authentication that requires less code, less time, and better security through the following features:

  • Email and Password Authentication

  • OAuth authentication

  • Using an existing platform to authenticate a user is known as OAuth. Firebase utilizes Google, Facebook, Twitter, Github, and many other providers that you can use to authenticate your users.

Each Firebase service can be used on its own or together with the other services. Hence makes it easy to pick and choose the right services for your specific application.

Firebase offers various services.
So, I encourage you to take the time to explore the other services as well.

Accessing Firebase services

Cover design by Aswin Barath

Firebase API follows a straightforward approach.
Invoking these methods will get you access to each Firebase service.

Design by Aswin Barath

Syntax to access Firebase Firestore

firebase.firestore()

Syntax to access Firebase Authentication

firebase.auth()

Syntax to access Firebase Storage

firebase.storage()

Firebase hosting commands

Firebase Hosting uses a command-line interface instead of methods on the Firebase object. Run the following commands:

Initialize a Firebase project

firebase init

deploy a Firebase project

firebase deploy

Who Am I?

I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through Blogging during the busy time of my freelancing work life. Here’s the link to all of my craziness categorized by platforms under one place: https://linktr.ee/AswinBarath

More Resources

Here are the best resources you may like from TechSoftware publication:

Keep Learning

Now, I guess this is where I say GoodBye👋.
But, hey it’s time for you to start learning with your newfound Knowledge(Power)👨‍💻👩‍💻 .
Good Job that you made it this far 👏👏
Thank you so much for reading my Blog🙂.

Originally published at dev.to