NoSQL – FireBase with Angular JS -2.0 – Part 1

Introduction:

All real world applications uses SQL concept (Relational databases)  to store,retrieve and displaying data for end users in structured manner using tables concept. But with use of NoSQL concept, it will be different case.

NoSQL will store the data in JSON (text) format as parent – child  nodes relationships. In this article will see basics of this concept over conventional SQL.

Benefits of NoSQL:

Simply to use: Yes!, as this uses key – value pairs to store, simple and complex objects – it’s very easy to retrieve the data.

Performance – As data stores in simple text format with key and value format – data will render, insertion, update will be much faster.

Minimized data store – As data stores in a text format which will be cheep in consuming physical hard disk space.

Easy to perform CRUD operations: Using powerful web front end framework like Angular – we can perform CRUD (Create,Read,Update and Delete) will be much simpler, same thing achieved by calling Push, Update and Remove methods on FireBaseObject.

– NoSQL examples are MongoDB, Cassandra, CouchDB , FireBase etc. I will show creating, account and setting up the FireBase with this article.

What is Firebase ?

 This is JSON documentation storage to support NoSQL which has much features than existing same kind. It belongs to Google. Which has most secured way of accessing data using authentication feature for read as well as write accesses.

Create your account FireBase

FireBase provides free access for sample development and if your for business you can pay few dollars monthly, years depending on your subscriptions.

Head over to https://firebase.google.com and create a account or use existing Gmail account to login in.

After successful login – press on Get Started from home page and it will navigates to project screen, then press on create new project.

Enter meaningful name for your sample project – that is it your first project ready to use with JSON objects – access database from side bar. (Depending on your platform you can choose the initialize script from the same page).

Image: Project name assigning in Firebase.

Adding simple object:

Press on Database in navigation bar – you can use your project name as parent node – press on add button – add name and value for the same. In below image – 1, I have shown simple JSON object with name and value.

 

Image-1: Adding simple object in Firebase.

Adding complex object:

In previous node we added – name and value to store hotel basic information. Now we can add contact as parent node, in that we will add address and email as contact information, here also we added with key and value pair.  In below image – 2, I have shown complex JSON object with name and value.

Image-2: Adding complex object in Firebase.

Conclusion: In this article we seen NoSQL, it’s benefits over the RDBMS, we seen FireBase – account creation, creating basic and complex JSON objects. We will see how to use these in Angular project to perform CRUD operations in next article. Thanks.

Happy coding 🙂