SlideShare a Scribd company logo
ThreeBase
Firebase in 3 minutes or less.
by Mayank Mohan Upadhyay
linkedin.com/in/mumayank
Topics covered:
Prerequisite: Firebase> docs> android> quickguide
1. What is Firebase?
2. Is Firebase for me?
3. Understanding data in Firebase
4. Saving and Retrieving data
5. Security options
6. Offline feature
What is Firebase?
Firebase is:
a cloud services provider and
backend as a service company
based in San Francisco, California
founded in 2011 by Andrew Lee and James Tamplin
launched with a realtime cloud database in April 2012.
Firebase's primary product is a realtime database which provides
an API that allows developers to store and
sync data across multiple clients.
What is Firebase… in simple terms, please?
OK, so Firebase is basically a simple online database that offers:
real-time data syncs
has offline capabilities
provides security measures
Is Firebase for me?
You should switched to Firebase if your app:
backend has basic database structure
requires no complex queries on database
requires an online database which can be synced across devices in real-time
requires simple communication with server on-the-go
requires a combination of quick real-time database setup + security
You may also switch a node of your app backend to Firebase if that part satisfies
any of the above criteria.
Understanding data in Firebase
All Firebase database data is stored as JSON objects.
{
"users": {
"friends": { "brinchen": true },
"name": "Mary Chen"
}
}
Saving Data
setValue( )
Write or replace data to a defined path, like messages/users/<username>
updateChildren( )
Update some of the keys for a defined path without replacing all of the data
push( )
Add to a list of data in your Firebase database. Every time you call push() Firebase generates a
unique ID, like messages/users/<unique-user-id>/<username>
runTransaction( )
Use our transactions feature when working with complex data that could be corrupted by
If you'd like to know when your data has been committed, you can add a completion
listener:
ref.setValue("I'm writing data", new Firebase.CompletionListener() {
@Override
public void onComplete(FirebaseError firebaseError, Firebase firebase) {
if (firebaseError != null) {
System.out.println("Data could not be saved. " + firebaseError.getMessage());
} else {
System.out.println("Data saved successfully.");
}
}
});
Reading Data
With Firebase queries, we can selectively retrieve data based on various factors. To
construct a query, you start by specifying how you want your data to be ordered
using one of the ordering functions:
orderByChild(), orderByKey(), orderByValue(), or orderByPriority().
You can then combine these with five other methods to conduct complex queries:
limitToFirst(), limitToLast(), startAt(), endAt(), and equalTo().
Security Options
Authentication
Valid user entry (password entry)
Authorization
Defining permissions of each user
Rules:
.read
.write
.validate
Offline feature
Firebase apps automatically handle temporary network interruptions for you.
Cached data will still be available while offline and your writes will be resent
when network connectivity is recovered. But if the app is restarted, unsent data
will be lost.
Enabling disk persistence allows our app to also keep all of its state even after an
app restart. We can enable disk persistence with just one line of code.
Firebase.getDefaultConfig().setPersistenceEnabled(true);
With disk persistence enabled, our synced data and writes will be persisted to disk
across app restarts and our app should work seamlessly in offline situations.
Offline feature
Firebase synchronizes and stores a local copy of the data for active listeners. In
addition, you can keep specific locations in sync.
scoresRef.keepSynced(true);
The client will automatically download the data at these locations and keep it in
sync even if the reference has no active listeners. You can turn synchronization
back off with the following line of code.
scoresRef.keepSynced(false);
By default, 10MB of previously synced data will be cached. This should be enough
for most applications. If the cache outgrows its configured size, Firebase will
purge data that has been used least recently. Data that is kept in sync, will not
Thank You!
Questions are welcomed, Feedback is appreciated!

More Related Content

What's hot

Firebase - realtime backend for mobile app and IoT
Firebase - realtime backend for mobile app and IoTFirebase - realtime backend for mobile app and IoT
Firebase - realtime backend for mobile app and IoT
Andri Yadi
 
How to build Android Chat App with Firebase for 2 hours?
How to build Android Chat App with Firebase for 2 hours?How to build Android Chat App with Firebase for 2 hours?
How to build Android Chat App with Firebase for 2 hours?
Nguyễn Bá Thành
 
Online mobile game server use Firebase realtime aatabase
Online mobile game server use Firebase realtime aatabaseOnline mobile game server use Firebase realtime aatabase
Online mobile game server use Firebase realtime aatabase
Nguyễn Bá Thành
 
