Going Serverless Firebase

Continuing from my previous post.

I want to focus on a few serverless providers, the first one being Firebase.

If you are building a mobile app or web app, I would highly recommend Firebase. It provides you with everything you need to get started.

Want Authentication? ✔️
Hosting for your site? ✔️
A database for any generated data? ✔️
Blob storage for user images? ✔️
Serverless API endpoints? ✔️
Analytics? ✔️
And loads more features

Basically anything you could want to do in an app or website Firebase has got you covered. Its a service provided by Google, so it has the support, up time and integrations you would expect.

Its also priced the way you would expect and is great value for money with tons of usage totally free! https://firebase.google.com/pricing/

Developer Experience

The docs for all of these different features are great, contain loads of samples and is super easy to get up and running!

There is a Firebase CLI which means that you can init projects and deploy in seconds. Once you’ve got the CLI and logged in, getting going with hosting is as simple as:

firebase init
firebase deploy

Now I’ve only used it with one environment, so I don’t know how easy it is to switch between them like you would in a production environment.

Converting from Express
I also came across these docs on converting an Express app to serverless functions which makes it amazingly simple, caveat I don’t know how the will affect the cold start time and performance of the functions.

Some down sides is that (at the time of writing) you can’t run the functions locally, which means you always have to spin some functions up to test them, so can’t always go as fast as you might want to and it can mean mistakes take longer to debug.

The language options for the Firebase functions is pretty limited as well, both in terms of version (only Node 6 supported) and the only language its JavaScript (I’m okay with this, because I ❤️ JavaScript, but it might not suit everyone).

Downsides

The cold start times are pretty variable for the Cloud Functions, as with most providers.

There is the obvious cloud lock in, all Firebase products work really well with each other and is more tricky if interacting with them.

I’ve also yet to figure out if there a way to version any changes and roll back, especially with changes to the Authentication system for example.

Then there is logging, now logging is okay, pretty standard across the cloud providers.
However I have to compare it to my experiences with my favourite tool for logging/debugging Azure Monitor (previously called App Insights) and right now its not even in the same league. You can’t tell the difference between logs of different deployments, nor the intelligent debugging you can do with Monitor.

Conclusion

Firebase is great to get up and going really quickly and giving you loads of features right out of the box, perfect for side projects, start ups or demos.

However in an Enterprise situation, I feel like you would need to have a lot of processes in place to make sure that mistakes and breaking changes aren’t made and deployed.

I’d still recommend checking it out as there is so much you can achieve with Firebase, with very little effort, cost and complexity.

Let me know how you get on!

These are webmentions powered by webmention.io