SlideShare a Scribd company logo
1 of 13
Tips & tricks for Firebase
Storage & Functions
David Vávra, Android GDE
Firebase Storage
● For saving large binary files (images, video, audio etc.)
● Not for structured data (use Realtime DB or Firestore for that)
● Built on top of Google Cloud Storage
● Serverless: clients access it directly, servers are another clients
● Indefinite scalability
● SDKs for Android, iOS, Web + REST
● Security rules similar to Database rules
○ can contain validation rules (“must be PNG & <5 MB”)
Firebase Storage pricing
● $0.026/GB stored (vs $5/GB for RTDB)
● $0.12/GB downloaded (vs $1/GB for RTDB)
Free tier:
● 5 GB stored
● 1GB downloaded / day
Settle Up April 2018:
● free
How we use it at Settle Up
● Pictures of users
● Receipts for expenses
● Images for campaigns
● Archive of old groups from Database
Tips
● Save Storage URLs to Database
● Make sure it works offline
○ save local path first to Database
○ schedule task for uploading later (WorkManager on Android)
○ change URL in Database
● You can use Storage for archiving data from Realtime DB
● .NET?
○ https://github.com/step-up-labs/firebase-storage-dotnet
Cloud Functions
● Javascript/Typescript code triggered by events
● No server management, infinite scalability
● So simple that frontend developers can write it :)
● Useful when:
○ you can’t trust the client
○ reusing logic for clients
○ saving resources for clients
○ data consistency
Triggers
● Firestore
● Realtime DB
● Authentication
● Google Analytics
● Crashlytics
● Storage
● Pub/Sub
● HTTP
Functions pricing
● $0.40/million invocations
● $0.0025/thousand GB-seconds, $0.01/thousand CPU-seconds
● $0.12/GB of outbound networking
Free tier:
● 125K invocations/month, networking Google only
Settle Up April 2018:
● 543K CPU seconds, 2.3M invocations = $3.5
How we use it at Settle Up
● verifying purchases & subscriptions
● moving some HTTP logic to server side
○ adding permissions
○ archiving/restoring groups
○ delete all expenses
○ shortening Dynamic Links
● periodically update exchange rates
● generating history of changes
● cleanup (removing invalid URLs)
● Google Assistant fulfilment
Tips
● Use Typescript and VS Code as editor
● We tried Kotlin and it’s possible, but cumbersome
● Cron functionality is missing, we use Google AppEngine which does HTTP
trigger
● Test functions locally, libraries mocha, sinon and chai are useful
● Deploy functions via CI
Q&A
Follow me:
twitter.com/vavradav
medium.com/@david.vavra
This presentation: http://bit.ly/fbsf-pl

More Related Content

Similar to Tips & tricks for Firebase storage and Firebase functions

Traveloka's journey to no ops streaming analytics
Traveloka's journey to no ops streaming analyticsTraveloka's journey to no ops streaming analytics
Traveloka's journey to no ops streaming analyticsRendy Bambang Junior
 
Google App Engine Introduction
Google App Engine IntroductionGoogle App Engine Introduction
Google App Engine IntroductionSimon Su
 
Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)rc2209
 
Logs @ OVHcloud
Logs @ OVHcloudLogs @ OVHcloud
Logs @ OVHcloudOVHcloud
 
Web App Prototypes with Google App Engine
Web App Prototypes with Google App EngineWeb App Prototypes with Google App Engine
Web App Prototypes with Google App EngineVlad Filippov
 
Gobblin @ NerdWallet (Nov 2015)
Gobblin @ NerdWallet (Nov 2015)Gobblin @ NerdWallet (Nov 2015)
Gobblin @ NerdWallet (Nov 2015)NerdWalletHQ
 
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | EnglishAWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | EnglishOmid Vahdaty
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Pythonwesley chun
 
Exploring BigData with Google BigQuery
Exploring BigData with Google BigQueryExploring BigData with Google BigQuery
Exploring BigData with Google BigQueryDharmesh Vaya
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlSeveralnines
 
Evolution of DBA in the Cloud Era
 Evolution of DBA in the Cloud Era Evolution of DBA in the Cloud Era
Evolution of DBA in the Cloud EraMydbops
 
Webinar: Building a multi-cloud Kubernetes storage on GitLab
Webinar: Building a multi-cloud Kubernetes storage on GitLabWebinar: Building a multi-cloud Kubernetes storage on GitLab
Webinar: Building a multi-cloud Kubernetes storage on GitLabMayaData Inc
 