Firebase Android
Firebase AndroidFirebase Android
Firebase Android
Sudipta K Paik
 
Firebase with Android
Firebase with AndroidFirebase with Android
Firebase with Android
Fumihiko Shiroyama
 
Firebase for the Web
Firebase for the WebFirebase for the Web
Firebase for the Web
Jana Moudrá
 
Serverless - State Of the Union
Serverless - State Of the UnionServerless - State Of the Union
Serverless - State Of the Union
Amazon Web Services
 
Creating Real-Time Data Mashups with Node.JS and Adobe CQ
Creating Real-Time Data Mashups with Node.JS and Adobe CQCreating Real-Time Data Mashups with Node.JS and Adobe CQ
Creating Real-Time Data Mashups with Node.JS and Adobe CQ
iCiDIGITAL
 
Introduction to Firebase
Introduction to FirebaseIntroduction to Firebase
Introduction to Firebase
Farah Nazifa
 
Introducing firebase
Introducing firebaseIntroducing firebase
Introducing firebase
Farouk Touzi
 
State of the Union: Containers on AWS
State of the Union: Containers on AWSState of the Union: Containers on AWS
State of the Union: Containers on AWS
Amazon Web Services
 
Amazon ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
Amazon Web Services
 
Kubernetes on AWS
Kubernetes on AWSKubernetes on AWS
Kubernetes on AWS
Amazon Web Services
 
Advanced Container Management and Scheduling
Advanced Container Management and SchedulingAdvanced Container Management and Scheduling
Advanced Container Management and Scheduling
Amazon Web Services
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step Functions
Amazon Web Services
 
Deep dive into AWS fargate
Deep dive into AWS fargateDeep dive into AWS fargate
Deep dive into AWS fargate
Amazon Web Services
 
Serverless Developer Experience
Serverless Developer ExperienceServerless Developer Experience
Serverless Developer Experience
Amazon Web Services
 
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Naga Rohit
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
Brian Lyttle
 
API Basics
API BasicsAPI Basics
API Basics
Ritul Chaudhary
 

What's hot (20)

Firebase - realtime backend for mobile app and IoT
Firebase - realtime backend for mobile app and IoTFirebase - realtime backend for mobile app and IoT
Firebase - realtime backend for mobile app and IoT
 
How to build Android Chat App with Firebase for 2 hours?
How to build Android Chat App with Firebase for 2 hours?How to build Android Chat App with Firebase for 2 hours?
How to build Android Chat App with Firebase for 2 hours?
 
Online mobile game server use Firebase realtime aatabase
Online mobile game server use Firebase realtime aatabaseOnline mobile game server use Firebase realtime aatabase
Online mobile game server use Firebase realtime aatabase
 
Firebase Android
Firebase AndroidFirebase Android
Firebase Android
 
Firebase with Android
Firebase with AndroidFirebase with Android
Firebase with Android
 
Firebase for the Web
Firebase for the WebFirebase for the Web
Firebase for the Web
 
Serverless - State Of the Union
Serverless - State Of the UnionServerless - State Of the Union
Serverless - State Of the Union
 
Creating Real-Time Data Mashups with Node.JS and Adobe CQ
Creating Real-Time Data Mashups with Node.JS and Adobe CQCreating Real-Time Data Mashups with Node.JS and Adobe CQ
Creating Real-Time Data Mashups with Node.JS and Adobe CQ
 
Introduction to Firebase
Introduction to FirebaseIntroduction to Firebase
Introduction to Firebase
 
Introducing firebase
Introducing firebaseIntroducing firebase
Introducing firebase
 
State of the Union: Containers on AWS
State of the Union: Containers on AWSState of the Union: Containers on AWS
State of the Union: Containers on AWS
 
Amazon ECS Deep Dive
Amazon ECS Deep DiveAmazon ECS Deep Dive
Amazon ECS Deep Dive
 
Kubernetes on AWS
Kubernetes on AWSKubernetes on AWS
Kubernetes on AWS
 
Advanced Container Management and Scheduling
Advanced Container Management and SchedulingAdvanced Container Management and Scheduling
Advanced Container Management and Scheduling
 
Advanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step FunctionsAdvanced Serverless Apps With Step Functions
Advanced Serverless Apps With Step Functions
 
