First Encounter with Firebase

I had been learning new technology in the past days and came across firebase. I could create database and store data in no time and with ease. Let me show you how..

First you need to login to Firebase console. Then you need to add a project.

Once project is created we will be presented with the console where we now need to create Real time database.

Choose test mode while creating database. If you read the message down there, anyone can access and edit test data. I am writing this blog for test purpose, to give you feel of firebase.

Go ahead and click Enable. You will see screen with modal like below. At this point we have database created.

Storing data

We need to append the entityname with json extension at the end of the url to post the data. If I want to store person entity, I can post it like

<Url from above screenshot>/person.json

Just a post request to the url in the above format with the json data in the body. I am using thunder client in visual studio code. You can use any client like postman, fiddler or even curl.

Once posted the response will contain the entity id that got created on the firebase.

Reading data

Reading is via GET call. If you execute GET call on the url of person.json, it will return all records.

Wrapup

I am not an expert in firebase. What fascinated me is that firebase is so easy to setup and work with. I can build UI prototypes with this database, and later switch the datastore.

Hope you liked the post.