1

In response to some AWS lambda event like file uploaded to S3 bucket etc, is it possible to start/launch a web application on AWS lambda? I know a java app can be launched on lambda in response to some event, but I am particular about web application.

How is a web app different from java app? Right!! The web app is (should be) accessible to outer world through some URL. This is my main concern. Does AWS Lambda provide any such url feature through which I can access the web app running on lambda.

samshers
  • 1
  • 6
  • 37
  • 84
  • 1
    You usually put API gateway infront of your lambda for it to be callable from outside. But I don't understand what do you want to do with boost spring on lambda? – Marcin Mar 06 '21 at 07:53
  • Hi there, serverless are meant for event-driven executions thus, not ideal for web facing a user client. Not to mention the cold starts during the first time invocation which may affect user-experience. For my case, I used serverless for side-effects such as email sending, publishing to elasticsearch all of which are subscribed to an event source (e.g., Kafka) – junbetterway Mar 06 '21 at 07:57
  • @Marcin, `put API gateway infront of your lambda` this helps. Use case, say, the uploaded file undergoes some processing by the spring app and then exposes the processed file through web app. Can you give any reference to explore further on `put API gateway infront of your lambda`. AWS links etc. – samshers Mar 06 '21 at 07:57
  • @junbetterway, I agree with you. I want to understand the possibility - that's the primary objective. – samshers Mar 06 '21 at 07:58
  • Noted. I would recommend a try on Spring Cloud Function. You can check out my sample [repo](https://github.com/junbetterway/spring-cloud-func-aws-lambda-basic) where in I use API gateway to invoke the AWS Lambda function – junbetterway Mar 06 '21 at 08:00
  • 1
    You can perfectly run a “web app” on Lambda, as noted through API Gateway. API Gateway takes the request, spins up a Lambda handler if necessary and lets it handle the request. The only thing is the cold start, which can be noticeable on infrequently accessed apps. If your app starts up in a relatively short amount of time, it’s usually fine. If it takes quite a while though, you’ll need to provision reserved instances which will always be kept warm. – deceze Mar 06 '21 at 08:02
  • There are many resources about this, e.g. [here](https://www.sebastianhesse.de/2021/02/14/using-spring-boot-on-aws-lambda-clever-or-dumb/). But sprint boot maybe too heavy for lambda function. You can probably run it, but lambda functions should be simple, which do one thing only. – Marcin Mar 06 '21 at 08:02
  • @Marcin I’m running Python Django apps on Lambda in production for major clients, and they work great. You can do more than “simple, one-thing functions”. – deceze Mar 06 '21 at 08:04
  • @deceze Yes, you are right. These days with 10GB of ram on lambda one indeed run very big functions. – Marcin Mar 06 '21 at 08:12

0 Answers0