Rank 5: Hypervisor
Really 😮
Votes
0
Replies
24
Participants
Unknown
Messages
25
Rank 5: Hypervisor
Really 😮
I personally would split up the code but I would just differentiate based on the event. See here
https://appwrite.io/docs/advanced/platform/events
But if they all use the same trigger how would you differentiate then?
Rank 5: Hypervisor
nice idea, but still this particular function does so many things
Can you elaborate what your function does?
Rank 5: Hypervisor
that's just it, except if all the functions have different events but still, it will still need to tell the cloud function instance what function to execute
except if you want all functions to execute either asynchronously or all at once, which is far from the goal
I have written a method in my starter function which can differiantiate the event. What type it is and the event item id (like document id, file id, etc.)
Rank 5: Hypervisor
writing to database after account creation, fetching data after login, writing to database after transactions are successful, communication with third party API and more
Account creation != login, no?
Rank 5: Hypervisor
I still don't get picture you're trying to paint 🎨
Rank 5: Hypervisor
???
Does your user register via the official method or via your function?
Rank 5: Hypervisor
Via official method
Rank 5: Hypervisor
But I don't want to write to the database via client app
Rank 5: Hypervisor
But all done in backend, to follow best practices
Yeah, because if a user registers it triggers this event "users..create" and when the user logins it triggers this "users..sessions.*"
so user create it not the same as login
it is two different events
Rank 5: Hypervisor
I mean one cloud function to have more than 30 different features that it does (as dart function)
Rank 5: Hypervisor
I know about all these, but this will be best when I have different cloud functions for different services and features.
Idk if you got my motive?
Kinda and kinda not I think. Let me reread real quick. I think putting too many features within a single function makes it too complex unesseccarily. Each function should just do a certain thing or flow (like registration flow)
Rank 5: Hypervisor
yes, this is because I can only create 5 cloud functions
Yeah ok that explains it. Are you in production already? If not I would just spin up appwrite locally on your pc with docker
Rank 5: Hypervisor
I tried using local appwrite instance, it ate up weeks of my time.
I was unable to communicate with it via docker despite looking for solutions 😞