Reputation: 123
Hi I have a Firebase project that requires intense write verification. Our current pipeline is the user writes their data to "Users/uid/submits/sid". This triggers a Functions oncreate function which runs the data through a verification script, then upon approval deletes the data, and writes the verified data in "Events/submits". This pipeline works great in out simple test cases.
The issue arose when our verification script grew to a few thousands lines of python. We attempted translating this to javascript (as Functions only accepts javascript/typescript) and failed miserably. We encountered bug after bug and after hours came to the conclusion that translating to javascript was not an option. I'd like to note that yes given more time the translation could've been successful, but this is only 1/20 verification scripts for 20 different use cases and we can not go through the marathon of translation every time, its exponentiating our development time.
We've done some research and have considered Google Cloud Platform (which does run python) as the closest thing to a solution, except in their docs they say to integrate with Firebase to simply use Firebase's functions (which we can not do as discussed). So to us, the most viable solution is to some how connect Firebase's Function (which can be triggered by Firestore) to connect to Google Cloud Platform. If someone has a way to do this I will happily rename/edit this question to fit accordingly, but I have left it this way in case someone knows a solution that doesn't involve GCP. Thanks in advance
Upvotes: 2
Views: 1619
Reputation: 317497
I think you misunderstood that page of documentation. Firebase does not really have its "own" functions. There is actually no such thing as "Firebase Functions". There is just one product - Cloud Functions. Firebase simply adds tools on top of it that are easier to consume, typically targeted at mobile developers. The additional tools and APIs are collectively called "Cloud Functions for Firebase". The same Cloud Functions product is still at the core. You can't avoid GCP, but you can opt to use the Firebase tools, if they meet your needs. I suggest you read my blog series about the relationship between Firebase and Google Cloud to learn more, especially the article about what's different with Cloud Functions between the two.
If you want to write Cloud Functions code in python, you can use GCP tools for that. The functions will trigger exactly the same way as if you had written them in JavaScript and deployed them with the Firebase CLI.
Upvotes: 3