Firebase: Back-end integration with Admin SDK

Hiranya Jayathilaka
3 min readMay 12, 2018

We just witnessed another eventful and exciting Google I/O. As usual Firebase was well represented in the three-day event with around 13 dedicated sessions, sandbox space, office hours and a cool arcade game station powered by Firebase. This year’s Google I/O was particularly important to me for a couple of reasons. For starters this is the first Google I/O that I got to participate in person. Secondly, I had the unique privilege of talking about Firebase on stage in one of the sessions.

Some I/O attendees and Firebasers at the AppShip multiplayer arcade game (powered by Firebase)

My talk was titled Integrating Firebase into your existing back-end infrastructure. My partner in crime @ThatJenPerson and I pulled off a wicked live demo featuring several Firebase services alongside Google App Engine, Elasticsearch and TensorFlow. We built a pretty realistic movie rating app called FireFlicks, and showed how to incrementally integrate Firebase with a variety of back-end systems. In the process we took FireFlicks from being your run-of-the-mill webapp to a sophisticated enterprise system with many bells and whistles — the kind of thing that app developers love to build.

As you may have guessed, the Firebase Admin SDK played a front and center role in our demo. All in all we managed to show off three flavors of the Admin SDK (Node.js, Python and Go). Only Java Admin SDK was left behind. We certainly don’t have anything against Java. We just could not fit it into our 40 minute session. Here’s a high-level synopsis of the use cases that we explored in the talk:

  1. Implementing custom roles in a Firebase app: Setting custom claims with Firebase Auth and Admin SDK; Implementing role-based access control (RBAC) for Firebase clients in Google App Engine and other privileged environments.
  2. Integrating in-house systems with Firebase: Using Cloud Functions for Firebase to bridge a private Elasticsearch server with Cloud Firestore; Enabling full-text search for a Firebase app.
  3. Automating house-keeping tasks: Using Cloud Functions for Firebase to keep app statistics up-to-date; Sending mass notifications to users.
  4. Server-side machine learning: Training a TensorFlow model on Firebase app data; Sending direct notifications to Firebase app instances from back-end servers.

I have written about some of these use cases in the past. I will cover the rest in more detail in future posts. In the meantime check out the recording of the talk.

Let me know what you think. The demo app is also still live (served via Firebase Hosting of course), so feel free to play around. The app database comes pre-loaded with 9,000+ movies and 100,000+ ratings. It is actually based on the famous MovieLens 100K dataset that is used in many machine learning experiments.

I’m really happy to get an opportunity to talk about Firebase Admin SDKs at I/O. This is the first time Admin SDKs have come under that kind of spotlight. Now I’m excited to hear what developers think about the various Firebase features we discussed. Also what other use cases would you like us to cover in future events? I’m all ears.

--

--

Hiranya Jayathilaka

Software engineer at Shortwave. Ex-Googler. PhD in CS. Enjoys working on cloud, mobile and programming languages. Fan of all things tech and open source.