/plushcap/analysis/inngest/inngest-vercel-long-running-background-functions

Long-running background functions on Vercel

What's this blog post about?

The article discusses how developers can run long-running background functions on Vercel, a serverless platform. Traditionally, serverless functions are used for synchronous APIs but when critical business logic needs to be executed that requires longer timeouts than the usual short ones provided by platforms like Vercel (10 to 60 seconds), developers have to make choices. One option is to move these jobs to another infrastructure provider such as AWS Lambda, but this comes with trade-offs including more overhead and complexity. The article suggests two solutions: finding a way to run longer functions or breaking the functions into smaller, coordinated ones that can run independently. It recommends breaking up long-running jobs into individually retried steps and utilizing something that orchestrates each of these steps, including persisting the output across multiple steps and retrying each step when failures occur. Inngest is a platform designed to handle complex workloads comprised of any number of steps. It does not host your code; instead, it remotely and securely invokes your functions via HTTP. Your code all runs on Vercel or whatever platform you're using. Inngest has several handlers including Next.js, Remix, Nuxt, RedwoodJS, amongst others. The article provides an example of how to use the Inngest SDK for long-running functions and explains how to deploy these functions using Vercel integration. It also mentions other cool things that can be done with the Inngest SDK such as running steps in parallel, putting the function to sleep, and scheduling work in the future.

Company
Inngest

Date published
March 31, 2023

Author(s)
Dan Farrelly

Word count
1485

Hacker News points
None found.

Language
English


By Matt Makai. 2021-2024.