I'm writing a script to sync results from an API with a specific child in the Firebase Realtime Database, but I cannot think of a way to approach this. Do I create a reference for every child of every endpoint (~100,000 references total), or do I merely keep a reference to the entire object, compare the two, and push the differences. If the latter is the better approach, would there be a way for me to access Firebase's local cache (I'm using the Firebase Admin SDK on Node.js), so that I don't have to download the entire database on start?
Here is an example to illustrate what I mean:
Let's take the following endpoint https://api.vexdb.io/get_events
. It returns an array of objects, all with a property know as an SKU
, which is a unique ID which will serve as the primary key/parent key in the Firebase Realtime Database. Given this data, I transform it into one big object with keys that all point to one of the original indexes of the array. I want to sync this object into the Database. Does that clarify?