Functionality differences for AWS Lambda functions written in node.js/Java

0 votes

I am planning to use AWS Lambda for the backend of an app. I am more comfortable with Java compared to node.js but I see Lambda functions in node.js are more popular than Java. Are there any performance differences between Java based and nodejs based lambda functions?

Dec 3, 2018 in AWS by Datageek
• 140 points
64 views

1 answer to this question.

0 votes

Well, you can always choose Java, if you are comfortable with that. But please do keep in mind the following points.

While Java has a slower startup time, it's runtime performance is a lot better than the one of node.js or Python. That means Java Lambda functions make sense if:

  1. They are Invoked regularly - AWS Lambda will reuse it's initialized containers and you can benefit from the better performance without the cold start latency
  2. They have a long runtime - If your function is running e.g. for 1 or 2 minutes, you do not really care about 5 seconds of startup if the function itself is running an order of magnitude faster than node.js

Java projects are often a lot bigger than e.g. a node.js function. In any way you should always try to keep functions as small as possible to reduce the initial latency.

And of course performance shouldn't be the only factor when choosing your programming language. 

answered Dec 3, 2018 by Archana
• 5,560 points

Related Questions In AWS

+3 votes
3 answers
0 votes
1 answer

JVM environment used in Java for AWS

openjdk 1.8. is provided by lambda for ...READ MORE

answered Jan 29 in AWS by sukanya
24 views
0 votes
3 answers
+1 vote
2 answers

How do I get my AWS Glue client in JAVA?

Hey, you've been using a correct code ...READ MORE

answered Apr 17, 2018 in AWS by Cloud gunner
• 4,260 points
899 views
0 votes
1 answer
0 votes
1 answer
+2 votes
3 answers
0 votes
1 answer

Set environment variables in AWS Lambda

You can specify environment variables for AWS ...READ MORE

answered Dec 31, 2018 in AWS by Archana
• 5,560 points
498 views
0 votes
1 answer

How to invoke the AWS lambda function from Java code

There are 2 methods in this class which should ...READ MORE

answered Feb 19 in AWS by Archana
• 5,560 points
622 views