Firebase

  1. Allows you to access data directly in the client - serverless
  2. The accessed data is updated realtime
  3. Makes it easy to build offline experiences

Firebase is a DBAAS that contains a suite of backend services built on top the Google Cloud Platform targeted at the mobile web and native apps.

Features:

Some of the services are targeting native apps only.

Has support for JavaScript as well as many other languages and SDKs for Android and iOS. It also provides a REST API if you prefer to use that. Firebase is affordable, scalable and higly accessible. Firebase is aimed at mobile and web applications.

Firebase is an integrated part of the Google Cloud Platform (GCP). You can for instance provide advanced features like cloud functions for your Firebase app via the GCP console. Both GCP and Firebase are managed via your Google account login.

Features that are irrelevant to web apps and thus are exclusive for native mobile apps:

JavaScript SDK

Provides, Authentication, Database, Storage and Messaging. The REST API provides Authentication and the Database only.

The JavaScript SDK Documentation

Setup

.firebaserc, database.rules.json, firebase.json

From the Overview page for your project in the Firebase Console you can click the "Add Firebase to your Webapp" button where you can copy the scripts to include to start working with your firebase project.

var config = {
    apiKey: "Public API key to authorize client for specific app. ",
    autDomain: "Where our firebase app lives.",
    databaseURL: "Specifies database location",
    projectId: "Firebase project Id",
    storageBucket: "GCP endpoint for storing binary data",
    messagingSenderId: "Google Messaging identity"
}

Authentication

From the Overview page for your project in the Firebase Console you can use the Authentication tab to set up different authentication schemes or manage users/rights.

Run: firebase serve [--host 0.0.0.0 --port 8080]

Real-Time DB

Cloud Functions

Serverless backend processing on GCP is used for things the client cannot do. Cloud functions are typically triggered by HTTP requests but can also be triggered by logon, uploads etc. These are stored in the functions folder of a project. They can be created by the firebase init command.

Cloud Messaging

Additional Features

Resources