Is serverless hosting a good fit for a backend with long-running jobs?
Where the limits show up
Serverless platforms are designed for short, event-driven work. Functions usually have time limits, memory caps, and cold start delays. A job that imports large files, processes video, or runs for many minutes can hit those limits and fail in ways that are hard to debug.
You can still use serverless for the parts that fit, such as handling webhooks or serving API requests. Pair it with a queue and a worker running on a container or virtual machine for the heavy tasks. That split keeps costs tied to real usage while avoiding timeouts.
Check each platform's maximum run time. Move heavy jobs to a queue. Run long workers on containers or VMs. Test with realistic data sizes early.
Plan for retries and visibility
Long jobs need retries, logging, and a way to resume after a failure. Decide how you will track progress and alert on stuck tasks before you go live, since silent failures are common when jobs run outside a normal request.
Estimate your monthly cost under realistic load before choosing this route, since per-request pricing can change quickly when jobs run for long periods.
Common mistakes
- Assuming a platform's time limit is high enough without testing a realistic job.
- Running a long job inside a request handler and wondering why it times out.

Related questions
- How do I choose between Docker and a virtual machine for deployment?
- What is the best way to host a small web app cheaply?
- Is Kubernetes overkill for a small team?
- Should I use a PaaS like Heroku or manage my own server?
- Why do I need CI/CD for a solo project?
- Can I deploy a full-stack app without using Docker?