Making Development Faster and Easier with Firebase

A Brief Introduction to Firebase

Most front-end developers feel they wouldn’t be able to make or complete a fully functional website or a Web Application all alone, because they will always need a back-end developer’s help. As a front-end developer myself, I’ve worked with many back-end developers, and we’ve had good working relationships, but I always wanted to be able to do this independently, without any help. 

As a front-end developer, learning back-end technologies is probably not your original or main goal, and it can be time consuming. However, there is something that can help called Firebase.

What is Firebase?

Firebase is a software development platform that started as a realtime database. To-date it has 20 services, such as Authentication, Cloud Storage, Hosting, Cloud Functions, etc.

This platform allows you to create mobile or web applications without server-side programming, and let’s be honest, this makes development faster and easier. 

Read on for a summary of what Firebase is and discover pros vs cons on using the platform.

1. Authentication

When a user signs in to an application, the application gets the credentials (password, user name, email address, or token) from the signed in user. These credentials need to be passed to the Firebase Authentication SDK. Firebase backend services will verify these credentials and will return a response to the user.

The logged in user can now read and write data to the Firebase Realtime Database.

Another positive aspect of Authentication with Firebase is that the platform supports authentication using Google, Facebook, Twitter and more federated identity providers. 

Example of how to authenticate a new user:

 

2. Realtime Database

If you have worked with BE developers and databases, you know that you need to make HTTP calls to get or update your data, and most databases give you data when you ask for it.

It is important to mention that you are not connecting your application to Firebase through HTTP because Firebase uses data synchronization and this is much faster. This is why, when a user makes data changes and your application is connected to Firebase, that data will be automatically updated and available for the other users within milliseconds.

3. Cloud Storage

The Cloud Storage for Firebase adds Google security to file uploads and downloads. In this way, you can safely store images, videos and other files. The uploaded files are stored on Google Cloud Storage, so the files can be easily accessed through both Firebase and Google Cloud.

Example of how to save an image to Cloud Storage:

4. Firebase Hosting

Firebase Hosting is a Google hosting service which provides static web content in a fast, free (1GB of stored files and 10GB of traffic per month) and easy way. 

You can deploy your web apps very easily, and you can also pair Firebase Hosting with Cloud Functions.

Pros and Cons 

Pros:

If you want to start to build a Web Application with Firebase, this will require no payment. Once you reach a certain amount of database memory or if you need a specific service there is a fee. The good news is you can choose between many plans. To learn more about Firebase pricing you can visit https://firebase.google.com/pricing.

With Firebase comes Google Analytics, a free and unlimited analytics solution. You can use up to 500 distinct events that help you understand how your users behave.

Firebase has more advantages, including: 

  • Serverless
  • Realtime database
  • Easy access to data
  • JSON storage
  • Needs minimal setup

As with any technology, Firebase has its weaknesses, too.

Cons:

Realtime Database is a very powerful feature and, for the most part, you will use this, but because the whole DB is a huge JSON file, this feature has its downsides. The main problem with it is limited querying capabilities. 

Realtime Database has other cons. Since the whole DB is a single file, you can’t implement relations between data. 

If we want to avoid these cons, Firebase comes with a more powerful feature– Cloud Firestore.  

Summary

If you’re a first-time user of Firebase, you’ll likely need some time to get used to it. But in the end it is worth it, because it’s a very powerful platform. Firebase allows you to be totally independent, you can build your application all alone, and there are many many other things Firebase can help you with.

This was just a short introduction on what Firebase is and how powerful it is. For more information, access the official Firebase website and from there, you can explore the platform and its offerings in more depth.

 

References

https://firebase.google.com/docs/guides

https://firebase.google.com/products/firestore