Deep dive into AWS fargate
Deep dive into AWS fargateDeep dive into AWS fargate
Deep dive into AWS fargate
 
Serverless Developer Experience
Serverless Developer ExperienceServerless Developer Experience
Serverless Developer Experience
 
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
Introduction to Google App Engine - Naga Rohit S [ IIT Guwahati ] - Google De...
 
Introduction to Google App Engine with Python
Introduction to Google App Engine with PythonIntroduction to Google App Engine with Python
Introduction to Google App Engine with Python
 
API Basics
API BasicsAPI Basics
API Basics
 

Similar to ThreeBase: Firebase in 3 minutes or less

Firebase
Firebase Firebase
Android writing and reading from firebase
Android writing and reading from firebaseAndroid writing and reading from firebase
Android writing and reading from firebase
Osahon Gino Ediagbonya
 
I/O Extended (GDG Bogor) - Sidiq Permana
I/O Extended (GDG Bogor) - Sidiq PermanaI/O Extended (GDG Bogor) - Sidiq Permana
I/O Extended (GDG Bogor) - Sidiq Permana
Dicoding
 
Real timechat firebase
Real timechat firebaseReal timechat firebase
Real timechat firebase
Senthilkumar Murugesan
 
Introduction, Examples - Firebase
Introduction, Examples - Firebase Introduction, Examples - Firebase
Introduction, Examples - Firebase
Eueung Mulyana
 
Intro to Firebase Realtime Database and Authentication
Intro to Firebase Realtime Database and AuthenticationIntro to Firebase Realtime Database and Authentication
Intro to Firebase Realtime Database and Authentication
kristinferrier
 
Firebase integration with Flutter
Firebase integration with FlutterFirebase integration with Flutter
Firebase integration with Flutter
pmgdscunsri
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 Firebase overview
Maksym Davydov
 
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Chris Adamson
 
Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)
Chris Adamson
 
Introduction to Firebase on Android
Introduction to Firebase on AndroidIntroduction to Firebase on Android
Introduction to Firebase on Android
amsanjeev
 
Introducing-Firebase.pptxehehshhdhdhdhdhhd
Introducing-Firebase.pptxehehshhdhdhdhdhhdIntroducing-Firebase.pptxehehshhdhdhdhdhhd
Introducing-Firebase.pptxehehshhdhdhdhdhhd
taxakhirpara1224
 
Firebase
FirebaseFirebase
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase Integration
WebStackAcademy
 
Firebase overview
Firebase overviewFirebase overview
Firebase overview
Maksym Davydov
 
Google Firebase
Google FirebaseGoogle Firebase
Google Firebase
AliZaidi94
 
Firebase-ized your mobile app
Firebase-ized  your mobile appFirebase-ized  your mobile app
Firebase-ized your mobile app
Matteo Bonifazi
 
Firebase Realtime Database and Remote Config in Practice - DroidCon Moscow 2016
Firebase Realtime Database and Remote Config in Practice - DroidCon Moscow 2016Firebase Realtime Database and Remote Config in Practice - DroidCon Moscow 2016
Firebase Realtime Database and Remote Config in Practice - DroidCon Moscow 2016
Sergey Smetanin
 
Firebase
FirebaseFirebase
Firebase
Manasa Mona
 
Firebase.pptx
Firebase.pptxFirebase.pptx
Firebase.pptx
TanviBudhabaware
 

Similar to ThreeBase: Firebase in 3 minutes or less (20)

Firebase
Firebase Firebase
Firebase
 
Android writing and reading from firebase
Android writing and reading from firebaseAndroid writing and reading from firebase
Android writing and reading from firebase
 
I/O Extended (GDG Bogor) - Sidiq Permana
I/O Extended (GDG Bogor) - Sidiq PermanaI/O Extended (GDG Bogor) - Sidiq Permana
I/O Extended (GDG Bogor) - Sidiq Permana
 
Real timechat firebase
Real timechat firebaseReal timechat firebase
Real timechat firebase
 
Introduction, Examples - Firebase
Introduction, Examples - Firebase Introduction, Examples - Firebase
Introduction, Examples - Firebase
 
Intro to Firebase Realtime Database and Authentication
Intro to Firebase Realtime Database and AuthenticationIntro to Firebase Realtime Database and Authentication
Intro to Firebase Realtime Database and Authentication
 
