Firebase database

Firebase provides a real-time database and backend as a service. The service provides application developers an API that allows application data to be synchronized across clients and stored in Firebase’s cloud. The company provides client libraries that enable integration with Android, IOS, JavaScript, Java, Objective C, Swift, and Node.js applications. The database is also accessible through a REST API and bindings for several JavaScript frameworks such as AngularJS, React, Ember.js and Backbone.js. The REST API uses the Server-Sent Events protocol, which is an API for creating HTTP connections for receiving push notifications from a server. Developers using the real-time database can secure their data by using the company’s server-side-enforced security rules. Cloud Firestore which is Firebase’s next generation of the Real-time Database was released for beta use.

                                                        Store and sync data with our NoSQL cloud database. Data is synced across all clients in real-time and remains available when your app goes offline. The Firebase Real-time Database is a cloud-hosted database. Data is stored as JSON and synchronized in real-time to every connected client. When you build cross-platform apps with our iOS, Android, and JavaScript SDKs, all of your clients share one Real-time Database instance and automatically receive updates with the newest data.

Key Capabilities:

  • Real-time: Instead of typical HTTP requests, the Firebase Real-time Database uses data synchronization—every time data changes, any connected device receives that update within milliseconds. Provide collaborative and immersive experiences without thinking about networking code.
  • Offline: Firebase apps remain responsive even when offline because the Firebase Real-time Database SDK persists your data to disk. Once connectivity is reestablished, the client device receives any changes it missed, synchronizing it with the current server state.
  • Accessible from Client Devices: The Firebase Real-time Database can be accessed directly from a mobile device or web browser; there’s no need for an application server. Security and data validation are available through the Firebase Real-time Database Security Rules, expression-based rules that are executed when data is read or written.
  • Scale across multiple Databases: With Firebase Real-time Database on the Blaze pricing plan, you can support your app’s data needs at scale by splitting your data across multiple database instances in the same Firebase project. Streamline authentication with Firebase Authentication on your project and authenticate users across your database instances. Control access to the data in each database with custom Firebase Real-time Database Rules for each database instance.

How does it work?

The Firebase Real-time Database lets you build rich, collaborative applications by allowing secure access to the database directly from client-side code. Data is persisted locally, and even while offline, real-time events continue to fire, giving the end user a responsive experience. When the device regains connection, the Real-time Database synchronizes the local data changes with the remote updates that occurred while the client was offline, merging any conflicts automatically.

The Real-time Database provides a flexible, expression-based rules language, called Firebase Real-time Database Security Rules, to define how your data should be structured and when data can be read from or written to. When integrated with Firebase Authentication, developers can define who has access to what data, and how they can access it. Database API is designed to only allow operations that can be executed quickly.

The Realtime Database is a NoSQL database and as such has different optimizations and functionality compared to a relational database.  This enables you to build a great Real-time experience that can serve millions of users without compromising on responsiveness. Because of this, it is important to think about how users need to access your data and then structure it accordingly.

Implementation Path:

  1. Integrate the Firebase Real-time Database SDKs
  • Quickly include clients via Gradle, CocoaPods, or a script include.
  1. Create Realtime Database References
  • Reference your JSON data, such as “users/user:1234/phone_number” to set data or subscribe to data changes.

3. Set Data and Listen for Changes

  • Use these references to write data or subscribe to changes.
  1. Enable Offline Persistence
  • Allow data to be written to the device’s local disk so it can be available while offline.
  1. Secure your data
  •  Use Firebase Real-time Database Security Rules to secure your data.

To Store Other types of data:

  • Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud Platform. To learn more about the differences between database options, see Choose a database: Cloud Firestore or Real-time Database.
  • Firebase Remote Config stores developer specified key-value pairs to change the behavior and appearance of your app without requiring users to download an update.
  • Firebase Hosting hosts the HTML, CSS, and JavaScript for your website as well as other developer-provided assets like graphics, fonts, and icons.
  • Cloud Storage stores files such as images, videos, and audio as well as other user-generated content.

Firebase is one of the effective platforms that have made the task of the app developers simpler to much extent. Firebase is the best option for any Business applications. It has everything you need to make your App successful. Are you looking to setup Firebase account Please Contact Us or drop us a line at info@spgon.com


Author: Nagalakshmi Kadiyapu – Android Developer
Source: https://firebase.google.com/docs/database/gclid=Cj0KCQjw0dHdBRDEARIsAHjZYYAB0iAdyInp1ETjAsszVzksO8yNdKEW2E9ZzThaguWN2x_CGvRb3YaAsAiEALw_wcB
2018-10-23T11:31:49+05:30