Assignmetn No - 2 - Firebase
Assignmetn No - 2 - Firebase
Theory: Firebase is a Backend-as-a-Service — BaaS — that started as a YC11 startup and grew
up into a next-generation app-development platform on Google Cloud Platform. Firebase frees
developers to focus crafting fantastic user experiences. You don’t need to manage servers. You
don’t need to write APIs. Firebase is your server, your API and your datastore, all written so
generically that you can modify it to suit most needs. Yeah, you’ll occasionally need to use
other bits of the Google Cloud for your advanced applications. Firebase can’t be everything to
everybody. But it gets pretty close.
Most databases require you to make HTTP calls to get and sync your data. Most databases give
you data only when you ask for it. When you connect your app to Firebase, you’re not
connecting through normal HTTP. You’re connecting through a WebSocket. WebSocket’s are
much, much faster than HTTP. You don’t have to make individual WebSocket calls, because one
socket connection is plenty. All of your data syncs automagically through that single WebSocket
as fast as your client’s network can carry it.
Firebase sends you updated data as soon as it’s updated. When your client saves a change to
the data, all connected clients receive the updated data almost instantly.
It’s Authentication
Firebase auth has a built-in email/password authentication system. It also supports OAuth2 for
Google, Facebook, Twitter and GitHub. We’ll focus on email/password authentication for the
most part. Firebase’s OAuth2 system is well-documented and mostly copy/paste.
If you’ve ever written an authentication system, let’s commiserate for a moment. Custom
authentication is terrible. I will never write an auth system again for as long as I live. I fell in love
with Firebase Auth at first sight, and the flame has never wavered. Sometimes I get frustrated.
Sometimes we fight. But I never forget the cold, dark abyss of a custom auth system. I count my
blessings.
Oh, and Firebase Auth integrates directly into Firebase Database, so you can use it to control
access to your data.
It’s Hosting
Firebase includes an easy-to-use hosting service for all of your static files. It serves them from a
global CDN with HTTP/2.
And to make your development particularly painless, Firebase hosting utilizes Super static,
which you can run locally for all of your testing. I run Superstatic as BrowserSync middleware.
The following implementation uses Gulp, but Gulp is purely optional.
The Firebase team has integrated a bunch of new and existing Google products with Firebase. I
don’t plan to cover these features in detail quite yet. A bunch of these features apply to iOS and
Android but not to web.
Remote Config
Test Lab
Crash
Notifications
Dynamic Links
AdMob
Pros
Email & password, Google, Facebook, and Github authentication
Realtime data
Ready-made api
Built in security at the data node level
File storage backed by Google Cloud Storage
Static file hosting
Treat data as streams to build highly scalable applications
Don’t worry about your infrastructure!
Cons
Limited query abilities due to Firebase’s data stream model
Traditional relational data models are not applicable to NoSQL; therefore, your SQL chops will
not transfer
No on-premise installation
How to use Firebase:
2. Choose Account
3. Select webapp here
13. Open the webapp link from console and it would show you index.html file
14. After adding the details on this webapp you can see them reflecting on database