Hi,
I've started using Firebase functions extensively for a number of apps we manage. Historically we used nodejs containers to achieve a similar outcome but the native functions are a big win for us.
I have one question though and wondered if anybody had come up with the best design pattern for this particular use case....
We use functions to watch certain references and when a change is detected it creates a number of pseudo indexes for certain views we want to be able to display to the user without them having to download the entire dataset, it also performs a number of transforms for aggregate views of data. We have found this to be a great way to structure our data, as the source data is updated, the functions can then be used to crunch the data into any shape required for user views.
Occasionally, we may wish to alter the structure of one of the indexes, which requires the entire dataset to be re-indexed. Therein lies my question, is there a recognised way to force a function to run across an entire dataset instead of waiting for the next change?
At present, we have resorted to exposing an http endpoint that post deployment our release scripts call to force an update of all records. But I wondered if there was a more efficient or acceptable way to achieve the same result, maybe some type of post deploy hook?
Any thoughts about current approach and potential alternatives would be welcomed!