Avoid large and long-running functions

Large and long-running functions can cause unexpected timeout issues  and A function can become large because of many Node.js dependencies. Specially Importing dependencies can also cause increased load times that result in unexpected timeouts.

Whenever possible, we should refactor large functions into smaller function sets that work together and return responses fast. 

Get DevOps for Serverless Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.