Serverless: slower and more expensive
PSA: porting an existing application one-to-one to serverless almost never goes as expected. Couple of points that stand out from the article:<p>1. Don’t use .NET, it has terrible startup time. Lambda is all about zero-cost horizontal scaling, but that doesn’t work if your runtime takes 100 ms+ to initialize. The only valid options for performance sensitive functions are JS, Python and Go.<p>2. Use managed services whenever possible. You should never handle a login event in Lambda, there is Cognito for that.<p>3. Think in events instead of REST actions. Think about which events have to hit your API, what can be directly processed by managed services or handled by you at the edge. Eg. never upload an image through a Lamdba function, instead upload it directly to S3 via a signed URL and then have S3 emit a change event to trigger downstream processing.<p>4. Use GraphQL to pool API requests from the front end.<p>5. Websockets are cheaper for high throughput APIs.<p>6. Make extensive use of caching. A request that can be served from cache should never hit Lambda.<p>7. Always factor in labor savings, especially devops.