(Assuming the standard database + application server that provides the API endpoints)
How do you handle accessing the database from periodic maintenance tasks? (anything from cron phps to aws lamba functions)
Do you connect directly to the database?
Do you add specific endpoints in the application server/API so that the job doesn't directly access the db?
What pros/cons did you notice with your approach?