Serverless best practices
While all FaaS platforms offer fundamentally similar services, the way you can configure and fine-tune them differs from platform to platform. For this reason, there are several platforms and framework-specific best practices. We will cover a list of best practices next; some of them are common to all vendors, while others are specific to some vendors and/or serverless features:
- One function per task/route/event: FaaS functions should be simple and performant to get the most out of the serverless paradigm. To do that, ensure that functions serve only one use case. Restricting the scope of a function also helps in easier debugging and scaling. If you are using event processing architecture, ensure that your function only processes one type of event, rather than an array of event types. If your function serves an API Gateway endpoint, limit it to process one route/REST resource along with its verbs. For all other use cases, limit the function scope to...