Firebase integration with Flutter
Firebase integration with FlutterFirebase integration with Flutter
Firebase integration with Flutter
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 Firebase overview
 
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
Firebase: Totally Not Parse All Over Again (Unless It Is) (CocoaConf San Jose...
 
Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)Firebase: Totally Not Parse All Over Again (Unless It Is)
Firebase: Totally Not Parse All Over Again (Unless It Is)
 
Introduction to Firebase on Android
Introduction to Firebase on AndroidIntroduction to Firebase on Android
Introduction to Firebase on Android
 
Introducing-Firebase.pptxehehshhdhdhdhdhhd
Introducing-Firebase.pptxehehshhdhdhdhdhhdIntroducing-Firebase.pptxehehshhdhdhdhdhhd
Introducing-Firebase.pptxehehshhdhdhdhdhhd
 
Firebase
FirebaseFirebase
Firebase
 
Angular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase IntegrationAngular - Chapter 6 - Firebase Integration
Angular - Chapter 6 - Firebase Integration
 
Firebase overview
Firebase overviewFirebase overview
Firebase overview
 
Google Firebase
Google FirebaseGoogle Firebase
Google Firebase
 
Firebase-ized your mobile app
Firebase-ized  your mobile appFirebase-ized  your mobile app
Firebase-ized your mobile app
 
Firebase Realtime Database and Remote Config in Practice - DroidCon Moscow 2016
Firebase Realtime Database and Remote Config in Practice - DroidCon Moscow 2016Firebase Realtime Database and Remote Config in Practice - DroidCon Moscow 2016
Firebase Realtime Database and Remote Config in Practice - DroidCon Moscow 2016
 
Firebase
FirebaseFirebase
Firebase
 
Firebase.pptx
Firebase.pptxFirebase.pptx
Firebase.pptx
 

Recently uploaded

Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
mahaffeycheryld
 
Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
sachin chaurasia
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
ijseajournal
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
ecqow
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
CVCSOfficial
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
PreethaV16
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
PreethaV16
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
21UME003TUSHARDEB
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
Prakhyath Rai
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
nedcocy
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
upoux
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
Roger Rozario
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
PriyankaKilaniya
 
Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...
cannyengineerings
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
vmspraneeth
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
VANDANAMOHANGOUDA
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
upoux
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
Kamal Acharya
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
harshapolam10
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
shadow0702a
 

Recently uploaded (20)

Generative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdfGenerative AI Use cases applications solutions and implementation.pdf
Generative AI Use cases applications solutions and implementation.pdf
 
Mechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineeringMechatronics material . Mechanical engineering
Mechatronics material . Mechanical engineering
 
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...Call For Paper -3rd International Conference on Artificial Intelligence Advan...
Call For Paper -3rd International Conference on Artificial Intelligence Advan...
 
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
一比一原版(CalArts毕业证)加利福尼亚艺术学院毕业证如何办理
 
TIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptxTIME TABLE MANAGEMENT SYSTEM testing.pptx
TIME TABLE MANAGEMENT SYSTEM testing.pptx
 
OOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming languageOOPS_Lab_Manual - programs using C++ programming language
OOPS_Lab_Manual - programs using C++ programming language
 
Object Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOADObject Oriented Analysis and Design - OOAD
Object Oriented Analysis and Design - OOAD
 
Mechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdfMechanical Engineering on AAI Summer Training Report-003.pdf
Mechanical Engineering on AAI Summer Training Report-003.pdf
 
Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...Software Engineering and Project Management - Introduction, Modeling Concepts...
Software Engineering and Project Management - Introduction, Modeling Concepts...
 
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
一比一原版(爱大毕业证书)爱荷华大学毕业证如何办理
 
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
一比一原版(osu毕业证书)美国俄勒冈州立大学毕业证如何办理
 
Transformers design and coooling methods
Transformers design and coooling methodsTransformers design and coooling methods
Transformers design and coooling methods
 
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
Prediction of Electrical Energy Efficiency Using Information on Consumer's Ac...
 
Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...Pressure Relief valve used in flow line to release the over pressure at our d...
Pressure Relief valve used in flow line to release the over pressure at our d...
 
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICSUNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
UNIT 4 LINEAR INTEGRATED CIRCUITS-DIGITAL ICS
 
