As we move all our APIs to the cloud, we need to rethink what will now be going on the Pi. We still have to read data from sensors, and we still have to update an external data store. However, one thing that has changed is that our Pi is not serving anything anymore.
In the sans-Firebase implementation, our Pi used to act as the connecting block between our client-side scripts and our database. As a consequence of this, we had to run a server on the Pi that accepted requests and returned results:
The most significant change now is that instead of being a listener, the Pi is going to be a notifier and update data on the Firebase Realtime Database. The middleware will now be the Firebase APIs: