temporalio / documentation

Temporal documentation
https://docs.temporal.io
Other
89 stars 229 forks source link

Guidance for deploying TypeScript Workers #1857

Open lorensr opened 1 year ago

lorensr commented 1 year ago

Brief description

Each SDK should have different guidance on deploying workers. I think it should be part of the dev guide, as it's something all developers will need to do (or at least someone on your team will need to set it up and monitor it, similar to metrics/tracing).

Your recommended content

There are a number of ways to run your Worker code in production and scale it to meet your production load.

What about serverless? Workers are stateful, long-running processes: they poll for tasks and keep a cache of active Workflow Executions in order to reduce resource consumption and latency. Therefore they cannot be run in AWS Lambdas or other serverless environments. You can, however, call serverless functions from your Activities.

lorensr commented 1 year ago

content on building code:

Pre-build code

In most of our samples:

We can improve our Worker's startup time by building code in advance.

Worker code

The Worker code can be built and run with:

npm run build
node lib/worker.js

Workflow code

See bottom part of this section.

lorensr commented 1 year ago

Can include this env vars file: https://github.com/temporalio/documentation/pull/1948