Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Railway 11 min read How-to mediumAdept

Serverless functions vs containers: CI/CD, database connections, cron jobs, and long-running tasks

Serverless functions and container platforms differ in execution model, which changes how you handle deploys, database access, cron jobs, rollbacks and long-running work. Serverless imposes execution limits of 30 seconds to 15 minutes, memory caps, cold starts and no persistent connections, so long jobs need checkpointing, chained invocations or streaming. Railway's containers avoid those limits and add automatic private networking, reference variables for credentials, and cron with skip-if-running semantics that requires jobs to close connections and exit. Rollbacks are similar on both, but schema migrations should stay backward compatible because rolling back code does not reverse them.

Related posts

  • Railway vs Cloudflare: How Their Architectures Differ and When to Use Each

    Railway mediumAdept

    Railway and Cloudflare's Developer Platform feel similar on the surface but rest on opposite compute models. Railway runs long-lived regional containers with stable in-memory state, persistent volumes and up to 32 vCPU/32 GB per instance. Cloudflare Workers are edge-first, single-threaded V8 isolates capped at 128 MB memory and CPU-time limits, with no filesystem or reliable global state, so state needs Durable Objects, KV, D1, R2 or external databases via Hyperdrive. The recommended pattern is to combine them, with Cloudflare as the global front door (CDN, caching, routing, security) and Railway hosting stateful backends, databases and long-running work.

  • Deploy Full-Stack TypeScript Apps: Architectures, Execution Models, and Deployment Choices

    Railway easyNovice

    Full-stack TypeScript apps can be structured either as a single framework codebase (Next.js, SvelteKit, TanStack Start) or as independently deployed services in a monorepo, and the choice interacts with whether you deploy to serverless platforms or long-running servers. Serverless (Cloudflare Workers, Vercel) gives automatic scaling and no infrastructure management, but imposes stateless, instance-scoped globals, 128 MB memory and CPU-time caps on Workers, and no persistent connections. That rules out ETL, media processing, WebSocket chat and live dashboards. Long-running servers keep in-memory state, open connections and arbitrary protocols, at the cost of capacity planning. Railway pitches itself as offering those server semantics with usage-based billing and managed infrastructure.

  • The Best Serverless Platforms in 2026

    Railway easyNovice

    "Serverless" in 2026 covers three distinct runtime contracts: function-as-a-service (Lambda, Workers, Vercel, Azure Functions), container-as-a-service with scale-to-zero (Cloud Run, Fargate/ECS Express Mode), and full-app scale-to-zero on usage-based pricing (Railway). Ten platforms are ranked by how often each is the right fit, with features, pricing, and tradeoffs for each, including cold starts, runtime constraints, cloud setup overhead, lock-in, and reliability history. The vendor-authored argument is that rewriting an existing app into FaaS handlers usually costs more than it saves. Edge-shaped workloads fit Cloudflare Workers, bursty GPU jobs fit Modal, and AWS- or GCP-native teams should stay with their cloud's offerings.

  • Bringing serverless functions closer to the speed of wire

    Modal mediumAdept

    Modal rebuilt its serverless I/O plane, which queues Function inputs and outputs, and now runs it in at least four regions. A new `routing_region` flag lets callers avoid round trips to us-east, and the completed migration cut end-to-end Function Call latency by about 80ms at p50. The redesign moves non-critical work like autoscaling stats and dashboard events to the background and minimizes shared-storage access on the hot path, using client-side metadata caching and JWT-based auth. It also rewrites the server layer from async Python to Go to avoid event-loop lag, and stays on Redis 7.1 for its Redis-streams queues after load tests showed CPU spikes from 7.2 onward. Users are advised to route near their clients, keep payloads under 2MiB to skip blob-storage uploads, and batch small inputs.

  • Workflow SDK 5: built for production

    Vercel mediumAdept

    Workflow SDK 5 reworks Vercel's durable async JavaScript workflow engine around security, regional placement and performance. Step payloads are now encrypted end to end with AES-256-GCM using per-run keys. On self-hosted Worlds, encryption works through a getEncryptionKeyForRun() hook. Runs are pinned to a home region chosen at start(). The engine executes multiple steps inline instead of taking a queue hop per step, replays incrementally, and streams over WebSockets. Benchmarks against v4 show p75 step-to-step overhead dropping from 618 ms to 109 ms, late-run overhead in a 1,020-step workflow falling from 1,748 ms to 70 ms, and stream delivery time improving 4.2×.

The quest for software engineering knowledge.

Look:
Layout: