A decision guide for choosing between serverless Workers and a persistent VPS, including a hybrid architecture that uses both.
In plain English
This guide is about how to split a bot into understandable parts. The aim is to make one component replaceable without forcing a rewrite of everything else.
runtimestateadapteridempotency
Worker strengths
- Public HTTPS endpoint without maintaining a web server.
- Fast request validation and routing.
- Good for short stateless operations and static assets.
- Useful as a shield in front of a private backend.
VPS strengths
- Long-running Python/Node processes.
- Websocket clients and continuous polling.
- Local files and SQLite.
- Full control over packages, processes and system tools.
Hybrid is often the practical answer
Internet / TradingView
↓
Cloudflare Worker
validate + normalize
↓
private VPS endpoint
↓
strategy + broker adapter + database
This keeps the public surface small while preserving a normal Linux environment for heavier bot logic.
Official reference
Before you rely on this in production
- Each component has one clear responsibility.
- State survives the restart cases that matter.
- External platform details are isolated behind adapters.
- A safe stop/disable mechanism exists.
