3. 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
9. 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
10. 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
14. 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
15. 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)
17. Analytics conversion event
Send a coupon to client after first purchase.
Send a discount code to client that has invited a friend.
18. 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
20. 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?
31. A lot to master..
Database structuring (hello SQL developers!)
Reactive programming
Analytics (knowing your users is your #1 priority)
Concurrent, asynchronous, distributed
QUESTIONS:
Anyone worked with Firebase before?
Anyone who is using Firebase functions in a project right now?
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?
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.
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”
Javascript. If you don’t know Javascript development for NodeJS, now is a time to start learning
Use Typescript, it is closer to how you probably think that Javascript works.
Developed by Microsoft and opensource.
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)
Local development. Debugging is easy.
Cloud apps. Debuggig a bit tricker.