ITSM Integration with MuleSoft.pptx
ITSM  Integration with MuleSoft.pptxITSM  Integration with MuleSoft.pptx
ITSM Integration with MuleSoft.pptx
 
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
一比一原版(uofo毕业证书)美国俄勒冈大学毕业证如何办理
 
Blood finder application project report (1).pdf
Blood finder application project report (1).pdfBlood finder application project report (1).pdf
Blood finder application project report (1).pdf
 
SCALING OF MOS CIRCUITS m .pptx
SCALING OF MOS CIRCUITS m                 .pptxSCALING OF MOS CIRCUITS m                 .pptx
SCALING OF MOS CIRCUITS m .pptx
 
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...
 

ThreeBase: Firebase in 3 minutes or less

  • 1. ThreeBase Firebase in 3 minutes or less. by Mayank Mohan Upadhyay linkedin.com/in/mumayank
  • 2. Topics covered: Prerequisite: Firebase> docs> android> quickguide 1. What is Firebase? 2. Is Firebase for me? 3. Understanding data in Firebase 4. Saving and Retrieving data 5. Security options 6. Offline feature
  • 3. What is Firebase? Firebase is: a cloud services provider and backend as a service company based in San Francisco, California founded in 2011 by Andrew Lee and James Tamplin launched with a realtime cloud database in April 2012. Firebase's primary product is a realtime database which provides an API that allows developers to store and sync data across multiple clients.
  • 4. What is Firebase… in simple terms, please? OK, so Firebase is basically a simple online database that offers: real-time data syncs has offline capabilities provides security measures
  • 5. Is Firebase for me? You should switched to Firebase if your app: backend has basic database structure requires no complex queries on database requires an online database which can be synced across devices in real-time requires simple communication with server on-the-go requires a combination of quick real-time database setup + security You may also switch a node of your app backend to Firebase if that part satisfies any of the above criteria.
  • 6. Understanding data in Firebase All Firebase database data is stored as JSON objects. { "users": { "friends": { "brinchen": true }, "name": "Mary Chen" } }
  • 7. Saving Data setValue( ) Write or replace data to a defined path, like messages/users/<username> updateChildren( ) Update some of the keys for a defined path without replacing all of the data push( ) Add to a list of data in your Firebase database. Every time you call push() Firebase generates a unique ID, like messages/users/<unique-user-id>/<username> runTransaction( ) Use our transactions feature when working with complex data that could be corrupted by
  • 8. If you'd like to know when your data has been committed, you can add a completion listener: ref.setValue("I'm writing data", new Firebase.CompletionListener() { @Override public void onComplete(FirebaseError firebaseError, Firebase firebase) { if (firebaseError != null) { System.out.println("Data could not be saved. " + firebaseError.getMessage()); } else { System.out.println("Data saved successfully."); } } });
  • 9. Reading Data With Firebase queries, we can selectively retrieve data based on various factors. To construct a query, you start by specifying how you want your data to be ordered using one of the ordering functions: orderByChild(), orderByKey(), orderByValue(), or orderByPriority(). You can then combine these with five other methods to conduct complex queries: limitToFirst(), limitToLast(), startAt(), endAt(), and equalTo().
  • 10. Security Options Authentication Valid user entry (password entry) Authorization Defining permissions of each user Rules: .read .write .validate
  • 11. Offline feature Firebase apps automatically handle temporary network interruptions for you. Cached data will still be available while offline and your writes will be resent when network connectivity is recovered. But if the app is restarted, unsent data will be lost. Enabling disk persistence allows our app to also keep all of its state even after an app restart. We can enable disk persistence with just one line of code. Firebase.getDefaultConfig().setPersistenceEnabled(true); With disk persistence enabled, our synced data and writes will be persisted to disk across app restarts and our app should work seamlessly in offline situations.
  • 12. Offline feature Firebase synchronizes and stores a local copy of the data for active listeners. In addition, you can keep specific locations in sync. scoresRef.keepSynced(true); The client will automatically download the data at these locations and keep it in sync even if the reference has no active listeners. You can turn synchronization back off with the following line of code. scoresRef.keepSynced(false); By default, 10MB of previously synced data will be cached. This should be enough for most applications. If the cache outgrows its configured size, Firebase will purge data that has been used least recently. Data that is kept in sync, will not
  • 13. Thank You! Questions are welcomed, Feedback is appreciated!