Apologies if this is really basic, but I'd love to not architect this incorrectly from the start
When, in a serverless/microservices world, what's the best way to interact with other functions in different cases?
Function1.js looks up users in DynamoDB.
Function2.js sends sales email to those users.
--I assume I should just require
Function1.js and call the function directly, or should I make a full API Gateway call to
GroupOfFunctionsA handles user interactions (like looking up users and sending emails to them)
GroupOfFunctionsB handles cron jobs/events that schedule things like when you should invoke
--Should I use Lambda.Invoke to launch
GroupOfFunctionsA from within
GroupOfFunctionsB or should this be an API call or require() situation?
Obviously interacting with external apps or organizations, that's all API calls, but internally, is there something I should read, or someone who has advice?