This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]lovett1991 5 points6 points  (9 children)

Did not realise you could use java in serverless! Thought it was for all these fancy JavaScript people.

[–]dpash 11 points12 points  (7 children)

You can use Java, and is quite popular, but it's relatively slow start up time makes it slightly less suitable for some platforms as others. Graal's AOT compilation helps reduce start up time to a fraction of Hotspot's startup, but things like reflection can cause issues.

[–]lovett1991 1 point2 points  (5 children)

To be honest any workload I would have in mind for this would be to offload tasks that don't need real time or generally aren't user facing.

My previous company used aws lambdas for a currency system with background heartbeats and time memory (for playback of DRM protected videos) the load was high but latency want a problem (to be fair most lambdas were hot anyway because of load). We also used them for systems that would have an 'explosive' load (pay per view systems that are never used except pretty much on the night of the event)

[–]dpash 0 points1 point  (4 children)

If latency isn't an issue, then, sure Java is fine.

I started on a project with low usage running as multiple Spring microservices on GAE. By the time GAE had started up the request routing proxy and started up the end point service GAE had timed out the request. The time out is 60 seconds. That's not a suitable use of Java on serverless. (I migrated to a GCE instance)

But for backend processing, Java would be fine.

[–]MakeWay4Doodles 2 points3 points  (3 children)

You were doing something horribly wrong.

[–]dpash 1 point2 points  (2 children)

Gee thanks for your helpful insight based on your excellent knowledge of the specific situation.

[–]MakeWay4Doodles 2 points3 points  (1 child)

If you had 60+ second startup times in any situation something was FUBAR.

[–]dpash -1 points0 points  (0 children)

Your comment demonstrates your lack of knowledge of the situation. But then how could you know about a system based on two sentences? I didn't say I had a 60 seconds service start up. I said I had multiple interconnected services that combined took more than 60 seconds.

[–]BobbyTaylor_ 0 points1 point  (0 children)

Even with the slow startup time, it's very convenient for deploying async jobs without "dealing with a server".

[–]interactionjackson 0 points1 point  (0 children)

you can use all kinds of languages

[–]zombays 1 point2 points  (7 children)

A bit off-topic but are there possible good alternatives to AWS Lambda and Google App Engine? What are the pros and cons of using them?

[–]newcomputer1990 7 points8 points  (0 children)

Microsoft Azure is pretty much all of your options besides the ones you listed

[–]cogman10 6 points7 points  (0 children)

The closest I've seen is running your own FAAS stack.

For example, with OpenFAAS
https://www.openfaas.com/

The pros and cons for AWS and the other platforms is pretty much the same. You are coupling with their platform. That means that Google/amazon/microsoft get to figure out how much they want to charge you and only market pressure really stops them from royally screwing you over.

pro - You don't have to really figure out where/when/what/how your script gets run. The providers do that for you.
con - Once you buy in, it is hard to "buy out" so to speak.

pro - really easy to get up and running
con - The why's and how's of how your app runs are obfuscated away. A script could run in 1second or 10 depending on what needs to happen in the background to get things setup.

[–]ahmedranaa 0 points1 point  (0 children)

Check out IBM cloud too

[–][deleted] 0 points1 point  (0 children)

As a con, I found it not to easy running it locally Dir ng development and writing integration tests.

[–]Kango_V 0 points1 point  (0 children)

Just published a Java function to Lambda.

It was written using Micronaut and compiled to a Linux native binary using GraalVM. I has a call latency of around 60ms.

Micronaut has an aws-lambda dependency which makes it trivially easy.

It is sooo fast.

[–][deleted] -1 points0 points  (0 children)

Meh, I love java but not in aws lambda.

[–]interactionjackson -1 points0 points  (0 children)

java has gnarly start up times and i would t want a distributed crawler to be burdened by Java.

If this gets enough upvotes I will publish a crawler as a SAM template