Live data from Hacker News

Introducing Cloud Functions for Firebase

firebase.googleblog.com

51–60 of 129 posts

Re: Introducing Cloud Functions for Firebase

#51
post #49
post #47

I don't really understand how to use this to build a real backend. Everything seem to be revolving around reactions (new thing happening in the DB, file uploaded etc) but isn't the more common use case that you actually want to call the function directly? I'm building a simple React Native/Expo app where I want users to join random chat rooms so I obviously need some logic to delegate this process. Is Firebase/Cloud…

You can definitely do this! There are two ways that readily come to mind: 1. Use the Realtime Database as a communication channel to trigger a Cloud Function that then sets up the thing you need. 2. Create an HTTPS function and call it directly from your app, then do the work you need.

When it hits YouTube, check out our talk "Cloud Functions and Firebase". We have a much more complex chat room example than has been possible in the past

Re: Introducing Cloud Functions for Firebase

#52
post #49
post #47

I don't really understand how to use this to build a real backend. Everything seem to be revolving around reactions (new thing happening in the DB, file uploaded etc) but isn't the more common use case that you actually want to call the function directly? I'm building a simple React Native/Expo app where I want users to join random chat rooms so I obviously need some logic to delegate this process. Is Firebase/Cloud…

You can definitely do this! There are two ways that readily come to mind: 1. Use the Realtime Database as a communication channel to trigger a Cloud Function that then sets up the thing you need. 2. Create an HTTPS function and call it directly from your app, then do the work you need.

Oh, I completely missed that there were HTTP triggers as well. Thank you!

Re: Introducing Cloud Functions for Firebase

#53
post #47

I don't really understand how to use this to build a real backend. Everything seem to be revolving around reactions (new thing happening in the DB, file uploaded etc) but isn't the more common use case that you actually want to call the function directly? I'm building a simple React Native/Expo app where I want users to join random chat rooms so I obviously need some logic to delegate this process. Is Firebase/Cloud…

There are a few ways! For example when the user signs in, you could assign them a random chat room https://firebase.google.com/docs/functions/auth-events lets you trigger on initial sign in.

You can also hook up to regular HTTP triggers, and make it like an API call: https://firebase.google.com/docs/functions/http-events

Re: Introducing Cloud Functions for Firebase

#54
post #2

As a 2+ year user of Firebase, this is long overdue. I built my own cloud function infrastructure using their Java SDK and Digital Ocean and I couldn't have built my app (ProBooks.com) without it. It's good to see Cloud Functions moving from Alpha to Beta!

Just out of curiosity, what kind of functionality were you only able to build this way?

Part of the primary power of cloud functions is you can extend firebase services instead of intermediating them. This lets you still take advantage of all the great features in the firebase SDKs.

Re: Introducing Cloud Functions for Firebase

#55

This was a long time coming, so congrats first. I also recently read this from an experienced Firebase developer: https://medium.freecodecamp.com/firebase-the-great-the-meh-a... Interestingly, he lists several things that he things Firebase needs in order to be awesome, and server-functions is last on the list: > 1. Real querying capabilities. Search, joins, the whole enchilada. > 2. Some sort of references likes Mon…

Well, Cloud Functions for Firebase isn't the only thing we're working on... ;)

Re: Introducing Cloud Functions for Firebase

#58

Oh man. This is great. Firebase is now a one-stop shop for the majority of app infrastructure needs, and really is the closest thing to a "serverless" infrastructure. Vendor lock-in aside, I can't think of a reason not to use it, at the MVP level at least.

Firebase offers a lot, but it's no longer the only game in town that offers a sorta-serverless baas. Here are some compelling alternatives (I'd love to see a complete list of the best Firebase alternatives):

- https://www.syncano.io

- https://www.graph.cool

- https://www.backand.com

I'm omitting things like feathers.js b/c the most attractive feature of Firebase-like tools is not having to manage your own server/database.

Re: Introducing Cloud Functions for Firebase

#59
post #46
post #42

Earlier quoted context omitted.

Any service with more than 400 users that want to run a batch process for each user in constant time with respect to number of users.

Right, how many of those do exist with an internal architecture that will fit the Lambda model?

I'm curious more generally why would somebody use Lambda at all? Surely its far more expensive than running on your own servers (or instances), no?

Re: Introducing Cloud Functions for Firebase

#60
post #27

Earlier quoted context omitted.

If you need more than 400 concurrent invocations please reach out to support (not promising whether or not we'll be able to satisfy arbitrary scale just yet). We're on day one of a Beta product and it'll keep getting better.

And just to clarify, Cloud Functions for Firebase is covered under the Firebase free support, who you can reach here: https://firebase.google.com/support/contact/troubleshooting/

"You have 5 questions remaining"

Limit is 5 per year, that's brutal

Post reply on HN