Piano Media - approach to data gathering and processing
Piano Media - approach to data gathering and processingPiano Media - approach to data gathering and processing
Piano Media - approach to data gathering and processingMartinStrycek
 
Automating using Ansible
Automating using AnsibleAutomating using Ansible
Automating using AnsibleAlok Patra
 
Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3  Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3 Omid Vahdaty
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGearsAlessandro Molina
 
A Planet-Scale Database for Low Latency Transactional Apps by Yugabyte
A Planet-Scale Database for Low Latency Transactional Apps by YugabyteA Planet-Scale Database for Low Latency Transactional Apps by Yugabyte
A Planet-Scale Database for Low Latency Transactional Apps by YugabyteCarlos Andrés García
 
A Planet-Scale Database for Low Latency Transactional Apps by Yugabyte
A Planet-Scale Database for Low Latency Transactional Apps by YugabyteA Planet-Scale Database for Low Latency Transactional Apps by Yugabyte
A Planet-Scale Database for Low Latency Transactional Apps by YugabyteVMware Tanzu
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibrePablo Moretti
 

Similar to Tips & tricks for Firebase storage and Firebase functions (20)

Traveloka's journey to no ops streaming analytics
Traveloka's journey to no ops streaming analyticsTraveloka's journey to no ops streaming analytics
Traveloka's journey to no ops streaming analytics
 
Cloud arch patterns
Cloud arch patternsCloud arch patterns
Cloud arch patterns
 
Google App Engine Introduction
Google App Engine IntroductionGoogle App Engine Introduction
Google App Engine Introduction
 
Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)Tools and libraries for common problems (Early Draft)
Tools and libraries for common problems (Early Draft)
 
Logs @ OVHcloud
Logs @ OVHcloudLogs @ OVHcloud
Logs @ OVHcloud
 
Web App Prototypes with Google App Engine
Web App Prototypes with Google App EngineWeb App Prototypes with Google App Engine
Web App Prototypes with Google App Engine
 
Gobblin @ NerdWallet (Nov 2015)
Gobblin @ NerdWallet (Nov 2015)Gobblin @ NerdWallet (Nov 2015)
Gobblin @ NerdWallet (Nov 2015)
 
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | EnglishAWS big-data-demystified #1.1  | Big Data Architecture Lessons Learned | English
AWS big-data-demystified #1.1 | Big Data Architecture Lessons Learned | English
 
Exploring Google APIs with Python
Exploring Google APIs with PythonExploring Google APIs with Python
Exploring Google APIs with Python
 
Exploring BigData with Google BigQuery
Exploring BigData with Google BigQueryExploring BigData with Google BigQuery
Exploring BigData with Google BigQuery
 
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControlWebinar slides: How to Automate & Manage PostgreSQL with ClusterControl
Webinar slides: How to Automate & Manage PostgreSQL with ClusterControl
 
Evolution of DBA in the Cloud Era
 Evolution of DBA in the Cloud Era Evolution of DBA in the Cloud Era
Evolution of DBA in the Cloud Era
 
Webinar: Building a multi-cloud Kubernetes storage on GitLab
Webinar: Building a multi-cloud Kubernetes storage on GitLabWebinar: Building a multi-cloud Kubernetes storage on GitLab
Webinar: Building a multi-cloud Kubernetes storage on GitLab
 
Piano Media - approach to data gathering and processing
Piano Media - approach to data gathering and processingPiano Media - approach to data gathering and processing
Piano Media - approach to data gathering and processing
 
Automating using Ansible
Automating using AnsibleAutomating using Ansible
Automating using Ansible
 
Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3  Big Data in 200 km/h | AWS Big Data Demystified #1.3
Big Data in 200 km/h | AWS Big Data Demystified #1.3
 
PyGrunn2013 High Performance Web Applications with TurboGears
PyGrunn2013  High Performance Web Applications with TurboGearsPyGrunn2013  High Performance Web Applications with TurboGears
PyGrunn2013 High Performance Web Applications with TurboGears
 
A Planet-Scale Database for Low Latency Transactional Apps by Yugabyte
A Planet-Scale Database for Low Latency Transactional Apps by YugabyteA Planet-Scale Database for Low Latency Transactional Apps by Yugabyte
A Planet-Scale Database for Low Latency Transactional Apps by Yugabyte
 
