What is Firebase? Why and How to Setup Firebase? Chintan Prajapati December 19, 2016 5 min read What is Firebase?Firebase is a real-time database using cloud technology. That permits you to make applications without server-side coding and Rest APIs. All the database-related actions will be managed by Firebase. So, you just need to focus on the Front side. The rest of the back-end side will be managed by Firebase services like user management, User authentication, database management, Synchronization of data, etc. We just need to do some settings on our website or mobile apps for using Firebase services.What are the advantages and disadvantages of the Firebase cloud database?Based on my ongoing R&D in December 2016 for Firebase and its services. I have found some advantages and disadvantages of the Firebase apps.Firebase Pros: First of all, If your app does run on a centralized DB, and it is used by a lot of users and updates data frequently – then Firebase is more capable of handling the Real-Time data updates between devices. Your data will be Stored in the cloud so it’s available anywhere. Firebase is more suitable when you develop Cross-Platform APIs like Ionic, PhoneGap, and Xamarin. Finally, If you are storing lots of data, you don’t need to worry about hardware.Firebase Cons: First of all, Unless your app runs on one centralized database and your user base is vast than it’s overkill to update data. The storage format of Firebase is different from SQL, firebase uses JSON format so it’s not easy to migrate. You won’t get any Reporting tools like standard SQL. The cost of the firebase is Limited to 50 Connections and 100 MB of Storage. If any small update comes from the Firebase side then you need to update your app and Republish it. It is not possible to send a push notification campaign using Firebase. Finally, Limited programming over the server side.When to use Firebase?Firebase database is useful when your app requires simple authentication like email, Facebook, or Google. And your product doesn’t require to provide API. app doesn’t have large data to display. And there is no use for a complex query. Your application has a limited user base because Firebase becomes costly when your user base is increased.Here are the Best Examples: Simple chat Apps, Restaurant apps, and simple product listing apps like Boneta, and Chrono24.When not to use Firebase?Firebase is not very useful when your user base is vast, products provide API, and products have a large amount of data.Then, there are no reporting tools available like SQL, and if your app needs a complex query for the result then Firebase is not suitable for your application. Examples is Amazon, Flipkart, and Ubar.Why is Firebase not feasible for Large application? Firebase downloads all subtrees on load so it’s causing some performance issues. The problem with data migration. Complex queries are not possible to write. Not able to provide API for your product. A small update in Firebase needs to change and publish your app again. No Reporting tools are available so you don’t have a chance to check the performance of a query. Rest API of Firebase cannot be implemented quickly. Custom code is not supported by Firebase. Suitable for Time application onlyWhat other choice do we have? Ionic Cloud: IonicDB is a secure, cloud-hosted, real-time database. It utilizes JSON storage so you’ll already be comfortable working with data, and of course, we’ve already integrated it with Ionic Auth, so the only thing you need to focus on is what matters. They have not declared pricing, During the private access period, IonicDB will be free. Microsoft Azure DocumentDB: Microsoft Azure DocumentDB is a NoSQL service for highly available, globally distributed apps. It provides native support for MongoDB wire protocol and Restful HTTP API. Custom web app using MVC and SQL Server. Meteor: Meteor is an open-source web development tool using Node.js to build a real-time application as this feature is there in its core. With Meteor you can develop frontend, backend, and a database for Cross-platform applications. Like Android, ios, and the web. Meteor is a development tool using a web framework and MongoDB as the backend there is no restriction in programming you can build anything, and you can host apps only using Meteor. Deployed (Deployd is built on **Node.js** and **MongoDB**) MongoDB Parse server: Parse server is open source and provides self-hosting or parse hosting and also there is no limit for local testing and deploying. Parse server totally supports custom code and Has a huge relationship-based database, It also allows us to send push notification campaigns, there is no restricted time limit and no file storage limit. It was developed by Facebook and is suitable for General applications.Note : Parse server will be shut down on 28 January 2016 but parse open source version will be available. http://blog.back4app.com/2016/03/30/parse-open-source-is-moving-fast-but-still-has-some-features-to-be-opened-up-see-which/Setup Requirement:You need to install node.js on your PC. You need to sign up with Firebase create your application and set up Firebase with your application.How to set up a Firebase database in your mobile app? Include some JavaScript in your Index.html page. <script src="https://cdn.firebase.com/js/client/2.2.4/firebase.js"></script> <script src="https://cdn.firebase.com/libs/angularfire/1.2.0/angularfire.min.js"></script> <script src="https://www.gstatic.com/firebasejs/live/3.0/firebase.js"></script> Initialize Firebase using the below code in your Index.html page. <script> // Initialize Firebase // TODO: Replace with your project’s customized code snippet var config = { apiKey: "<API_KEY>", authDomain: "<PROJECT_ID>.firebaseapp.com", databaseURL: "https://<DATABASE_NAME>.firebaseio.com", storageBucket: "<BUCKET>.appspot.com", messagingSenderId: "<SENDER_ID>", }; firebase.initializeApp(config); </script> Include Firebase reference in the app.js file. angular.module(‘mychat’,[‘ionic’, ‘firebase’]) Now you are ready for performing database action using firebase. The following code is for inserting data into firebase refer below code. var playersRef = firebase.database().ref("players/"); console.log("playersRef :" + playersRef); playersRef.set({ "Test Employee 1": { number: 3, age: 30 }, "Test Employee 2": { number: 4, age: 27 } });Refer to This link for a More detailed tutorial https://www.tutorialspoint.com/firebase/firebase_write_data.htmConclusion:Firebase is real-time facilitates online-offline sync and provides you with all backend facilities.It’s not enough feasible for a Large application. And you can use it for a small application that has less amount of user base and data.We are in Satva Solutions web and mobile app development company. Satva is a . Net-based company that also works on Android, iOS, and Windows phones, Ionic apps, Xamarin apps, nopCommerce, Umbraco CMS, Orchard CMS, Rest API services, third-party integrations, responsive design, and much more.