TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Faast.js – Serverless Batch Computing Made Simple

202 pointsby achouabout 6 years ago

9 comments

achouabout 6 years ago
Hi everyone, faast.js is a library that allows you to use serverless to run batch processing jobs. It makes it super easy to run regular functions as serverless functions. This is one of my first open source projects and I'd be happy to answer any questions here.
评论 #19811269 未加载
评论 #19811421 未加载
评论 #19811946 未加载
gregmacabout 6 years ago
From what I can tell, it&#x27;s the invocation model and deployment that is unique here?<p>You invoke faast from your local machine (or build server, or cron job, whatever), and in turn it deploys some functions to a serverless platform and runs them, then tears them all down when complete. Eg, from the site, this code runs locally:<p><pre><code> import { faast } from &quot;faastjs&quot;; import * as funcs from &quot;.&#x2F;functions&quot;; (async () =&gt; { const m = await faast(&quot;aws&quot;, funcs); try { &#x2F;&#x2F; m.functions.hello: string =&gt; Promise&lt;string&gt; const result = await m.functions.hello(&quot;world&quot;); console.log(result); } finally { await m.cleanup(); } })(); </code></pre> You wouldn&#x27;t want to run <i>this code</i> on serverless, as you&#x27;d be paying for compute time of just waiting for all the other tasks to complete.<p>It would be useful to see a discussion about how and where to host this entry code, may even a topic on &quot;Running in production&quot;.<p>It&#x27;s definitely a neat idea because if you control the event that kicks everything off anyway (eg: &quot;create monthly invoices&quot; or &quot;build daily reports&quot;) you can deploy the latest version of everything, run it and clean it up in essentially a single step.<p>(Please correct me if I&#x27;ve misunderstood any of the details here!)
评论 #19812425 未加载
评论 #19813048 未加载
评论 #19814920 未加载
asadlionpkabout 6 years ago
This can be great for scrapping jobs!<p>There are IP-based rate limiters on sites (linkedIn, facebook, etc), but each lambda has a new public IP so by using faast.js, I can stay under the radar.<p>Plus you can essentially spawn a headless chrome (puppeteer) to do advanced stuff.
评论 #19812716 未加载
dongxuabout 6 years ago
Very interesting project, the problem with Serverless service provided by different public cloud vendors is that programming and API are not uniform. I think Faast.js is on the right path to creating a unified interface for different Serverless services.
评论 #19811386 未加载
BrandiATMuhkuhabout 6 years ago
Love what you did!<p>We resently were exactly in a situation where we had to do heavy processing of ~4000 items each running between 1-10minutes. To speed the process up we ran it on lambda. That means our process went down from 10h++ on a single core computer to about 15min running it on 4000 lambdas.<p>Your library would have saved us quite some work as it would take away a lot of Aws config, deploy, etc....<p>Btw: I&#x27;m thinking of building a similar library for multi core&#x2F;webworkers for node.js. currently a lot of boilerplate is required on node.js to make a loop run parallel on all cores.
评论 #19812359 未加载
mring33621about 6 years ago
This is neat, but would be more useful if it could deploy cloud functions made in language {x} and provide local js proxies for them.
评论 #19812370 未加载
sourc3about 6 years ago
This is very neat! Last year I had to essentially do this on GCP and relied on a very similar implementation. Everyone was surprised to see JS being used for data processing but it worked wonderfully.<p>One thing I want to ask is the retries, how do you handle that currently? I ran into multiple cases where functions would fail for transient reasons.
评论 #19812754 未加载
heathermillerabout 6 years ago
Reminds me a bit of like 2019&#x27;s version of RMI...
dead_mallabout 6 years ago
Looks interesting. The concept reminds me of RPyC