A Planet-Scale Database for Low Latency Transactional Apps by Yugabyte
A Planet-Scale Database for Low Latency Transactional Apps by YugabyteA Planet-Scale Database for Low Latency Transactional Apps by Yugabyte
A Planet-Scale Database for Low Latency Transactional Apps by Yugabyte
 
Web performance optimization - MercadoLibre
Web performance optimization - MercadoLibreWeb performance optimization - MercadoLibre
Web performance optimization - MercadoLibre
 

More from GameCamp

Practical approach to creative testing and creative optimisation at Google UA...
Practical approach to creative testing and creative optimisation at Google UA...Practical approach to creative testing and creative optimisation at Google UA...
Practical approach to creative testing and creative optimisation at Google UA...GameCamp
 
Creativity and science behind creative testing. creative testing framework an...
Creativity and science behind creative testing. creative testing framework an...Creativity and science behind creative testing. creative testing framework an...
Creativity and science behind creative testing. creative testing framework an...GameCamp
 
How to boost your ASO with data analytics?
How to boost your ASO with data analytics?How to boost your ASO with data analytics?
How to boost your ASO with data analytics?GameCamp
 
8 Types of mobile game and app creatives you should try
8 Types of mobile game and app creatives you should try8 Types of mobile game and app creatives you should try
8 Types of mobile game and app creatives you should tryGameCamp
 
Building the BI system and analytics capabilities at the company based on Rea...
Building the BI system and analytics capabilities at the company based on Rea...Building the BI system and analytics capabilities at the company based on Rea...
Building the BI system and analytics capabilities at the company based on Rea...GameCamp
 
Developing an effective LTV model at the soft launch and keeping it valid fur...
Developing an effective LTV model at the soft launch and keeping it valid fur...Developing an effective LTV model at the soft launch and keeping it valid fur...
Developing an effective LTV model at the soft launch and keeping it valid fur...GameCamp
 
Ad-hoc tasks in the Data Scientist team based on Outfit7 example
Ad-hoc tasks in the Data Scientist team based on Outfit7 exampleAd-hoc tasks in the Data Scientist team based on Outfit7 example
Ad-hoc tasks in the Data Scientist team based on Outfit7 exampleGameCamp
 
Driving profitability of Google App Campaigns in scale. What is easy, what is...
Driving profitability of Google App Campaigns in scale. What is easy, what is...Driving profitability of Google App Campaigns in scale. What is easy, what is...
Driving profitability of Google App Campaigns in scale. What is easy, what is...GameCamp
 
Scaling UA activity - the challenges of growth
 Scaling UA activity - the challenges of growth Scaling UA activity - the challenges of growth
Scaling UA activity - the challenges of growthGameCamp
 
Growth Strategies: Lower Your CPI by Implementing ASO into UA Workflow.
Growth Strategies: Lower Your CPI by Implementing ASO into UA Workflow.Growth Strategies: Lower Your CPI by Implementing ASO into UA Workflow.
Growth Strategies: Lower Your CPI by Implementing ASO into UA Workflow.GameCamp
 
Growth trends in mobile gaming based on the data
Growth trends in mobile gaming based on the dataGrowth trends in mobile gaming based on the data
Growth trends in mobile gaming based on the dataGameCamp
 
Facebook's and Social Creative Best Practice that worked for Huuuge
Facebook's and Social Creative Best Practice that worked for HuuugeFacebook's and Social Creative Best Practice that worked for Huuuge
Facebook's and Social Creative Best Practice that worked for HuuugeGameCamp
 
Using Data Science for Behavioural Game Design
Using Data Science for Behavioural Game DesignUsing Data Science for Behavioural Game Design
Using Data Science for Behavioural Game DesignGameCamp
 
Learnings and insights from Benchmarks+. Performance Insights for 1.2bn Month...
Learnings and insights from Benchmarks+. Performance Insights for 1.2bn Month...Learnings and insights from Benchmarks+. Performance Insights for 1.2bn Month...
Learnings and insights from Benchmarks+. Performance Insights for 1.2bn Month...GameCamp
 
In-app offers monetization from basics to advanced technics based on Crazy Pa...
In-app offers monetization from basics to advanced technics based on Crazy Pa...In-app offers monetization from basics to advanced technics based on Crazy Pa...
In-app offers monetization from basics to advanced technics based on Crazy Pa...GameCamp
 
