Not necessarily intentionally but my web app is currently set up to get or list data from firestore querying directly while creating and updating works via function using the admin SDK. However, I'm not sure it's the best approach from the perspective of performance, cost and security.
The app in question is a PWA (using gatsby framework for react), with rematch (a react redux framework), a booking app, let's make it an event booking system, to make it easier to refer to. The most recent bit I finished was user management, defining how users can create other users, update themself or others, or remove their association with them.
As above described, users would get their associated user list via direct querying methods, while creating new users or updating them goes indirectly (callable functions using the admin SDK).
I'm contemplating moving everything back to my client app to query / update firestore directly, which would help by being able to leverage the rules more, however, it would expose more of the code, potentially there for hackers to exploit.
What would be one or more factprs that would help me decide where to actually do the processing of read or write (I don't delete, just disable)?
Thank you in advance.
Cheers,
benomatis