0% found this document useful (0 votes)
290 views12 pages

FIREBASE Edited Presentation

Firebase is a comprehensive platform developed by Google that offers a wide range of tools and services for developing and managing web and mobile applications. It provides features such as a realtime database, authentication, cloud firestore, cloud storage, and more. The realtime database is structured and uses a JSON-like hierarchical structure, while cloud firestore is more flexible and can handle both structured and unstructured data through its advanced querying and data modeling capabilities. Developers can create databases in firebase by setting up a project, enabling the realtime database or cloud firestore, adding data, and configuring security rules. CRUD operations involve interacting with the firebase database using the appropriate SDK to create, read, update, and delete data.

Uploaded by

Niraj Mirgal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
290 views12 pages

FIREBASE Edited Presentation

Firebase is a comprehensive platform developed by Google that offers a wide range of tools and services for developing and managing web and mobile applications. It provides features such as a realtime database, authentication, cloud firestore, cloud storage, and more. The realtime database is structured and uses a JSON-like hierarchical structure, while cloud firestore is more flexible and can handle both structured and unstructured data through its advanced querying and data modeling capabilities. Developers can create databases in firebase by setting up a project, enabling the realtime database or cloud firestore, adding data, and configuring security rules. CRUD operations involve interacting with the firebase database using the appropriate SDK to create, read, update, and delete data.

Uploaded by

Niraj Mirgal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 12

FIREBASE

What is Firebase ?
Firebase is a comprehensive platform developed by Google that offers a wide
range of tools and services for developing and managing, web and mobile
applications. It's designed to help developers build high-quality apps more
efficiently by providing a unified backend infrastructure and a set of powerful
features. Firebase covers various aspects of app development, including
Authentication, Realtime Databases, Cloud Firestore, Storage, Hosting, Analytics,
and more.
The key features and services offered by firebase :
1. Realtime database: Firebase is a cloud-based NoSQL database that lets
developers store and sync data in real-time across several clients. Building
collaborative apps or applications that need real-time updates will find this to be
especially helpful.
2. Authentication: Firebase provides a straightforward approach of incorporating
authentication into your project, supporting techniques like email/password, social
network logins (such as Google, Facebook, and Twitter), and custom authentication
systems.
3. Cloud Firestore: The next-generation cloud database from Firebase, it offers more
sophisticated querying features and a more adaptable data schema than the real-time
database.
4. Cloud Storage: For storing and providing user-generated material like photographs,
videos, and files, Firebase offers a safe and scalable cloud storage solution.
What type of firebase is structured or unstructured database ?

1. Structured Database: A structured database is a common term to describe the original real-time
database used by Firebase. It's a NoSQL database that arranges data in a manner akin to JSON. This
database is made to store and synchronize data across several clients in real time. Data is arranged into
a tree-like style with key-value pairs in this hierarchical structure.
2. Unstructured database: Cloud Firestore, a more recent database option from Firebase, is more
adaptable and able to handle both structured and unstructured data. Although firestore is also a NoSQL
database, it focuses on scalability and offers more sophisticated querying capabilities and flexible data
modeling. You may arrange data in a way that best matches the requirements of your app because it
allows hierarchical data structures like documents and collections.
Although both the Real-time database and Cloud Firestore may be used for structured data, Cloud
Firestore is more suited for situations when you require more flexibility in how your data is stored and
accessible due to its querying capabilities and more complex data modeling possibilities.
In conclusion, Cloud Firestore offers a more adaptable and powerful solution for managing both
structured and unstructured data in a NoSQL database environment than Real-time database, which is
mostly organized in a JSON-like manner.
How to create database in firebase ?
There are two main ways to build a database in Firebase: Firebase Realtime
Database and Cloud Firestore.
The fundamental procedures for making a database using both choices are listed
below :
Realtime Database :
1. Create a Firebase Project :
- Go to the [Firebase Console] (https://console.firebase.google.com/) and create a new project or select an existing
one.
2. Enable the Realtime Database :
- In the Firebase Console, navigate to the "Database" section.
- Click on "Create Database" and choose the "Start in test mode" option if you're just getting started. This allows
you to set up security rules later.
3. Add Data :
- Once your database is created, you can start adding data. Data is stored in a JSON-like format with keys and
values.
- You can manually add data through the Firebase Console or programmatically using the Firebase SDKs.
4. Set Security Rules :
- It's important to secure your database by setting appropriate security rules. These rules define who can read and
write data in your database.
- Navigate to the "Rules" tab in the Database section of the Firebase Console and set your security rules according
to your app's requirements.
Cloud Firestore :
1. Create a Firebase Project :
- Go to the [Firebase Console] (https://console.firebase.google.com/) and create a new project or select an
existing one.
2. Enable Cloud Firestore :
- In the Firebase Console, navigate to the "Database" section.
- Click on "Create Database" and choose the "Start in production mode" option. you'll have the option to choose
Cloud Firestore.
3. Add Data :
- Once your Firestore Database is created, you can start adding data.
- Firestore uses a Collection-Document-Subcollection Structure. you can create collections to store documents
and subcollections within documents.
- You can manually add data through the Firebase Console or programmatically using the Firebase SDKs.
4. Set Security Rules :
- Similar to the Realtime Database, you should set security rules for Firestore to control access to your data.
- Navigate to the "Rules" tab in the Firestore section of the Firebase Console and configure your security rules.
How to CRUD operation perform in firebase ?
Performing CRUD (Create, Read, Update, Delete) operations in Firebase involves
interacting with the Firebase database using the appropriate SDK for your platform
(Web, Android, iOS, etc.).
Here's a basic overview of how to perform each CRUD operation using Firebase
as an example :
Create (C) Operation :
To add new data to your Firebase database :
Javascript :
//Assuming you are using the Firebase Web SDK and Initialize Firebase
var firebaseConfig = {
apiKey: "YOUR_API_KEY",
authDomain: "YOUR_AUTH_DOMAIN",
projectId: "YOUR_PROJECT_ID",
storageBucket: "YOUR_STORAGE_BUCKET",
messagingSenderId: "YOUR_MESSAGING_SENDER_ID",
appId: "YOUR_APP_ID"
};
firebase.initializeApp(firebaseConfig) ;
// Get a reference to your database
var database = firebase.database();
// Add data
var newData = {
name: "Niraj Mirgal",
email: "[email protected]"
};
database.ref("users").push(newData);
Read (R) Operation :
To retrieve data from your Firebase database :
javascript :
// Assuming you are using the Firebase Web SDK and Get a reference to the data you want to read
var usersRef = database.ref("users");
// Retrieve data
usersRef.once("value").then(function(snapshot) {
snapshot.forEach(function(childSnapshot) {
var childData = childSnapshot.val();
console.log(childData);
});
});
Update (U) Operation :
To update existing data in your Firebase database :
Javascript :
// Assuming you are using the Firebase Web SDK and Get a reference to the data you want to
update
var userRef = database.ref("users/userId");
// Update data
userRef.update({
name: "Updated Name"
});
Delete (D) Operation :
To remove data from your Firebase database :
Javascript :
// Assuming you are using the Firebase Web SDK and Get a reference to the data
you want to delete
var userRef = database.ref("users/userId");
// Delete data
userRef.remove();

You might also like