SlideShare a Scribd company logo
Dennis Alund
Founder Kumpul Coworking Space
Google Developer Expert for Firebase
Prerequisites
Some basic knowledge about Firebase
Preferably played with Firebase
Good understanding of source code management
Some of the things you will take from here
What cloud functions are
Ideas of where Firebase cloud functions could fit into your
existing project and what you can do with Firebase
Devops
How to Firebase like a boss
What are cloud functions?
IAAS PAAS FAAS
y = f(x)
Evolution of the cloud
Where are the cloud functions!?
Firebase Cloud Functions
What can cloud functions do?
Triggers
1. Writes to real time database
2. Uploads to storage bucket
3. New user authentication (create/delete)
4. Firebase Cloud Messaging
5. Analytics conversion event
6. Incoming HTTPS request
Writes to real time database
FCM notify user when someone likes a post
Update counter of likes on a post
Transform data
Fan out data
Move chat logs to “archive” after some time or certain amount
of child nodes
/posts/{id}/likes/{uid}
1
2
3
Trigger on data
change (CRUD)
Write back likes count
Write post like
data
Update counter of likes on a post
/posts/{id}/likes_count/{num}
/posts/{id}/likes/{uid}
1
2
Trigger on data
change (CRUD)
FCM to
client
device(s)
Write post
like data
FCM notify user when someone likes a post
34
Notify
new likes
/posts/{id}
1
2
3
Trigger on data
change (CRUD)
Write new data
Write post
data
Fan out data
/user_posts/{uid}/{id}
/topic_posts/{topic}/{id}
Uploads to storage bucket
Make thumbnails and upload them back to the storage bucket
Notify user over cloud messaging that there are new
documents/attachments
Update a counter of how many documents a user has, or how
much space is used
New user authentication (create/delete)
Send a welcome email (or further instructions after signing
up)
Scaffold initial default account data (make entries in database
where needed for new users)
Delete user data when the account is deleted (chat logs, etc)
Firebase Cloud Messaging
Count most active FCM topics
Trending data in FCM notifications to group messages
Analytics conversion event
Send a coupon to client after first purchase.
Send a discount code to client that has invited a friend.
Incoming HTTPS request
Replace a need for API framework (flask etc)
Third party integrations with Firebase (webhooks)
Serve a static page generated from Firebase database data
How do you create a function?
Cloud Functions Development
Runs on NodeJS
Javascript is a deceptive language. It looks like a simple
language. Sometimes you expect it to work in one way, but
you would be surprised how often it’s not the case.
Planned support for other languages in pipeline… anyone
guessing on Go?
USE TYPESCRIPT
Firebase Cloud Functions
/posts/{id}/likes/{uid}
1
2
3
Trigger on data
change (CRUD)
Write back likes count
Write post like
data
Update counter of likes on a post
/posts/{id}/likes_count/{num}
Firebase Cloud Functions
DIVIDE AND CONQUER.
A CLOUD FUNCTION CAN ONLY
EXECUTE FOR 60 SECONDS
DEVOPS
ONE REPOSITORY PER
PLATFORM
ONE REPOSITORY DEDICATED
FOR DATABASE RULES AND
CLOUD FUNCTIONS
4
1
git pull
(index.ts)
git push
(index.ts)
2
3
coding
(index.ts)
compile
(index.js)
5
firebase deploy
(index.js)
index.ts
{}
CONTINUOUS INTEGRATION FOR
AUTOMATED BUILD, DEPLOY AND
HOUSEKEEPING
4
git pull
(index.ts)
index.ts
{}
git push
(index.ts)
2
3
coding
(index.ts)
compile
(index.js)
firebase deploy
(index.js)
continuous
integration
5 6
7
8
git push
(index.ts,
index.js)
cloud
debugging
1
A lot to master..
Database structuring (hello SQL developers!)
Reactive programming
Analytics (knowing your users is your #1 priority)
Concurrent, asynchronous, distributed
Dennis Alund
github.com/DennisAlund
medium.com/evenbit
Google Developer
Expert Firebase
Kumpul Coworking
Space
www.kumpul.co
Oddbit
www.oddbit.id

More Related Content

PPTX
Getting Started with Firebase Cloud Functions
PPTX
Google Firebase
PPTX
Firebase
PPTX
Firebase PPT
PPTX
Google Firebase Presentation
PPTX
Firebase
PDF
Firebase on Android: The Big Picture
PPTX
Firebase in action
Getting Started with Firebase Cloud Functions
Google Firebase
Firebase
Firebase PPT
Google Firebase Presentation
Firebase
Firebase on Android: The Big Picture
Firebase in action

What's hot (19)

PDF
Introduction to Firebase from Google
PDF
O365Con18 - Create an Immersive Experience with Office365 Data and Mixed Real...
PPTX
Firebase
PDF
Building Extraordinary Apps with Firebase Analytics
PPTX
Introducing firebase
PDF
Firebase in action 2021
PPTX
Discover Google Firebase Platform
PPTX
PDF
Firebase hosting
PDF
Getting started with Firebase
PPTX
Logic apps and PowerApps - Integrate across your APIs
PDF
Intro firebase
PPTX
What is new in Firebase?
PPTX
Building Push Triggers for Logic Apps
PPTX
Public v1 real world example of azure functions serverless conf london 2016
PDF
Building Event-Driven Serverless Applications
PDF
O365Con18 - PowerApps build custom forms for SharePoint with Azure Maps - Bra...
PDF
The Firebase tier for your mobile app - DevFest CH
PDF
iOSDevCamp Firebase Overview
Introduction to Firebase from Google
O365Con18 - Create an Immersive Experience with Office365 Data and Mixed Real...
Firebase
Building Extraordinary Apps with Firebase Analytics
Introducing firebase
Firebase in action 2021
Discover Google Firebase Platform
Firebase hosting
Getting started with Firebase
Logic apps and PowerApps - Integrate across your APIs
Intro firebase
What is new in Firebase?
Building Push Triggers for Logic Apps
Public v1 real world example of azure functions serverless conf london 2016
Building Event-Driven Serverless Applications
O365Con18 - PowerApps build custom forms for SharePoint with Azure Maps - Bra...
The Firebase tier for your mobile app - DevFest CH
iOSDevCamp Firebase Overview
Ad

Similar to Firebase Cloud Functions (20)

PDF
O365Con18 - Reach for the Cloud Build Solutions with the Power of Microsoft G...
PDF
Freshdesk to Salesforce Migration-Tenetizer Technologies
PPT
Amazon Webservice & Cloud Computing
PPTX
Serverless computing
PDF
ECS19 - Bill Ayers - UNLOCK YOUR BUSINESS KNOWLEDGE WITH THE MICROSOFT GRAPH,...
PPTX
Facebook Messenger Platform Framework
PPTX
Azure Machine Learning
PPTX
Firebase integration with Flutter
PDF
Data Con LA 2022 - What's new with MongoDB 6.0 and Atlas
PDF
Hybrid Kafka, Taking Real-time Analytics to the Business (Cody Irwin, Google ...
PDF
Datageeks
PPTX
AzureFest
PPTX
Mike Taulty MIX10 Silverlight Frameworks and Patterns
PPT
Visual Studio .NET2010
PPTX
Overview of VS2010 and .NET 4.0
PPTX
Microsoft Ignite Recap: SharePoint & OneDrive for Business with Vlad & Drew
PDF
Strategies for Context Data Persistence
PPT
Lecture 6 Data Driven Design
PPT
ArcReady - Architecting For The Cloud
PDF
Devfest SouthWest, Nigeria - Firebase
O365Con18 - Reach for the Cloud Build Solutions with the Power of Microsoft G...
Freshdesk to Salesforce Migration-Tenetizer Technologies
Amazon Webservice & Cloud Computing
Serverless computing
ECS19 - Bill Ayers - UNLOCK YOUR BUSINESS KNOWLEDGE WITH THE MICROSOFT GRAPH,...
Facebook Messenger Platform Framework
Azure Machine Learning
Firebase integration with Flutter
Data Con LA 2022 - What's new with MongoDB 6.0 and Atlas
Hybrid Kafka, Taking Real-time Analytics to the Business (Cody Irwin, Google ...
Datageeks
AzureFest
Mike Taulty MIX10 Silverlight Frameworks and Patterns
Visual Studio .NET2010
Overview of VS2010 and .NET 4.0
Microsoft Ignite Recap: SharePoint & OneDrive for Business with Vlad & Drew
Strategies for Context Data Persistence
Lecture 6 Data Driven Design
ArcReady - Architecting For The Cloud
Devfest SouthWest, Nigeria - Firebase
Ad

More from Yoza Aprilio (20)

PPTX
IoT Platform with MQTT and Websocket
PPTX
Pembuatan Aplikasi Multiplatform dengan Xamarin Forms
PPTX
Build Virtual Customer Service using IBM Watson
PPTX
Image Recognition service using IBM Watson made easy
PPTX
IoT Industry in Indonesia
DOCX
Game Tizen Unity
DOCX
Membuat Hello World Pada Tizen
PPTX
Introduction to Depedency Injection in Android
PDF
Memulai Pengembangan Game dengan Mudah
PPTX
Fast-track tips for Web Developer
PPTX
Beginner's Guide to React & Redux Development
PPTX
Internet of Things 101
PPTX
IoT and Machine Learning
PPTX
Tantangan Produk IoT di Indonesia
PDF
Design, Launch and Fundraising
PDF
Product Development in Startup Environment : Build The Right Thing and Build ...
PPTX
Agile Development over Distributed Teams
PDF
Resep Memanfaatkan Hidden Resources
PPTX
Seni Membangun Startup
PPTX
Menjadi Tuan Rumah di Negeri Sendiri
IoT Platform with MQTT and Websocket
Pembuatan Aplikasi Multiplatform dengan Xamarin Forms
Build Virtual Customer Service using IBM Watson
Image Recognition service using IBM Watson made easy
IoT Industry in Indonesia
Game Tizen Unity
Membuat Hello World Pada Tizen
Introduction to Depedency Injection in Android
Memulai Pengembangan Game dengan Mudah
Fast-track tips for Web Developer
Beginner's Guide to React & Redux Development
Internet of Things 101
IoT and Machine Learning
Tantangan Produk IoT di Indonesia
Design, Launch and Fundraising
Product Development in Startup Environment : Build The Right Thing and Build ...
Agile Development over Distributed Teams
Resep Memanfaatkan Hidden Resources
Seni Membangun Startup
Menjadi Tuan Rumah di Negeri Sendiri

Recently uploaded (20)

PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Lesson notes of climatology university.
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
master seminar digital applications in india
PDF
TR - Agricultural Crops Production NC III.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Sports Quiz easy sports quiz sports quiz
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
01-Introduction-to-Information-Management.pdf
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PDF
Insiders guide to clinical Medicine.pdf
PDF
Computing-Curriculum for Schools in Ghana
PDF
Microbial disease of the cardiovascular and lymphatic systems
102 student loan defaulters named and shamed – Is someone you know on the list?
Lesson notes of climatology university.
PPH.pptx obstetrics and gynecology in nursing
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Microbial diseases, their pathogenesis and prophylaxis
Module 4: Burden of Disease Tutorial Slides S2 2025
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Final Presentation General Medicine 03-08-2024.pptx
master seminar digital applications in india
TR - Agricultural Crops Production NC III.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
RMMM.pdf make it easy to upload and study
VCE English Exam - Section C Student Revision Booklet
Sports Quiz easy sports quiz sports quiz
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
01-Introduction-to-Information-Management.pdf
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Insiders guide to clinical Medicine.pdf
Computing-Curriculum for Schools in Ghana
Microbial disease of the cardiovascular and lymphatic systems

Firebase Cloud Functions

Editor's Notes

  • #3: QUESTIONS: Anyone worked with Firebase before? Anyone who is using Firebase functions in a project right now?
  • #6: From OWN to IAAS => Assume that it would be better if the hardware was managed by someone else. Someone whose business it is to take care of it. From IAAS to PAAS => Assume that infrastructure is something that is not crucial for you to tweak. What if it just works better with a really good server? From PAAS to IAAS => Assume that we’re having a really good framework managing our API endpoints, triggers etc. What if you just wrote functions. Anyone ever developed a plugin for WordPress?
  • #8: Data centers around the world host your cloud apps. Currently FB Cloud functions are only served from US data center (still beta) Serviced environment Auto scaling infrastructure. Very small and lightweight servers. New server instances are spun up to serve your code. Instances shut down when no longer in use. Pay for instances used. 10 times in parallel is the same as 10 times after each other.
  • #18: React to categories of actions rather than individual actions. We can act on database entries, but what if we want to react on anything that is categorized as a “conversion event”
  • #21: Javascript. If you don’t know Javascript development for NodeJS, now is a time to start learning
  • #22: Use Typescript, it is closer to how you probably think that Javascript works. Developed by Microsoft and opensource.
  • #26: Try to do only ONE thing in each function. Make another function if you need to do more than one thing that is independent of the other (i.e. can’t divide if we want to know the result of the first action: atomic operations etc)
  • #31: Local development. Debugging is easy. Cloud apps. Debuggig a bit tricker.