4

I am using InversifyJS with AWS Lambda. I use Typescript and have controller, service and repository layers. In all layers I use constructor injection with InversifyJS. And my function is returning some static dummy text. So the issue is - when I use Inversify for DI, I got high memory usage in AWS Cloudwatch (~160 MB for simple hello world), but without Inversify memory goes down to normal (~50 MB).

With DI using InversifyJS: enter image description here

Without DI: enter image description here

Would like to hear about some real life experience using DI with AWS Lambda. Maybe some alternative ways to achieve DI, or it is totally not being used in serverless development?

Samir
  • 1,288
  • 2
  • 22
  • 41

0 Answers0