I have a small Ionic app that I have released to the app store and am now working on version 2.0.
Version 1.0 was a single user application. Now with version 2.0 I am thinking about adding some collaborative features.
A good analogy for these features would be like an evite type application. Basically one person can create a party and invite a bunch of people to that party. When the people invited respond, I would like the person organizing the party to get some notification. Ideally it would be like a push notification where the app is launched when the notification is pressed.
One thought I had was to build a server-less Service Layer using Firebase Cloud Functions where the creation of the party and inviting of the people would basically happen by invoking these Firebase cloud functions over HTTPS. That service layer would handle writing to Firestore and any other business logic. Notifications would come back to the party organizer via Firebase Cloud Messages. Having done a lot of SOA type projects during my career this appealed to me because it felt familiar and like a good old 3 tiered architecture.
However perhaps I am being too much of a dinosaur and making things more complicated (and expensive) then they need to be.
One alternative I was thinking of would be to just let the client uses the Firestore Client API directly and then leverage the realtime updates to facilitate the notification part by having the party organizer’s application just listen for updates to the invites sub-collection of the party. Perhaps I could just have a service worker that listens for updates and creates a LocalNotification which would solve the notification problem.
In the middle it seems there could be a hybrid solution where the client uses the Firestore API to read and write. When a person accepts an invite it is written to Firestore. A Cloud function could then be triggered by the update of the subcollection to send an FCM message to the party organizer.
I hope that this question isn’t too hypothetical abstract.
In a way just posting it is a way for me to ask the duck and attempt to reason it out for myself.
However if there are people on this forum who have done one of these approaches before i would be interested in hearing why it was good or bad, what the pitfalls were, etc.
I am trying to strike a balance between having a clean/straightforward solution while also consider the second order consequences like what my Google bill will look like at the end of the month.