Building cost-effective mobile product & marketing app analytics based on GCP...
Building cost-effective mobile product & marketing app analytics based on GCP...Building cost-effective mobile product & marketing app analytics based on GCP...
Building cost-effective mobile product & marketing app analytics based on GCP...GameCamp
 
How ASO Has Changed in 2019 and What’s Next. Our experience in creatives and ...
How ASO Has Changed in 2019 and What’s Next. Our experience in creatives and ...How ASO Has Changed in 2019 and What’s Next. Our experience in creatives and ...
How ASO Has Changed in 2019 and What’s Next. Our experience in creatives and ...GameCamp
 
Data behind UA
Data behind UA Data behind UA
Data behind UA GameCamp
 
Enabling the growth of the game through performance marketing in 2020
Enabling the growth of the game through performance marketing in 2020Enabling the growth of the game through performance marketing in 2020
Enabling the growth of the game through performance marketing in 2020GameCamp
 
User Acquisition focused on LTV on steroids
User Acquisition focused on LTV on steroidsUser Acquisition focused on LTV on steroids
User Acquisition focused on LTV on steroidsGameCamp
 

More from GameCamp (20)

Practical approach to creative testing and creative optimisation at Google UA...
Practical approach to creative testing and creative optimisation at Google UA...Practical approach to creative testing and creative optimisation at Google UA...
Practical approach to creative testing and creative optimisation at Google UA...
 
Creativity and science behind creative testing. creative testing framework an...
Creativity and science behind creative testing. creative testing framework an...Creativity and science behind creative testing. creative testing framework an...
Creativity and science behind creative testing. creative testing framework an...
 
How to boost your ASO with data analytics?
How to boost your ASO with data analytics?How to boost your ASO with data analytics?
How to boost your ASO with data analytics?
 
8 Types of mobile game and app creatives you should try
8 Types of mobile game and app creatives you should try8 Types of mobile game and app creatives you should try
8 Types of mobile game and app creatives you should try
 
Building the BI system and analytics capabilities at the company based on Rea...
Building the BI system and analytics capabilities at the company based on Rea...Building the BI system and analytics capabilities at the company based on Rea...
Building the BI system and analytics capabilities at the company based on Rea...
 
Developing an effective LTV model at the soft launch and keeping it valid fur...
Developing an effective LTV model at the soft launch and keeping it valid fur...Developing an effective LTV model at the soft launch and keeping it valid fur...
Developing an effective LTV model at the soft launch and keeping it valid fur...
 
Ad-hoc tasks in the Data Scientist team based on Outfit7 example
Ad-hoc tasks in the Data Scientist team based on Outfit7 exampleAd-hoc tasks in the Data Scientist team based on Outfit7 example
Ad-hoc tasks in the Data Scientist team based on Outfit7 example
 
Driving profitability of Google App Campaigns in scale. What is easy, what is...
Driving profitability of Google App Campaigns in scale. What is easy, what is...Driving profitability of Google App Campaigns in scale. What is easy, what is...
Driving profitability of Google App Campaigns in scale. What is easy, what is...
 
Scaling UA activity - the challenges of growth
 Scaling UA activity - the challenges of growth Scaling UA activity - the challenges of growth
Scaling UA activity - the challenges of growth
 
Growth Strategies: Lower Your CPI by Implementing ASO into UA Workflow.
Growth Strategies: Lower Your CPI by Implementing ASO into UA Workflow.Growth Strategies: Lower Your CPI by Implementing ASO into UA Workflow.
Growth Strategies: Lower Your CPI by Implementing ASO into UA Workflow.
 
Growth trends in mobile gaming based on the data
Growth trends in mobile gaming based on the dataGrowth trends in mobile gaming based on the data
Growth trends in mobile gaming based on the data
 
Facebook's and Social Creative Best Practice that worked for Huuuge
Facebook's and Social Creative Best Practice that worked for HuuugeFacebook's and Social Creative Best Practice that worked for Huuuge
Facebook's and Social Creative Best Practice that worked for Huuuge
 
Using Data Science for Behavioural Game Design
Using Data Science for Behavioural Game DesignUsing Data Science for Behavioural Game Design
Using Data Science for Behavioural Game Design
 
