firebase-functions - best way to start processing data / RESTful API

Viewed 61

I am working on a project that currently is using firebase-functions as its backend and most of the time firebase-functions are used to do some light weight modification in the database. However, we have some functions that are listening for changes in request/[userId]/startProcessingSomething documents. Those documents are being used to start some heavier data processing and saving the outcome to specific documents in firebase db. And it worked in the beginning, but after a while we experienced race conditions and we wanted to know when the processing of above requests is finished, so there was an idea to use metadata/[userId]/processingSomethingMetadata where we kept the information about the current status of the data processing.

I did not like creating artificial documents for metadata so I am pushing to use endpoints (standard GET/POST/PUT/DELETE) to handle some operations. However, I hear opinions that this is not the firebase-functions way.

Do you have any idea, hints how to handle more complex processing / requests?

Is using RESTful api with firebase-functions a bad idea?

0 Answers
Related