Menu

The Disk Isn't Yours: Four Ephemeral-Host Myths and a Restart Drill
πŸ“°

The Disk Isn't Yours: Four Ephemeral-Host Myths and a Restart Drill

DEV Community: cloudΒ·Jordan HuangΒ·21 days ago
#dGd0ch6n
#devtocloud#devto#dev#model#host
Long article (1217 words) β€” no AI summary yet.
Reading 0:00
15s threshold

You deploy a small worker on a free server. It runs fine for a week.

Then the host restarts, and the worker wakes up confused.

This post is about that morning. Not the deploy. The wake-up.

The claim I keep hearing

"It's just a tiny script. Local files are enough."

That sentence is usually true until the first restart.

Free hosts are cheap because something is disposable. Usually it is you.

Below are four myths, the corrected mental model, and a drill you can adapt.

All code here is illustrative . I did not execute it for this article.

Myth 1 β€” "The disk is a database"

The claim: writes to /data or ./state survive anything.

Why it breaks: a container's writable layer belongs to that container.

Destroy the container and the layer goes with it.

The Twelve-Factor App calls this out under processes : processes are stateless, and state belongs in a backing service.

Docker's storage documentation describes the writable layer the same way.

Corrected model: local disk is a cache , not a source of…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.