Learnings and insights from Benchmarks+. Performance Insights for 1.2bn Month...
Learnings and insights from Benchmarks+. Performance Insights for 1.2bn Month...Learnings and insights from Benchmarks+. Performance Insights for 1.2bn Month...
Learnings and insights from Benchmarks+. Performance Insights for 1.2bn Month...
 
In-app offers monetization from basics to advanced technics based on Crazy Pa...
In-app offers monetization from basics to advanced technics based on Crazy Pa...In-app offers monetization from basics to advanced technics based on Crazy Pa...
In-app offers monetization from basics to advanced technics based on Crazy Pa...
 
Building cost-effective mobile product & marketing app analytics based on GCP...
Building cost-effective mobile product & marketing app analytics based on GCP...Building cost-effective mobile product & marketing app analytics based on GCP...
Building cost-effective mobile product & marketing app analytics based on GCP...
 
How ASO Has Changed in 2019 and What’s Next. Our experience in creatives and ...
How ASO Has Changed in 2019 and What’s Next. Our experience in creatives and ...How ASO Has Changed in 2019 and What’s Next. Our experience in creatives and ...
How ASO Has Changed in 2019 and What’s Next. Our experience in creatives and ...
 
Data behind UA
Data behind UA Data behind UA
Data behind UA
 
Enabling the growth of the game through performance marketing in 2020
Enabling the growth of the game through performance marketing in 2020Enabling the growth of the game through performance marketing in 2020
Enabling the growth of the game through performance marketing in 2020
 
User Acquisition focused on LTV on steroids
User Acquisition focused on LTV on steroidsUser Acquisition focused on LTV on steroids
User Acquisition focused on LTV on steroids
 

Recently uploaded

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 

Recently uploaded (20)

"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 

Tips & tricks for Firebase storage and Firebase functions

  • 1. Tips & tricks for Firebase Storage & Functions David Vávra, Android GDE
  • 2.
  • 3.
  • 4. Firebase Storage ● For saving large binary files (images, video, audio etc.) ● Not for structured data (use Realtime DB or Firestore for that) ● Built on top of Google Cloud Storage ● Serverless: clients access it directly, servers are another clients ● Indefinite scalability ● SDKs for Android, iOS, Web + REST ● Security rules similar to Database rules ○ can contain validation rules (“must be PNG & <5 MB”)
  • 5. Firebase Storage pricing ● $0.026/GB stored (vs $5/GB for RTDB) ● $0.12/GB downloaded (vs $1/GB for RTDB) Free tier: ● 5 GB stored ● 1GB downloaded / day Settle Up April 2018: ● free
  • 6. How we use it at Settle Up ● Pictures of users ● Receipts for expenses ● Images for campaigns ● Archive of old groups from Database
  • 7. Tips ● Save Storage URLs to Database ● Make sure it works offline ○ save local path first to Database ○ schedule task for uploading later (WorkManager on Android) ○ change URL in Database ● You can use Storage for archiving data from Realtime DB ● .NET? ○ https://github.com/step-up-labs/firebase-storage-dotnet
  • 8. Cloud Functions ● Javascript/Typescript code triggered by events ● No server management, infinite scalability ● So simple that frontend developers can write it :) ● Useful when: ○ you can’t trust the client ○ reusing logic for clients ○ saving resources for clients ○ data consistency
  • 9. Triggers ● Firestore ● Realtime DB ● Authentication ● Google Analytics ● Crashlytics ● Storage ● Pub/Sub ● HTTP
  • 10. Functions pricing ● $0.40/million invocations ● $0.0025/thousand GB-seconds, $0.01/thousand CPU-seconds ● $0.12/GB of outbound networking Free tier: ● 125K invocations/month, networking Google only Settle Up April 2018: ● 543K CPU seconds, 2.3M invocations = $3.5
  • 11. How we use it at Settle Up ● verifying purchases & subscriptions ● moving some HTTP logic to server side ○ adding permissions ○ archiving/restoring groups ○ delete all expenses ○ shortening Dynamic Links ● periodically update exchange rates ● generating history of changes ● cleanup (removing invalid URLs) ● Google Assistant fulfilment
  • 12. Tips ● Use Typescript and VS Code as editor ● We tried Kotlin and it’s possible, but cumbersome ● Cron functionality is missing, we use Google AppEngine which does HTTP trigger ● Test functions locally, libraries mocha, sinon and chai are useful ● Deploy functions via CI