Live data from Hacker News

A 7KB AWS lambda Node.js library with zero runtime dependencies

npmjs.com

51–60 of 63 posts

Re: A 7KB AWS lambda Node.js library with zero runtime dependencies

#51
post #48

Earlier quoted context omitted.

Submit that to them then?

It might be a good idea, although I fear that if I only fix one node framework and keep the rest intact it will create a false impression that that framework is somehow amazing. Still better than a false impression that nodejs is somehow slow. They really need some QC though.

Maybe we'll have to disagree because I'm still pretty sure nodejs is somehow slow.

Re: A 7KB AWS lambda Node.js library with zero runtime dependencies

#52
post #2

Not knowing this myself, could someone explain the attraction in using a web scripting framework for stuff like this? I get that this particular example makes the whole thing seem fairly straightforward, but have never really heard why people like adapting Node.js and similar to non-web environments beyond "you can". Is there anything more to it than that?

I use node.js in AWS Lambda because I run Clojurescript on top of it.

My application (https://operatr.io/) is Clojure (JVM / Back-end), Clojurescript (Browser / Front-end), Clojurescript (AWS Lambda) - there's enormous leverage is using one language in all cases.

I have at least one function that exists in all three environments, but more than that I have one common language for delivery.

Re: A 7KB AWS lambda Node.js library with zero runtime dependencies

#53
post #48

Earlier quoted context omitted.

It might be a good idea, although I fear that if I only fix one node framework and keep the rest intact it will create a false impression that that framework is somehow amazing. Still better than a false impression that nodejs is somehow slow. They really need some QC though.

Maybe we'll have to disagree because I'm still pretty sure nodejs is somehow slow.

You don't have to trust me, here is a diff you can apply of the work I did: https://gist.github.com/spion/2779ae6dc9552c229c1eeacd90c03b...

you can run ./tfb --test express-postgres and compare.

If you can't wait for all the tests to complete, a representative one can be obtained more quickly by running

./tfb --test express-postgres --type db --query-levels 10 --concurrency-levels 128

Re: A 7KB AWS lambda Node.js library with zero runtime dependencies

#54
post #20

Earlier quoted context omitted.

Node is especially good at handling async stuff. It’s in the JavaScript DNA. Whether through callbacks, Promises or async/await. As many backend apps are basically tying together 3rd party and 1st APIs it’s actually a very logical choice.

Kind of silly in a lambda though, as lambdas do not run concurrently. A bash script would suffice.

I have many that call a handful of backend services, handle errors, process the data, and send it to the client.

Very async.

Re: A 7KB AWS lambda Node.js library with zero runtime dependencies

#55

Earlier quoted context omitted.

Kind of silly in a lambda though, as lambdas do not run concurrently. A bash script would suffice.

I have many that call a handful of backend services, handle errors, process the data, and send it to the client. Very async.

[deleted]

Re: A 7KB AWS lambda Node.js library with zero runtime dependencies

#56

Earlier quoted context omitted.

Kind of silly in a lambda though, as lambdas do not run concurrently. A bash script would suffice.

Lambda for NodeJs doesn't / won't run multiple requests in the same process but different V8 contexts at the same time? That sounds wasteful, and imo makes Cloudflare's Serverless tech superior for strictly network-io bound workloads. Lambda, to be fair, supports way many event triggers and all sorts of runtime and user-space constructs, but still manages warm start times <10ms which is really impressive.

Cloudflare uses V8 Isolates feature and they build a lot of the API backends to follow the WebWorker spec. It's very efficient and well-suited for logic running in network calls at the CDN edge but limited to Node/JS code. [1]

AWS Lambda uses their Firecracker micro-vm tech which supports more runtimes, environments and triggers than just Node and also runs container workloads. [2]

1. https://www.infoq.com/presentations/cloudflare-v8/

2. https://firecracker-microvm.github.io/

Re: A 7KB AWS lambda Node.js library with zero runtime dependencies

#57
post #2

Not knowing this myself, could someone explain the attraction in using a web scripting framework for stuff like this? I get that this particular example makes the whole thing seem fairly straightforward, but have never really heard why people like adapting Node.js and similar to non-web environments beyond "you can". Is there anything more to it than that?

> Not knowing this myself, could someone explain the attraction in using a web scripting framework for stuff like this?

Node is not a web scripting framework, though the fact that JS is used as the main language for web front end is a big part of the attraction; as it lets frontend and backend share code and be served by the same language competency.

Re: A 7KB AWS lambda Node.js library with zero runtime dependencies

#58
post #20
post #2

Not knowing this myself, could someone explain the attraction in using a web scripting framework for stuff like this? I get that this particular example makes the whole thing seem fairly straightforward, but have never really heard why people like adapting Node.js and similar to non-web environments beyond "you can". Is there anything more to it than that?

Node is especially good at handling async stuff. It’s in the JavaScript DNA. Whether through callbacks, Promises or async/await. As many backend apps are basically tying together 3rd party and 1st APIs it’s actually a very logical choice.

I find that to be a mess compared to other languages like C# that have much more solid and clean async/await implementations.

Re: A 7KB AWS lambda Node.js library with zero runtime dependencies

#59
post #2

Not knowing this myself, could someone explain the attraction in using a web scripting framework for stuff like this? I get that this particular example makes the whole thing seem fairly straightforward, but have never really heard why people like adapting Node.js and similar to non-web environments beyond "you can". Is there anything more to it than that?

It's mainly economic. There are plenty of JavaScript web developers. Now management can take them off the web silo and put them to work anywhere.
Post reply on HN