My First Time Using Google's Firebase

July 25, 2023

So, I was a bit busy yesterday. I used Google’s Firebase cloud database for the first time.

Ever.

Your first time learning new tech isn’t always spectacular. Usually, you spend more time reading documentation and asking ChatGPT questions than you spend actually coding.

And that killed me yesterday.

I wish I could have spent my entire day writing code, but I spent more than half my day not doing that. Instead, I had to debug code and read Firebase's (somewhat confusing) documentation.

I felt as if I did nothing. As if I wrote no good code.

Then I woke up and saw the truth.

Here’s what I actually did yesterday:

  • Used firebase_admin library to get permission to access Firebase Realtime Database
  • Learned how to create child nodes in the database
  • Moved local MySQL database to Firebase
  • Wrote Python script to update the database as needed
  • Wrote Python script to select a random item from item_id child and update its corresponding status child

So, yeah…

It turns out I did a lot more than most people using Firebase would on their first day. That’s why I’m not mad anymore.

My day was hella productive.

While I’d love to go in-depth on every single thing I did, I’m feeling burned out after a long day. So instead, here are some screenshots from my day. (and don’t be afraid to visit my code here on GitHub)

Using firebase_admin to access Firebase Realtime Database

code that accesses Firebase Realtime Database

Created Child Nodes in Realtime Database

Example of a child node in my database

Inserting Data Into Realtime Database

Code that updates Realtime Database

Getting Random Item From Realtime Database

Code that selects random item from database