Offload your long tasks and gain performance.
Build, control, and scale jobs without limits.
Install the client, wrap a function, deploy with GitHub. Done.
Stack and scale included with no configuration hassle.
>
1import { defer } from "@defer/client";23const greet = async (name: string) => {4 console.log(`Hello, ${name}!`);5}67export default defer(greet);
1
const
algoliaIndex
=
algoliaClient
.
initIndex
(
'INDEX_NAME'
)
;
2
3
async
function
algoliaUpdateAllArticles
(
)
{
4
const
now
=
new
Date
(
)
5
const
articles
=
await
prisma
.
articles
.
findMany
(
{
6
where
:
{
7
updatedAt
:
{
lt
:
now
,
gte
:
previousFriday
(
now
)
}
8
}
9
}
)
;
10
11
await
algoliaIndex
.
replaceAllObjects
(
12
articles
.
map
(
(
article
)
=>
articleToSearchObject
(
article
)
13
)
;
14
await
prisma
.
articles
.
update
(
{
15
where
{
id
:
{
in
:
articles
.
map
(
a
=>
a
.
id
)
}
}
,
16
data
:
{
updatedAt
:
new
Date
(
)
}
17
}
)
;
18
}
19
20
export
default
defer
.
cron
(
algoliaUpdateAllArticles
,
"0 0 * * *"
)
;
Define a CRON job directly from your code, using `defer.cron()`
.
Commit and push to Github, your CRON is now released and ready.
Say goodbye to flaky scripts or production command line access.
Pause a function when it should not be enqueued.
Attach custom data to better identify and manage your executions, e.g. user-id.
Actions are triggerable from the console, the client or the API.
Set yourself free of timeouts.
Run very long tasks. Starting at 30 minutes, the time limit is fully customizable.
Gain performance by parallelizing jobs.
Leverage precise control over concurrency, at the function level.
Trust your workflow logic.
All your jobs will be picked up in the exact order they were enqueued.
Never loose an execution.
Full history, arguments, results, final state are persisted and queryable.
Compute with your needs, as you scale.
Resources are customizable at the function level.
Compute large documents and files.
Enqueue jobs with payload of size up to 16Mb.
Enqueue millions of jobs without worrying about storage.
Your queue is stored on the Defer platform.
Handle your business logic, not your infrastructure.
Defer serverless platform scales for you.
Rely on the Defer platform resilience.
Our distributed scheduling cluster ensures your jobs always run.
We could divide the processing time of our data import jobs by 5 by switching them to Defer, with almost no changes to the code and no new infrastructure to deploy
Would've used AWS CDK to setup SQS and Lambda. And had to figure out how to cleverly re-use code from our main codebase in that context, probably pack a bunch of Lambda Layers, and trial/error my way to a shared Prisma db and schema between node and aws repos. So much pain avoided ❤️
Defer basically gives you serveless endpoints without the headache.
Really loving Defer and planning to build much more complex functionality on top of it
Damn that was flawless. I'm baffled by how easy it was to
setup, and how good the DX is.
Plus the dev environment promise-based runner, the simple env var to set-up to run in defer infra... And the dashboard which givesme exactly what I wat super easily. Big kudos really