Serverless E-commerce on AWS Lambda

I am trying to build an e-commerce back-end to lambda and have some issues that don’t know how to solve and can’t find any good resources, please help!

  1. What should the infrastructure be? For example, if I want to use lambda to handle one route, should I put all the logics in the lambda including auth, session ,… all the middlewares first and then write the route logic. Or should I create a lambda to handle all( or some) middlewares and then hand over to the route lambda? any suggestions? any resources?

  2. Inside the node.js express app. I use “app.use” to add a lot of middlewares , for example: app.use(session({/* session configuration /})); this is the middleware to maintain sessions. If deploy the route to lambda, can I just remove “app.use()”, and directly put “session({/…*/});” as a function before the route logic to maintain the session.

  3. actually I am still very new to all these techniques and don’t know what is the best practice of maintaining sessions on the serverless lambda. Apparently the session data will be stored inside database and I know how to do that in my express app. What is the best way to handle session on lambda?

If you know all these solutions or you have some practical experience, you could also leave your rate and contact information, I will contact you and pay for it. Thanks for reading this lengthy post

Hey Victor,

Checkout what is working on. It sounds like it might be close to what you are looking for =)

1 Like