The view that serverless is the way of the future is once more reinforced by Google's recent announcement of its Cloud Functions for Firebase. These can be seen as an attempt to catch up with the already established players of the Function-as-a-Service scene, AWS Lambda and Azure Functions.
Like AWS Lambda and Azure, Cloud Functions are standalone snippets of code that live on the cloud and are fired in response to events taking place in Firebase supported products; for example sending notifications to all registered clients when a new record gets inserted in a Firebase database.But as well as being fired in response to all kind of events, they can also be exposed as dedicated HTTP endpoints that can be directly invoked without the need of a middle-app.
Before Cloud functions, for Firebase based products to get similar functionality you had to run a VPS on Google Cloud which would asynchronously handle all event requests through a Firebase Queue, the fault-tolerant, multi-worker, multi-stage job pipeline.But now Google recommends Cloud Functions as a total replacement to Firebase Queues:
"there may continue to be specific use-cases for firebase-queue, however if you're looking for a general purpose, scalable queueing system for Firebase then it is likely that building on top of Google Cloud Functions for Firebase is the ideal route."
In order to be considered a worthy feature to migrate to, Cloud Functions also tempt with quite a few integrations out of the box:
Firebase Analytics integration Sending a notification with a coupon code to users who have just completed a purchase or sending a survey request to users after they upgrade their app.
Firebase Authentication integration Triggering a function when a new user is created or deleted, sending an email to welcome new users immediately after they sign up or cleaning up user associated data from Realtime Databases when a user account is deleted.
Firebase Realtime Database integration Triggering a function when data is created, updated, or deleted at a specific path in the database, sending a notification when data is written to the database or moderating and removing abusive language from data written to the database.
Cloud Storage integration Triggering a function when an object is written, updated, or deleted within a particular storage bucket, resizing and converting images when a new image has been uploaded to your Cloud Storage bucket or moderating abusive images uploaded to Cloud Storage using the Cloud Vision API.
HTTP endpoint integration Allowing Cloud Functions to be exposed as URLs, triggered when a request is made to that URL.
Also out of the box, with support for Google, Facebook, Twitter and GitHub sign-in, there's much flexibility in choosing an authentication option. Setting it up also looks much easier than under AWS, a case that we extensively covered in the three part article series of AWS Lambda For The Impatient.
Pricing is based on the familiar by now pay-as-you-go scheme, an affordable and scalable solution since you don't have to pay for your server's idle time as the case with full blown VPSs.The Blaze starter pack costs $0 and allows 100 Simultaneous connections, 1GB of database storage and 10GB/month bandwidth.
So is sticking to AWS or Azure still a viable option? As always this is something that should be considered on a case by case basis, but it is undeniable that Google's move in going serverless, makes using, integrating and expanding Firebase-backed products on any of the supported platforms of iOS, Android, Unity and the Web, much more accessible.
Visual Studio 2017, aka VS 15, has been launched at a series of events across multiple countries. The launch took place 20 years after the original announcement of Visual Studio 97, the first version [ ... ]