Remix.run Logo
csomar 3 hours ago

I'm building my entire back-end on CF Workers. The DX was really frustrating starting out, but I'm using Rust/WASM, which means most of my issues get caught at compile time. My suggestion: avoid all the CF offerings (DB, Pages, KV, etc.) and stick with just Workers. They're pretty stable and reliable (more so than Cloudflare itself, hehe), and once you figure out their rough edges, you'll be fine.

huijzer 2 hours ago | parent | next [-]

What DB do you use? I tried the same for while but eventually gave up because it was incredibly restrictive and not much cheaper than a self managed VPS with some Docker containers. I mean the biggest thing that could happen to me is landing on the HN front page and a $5 per month VPS can manage that easily

jddj 2 hours ago | parent | next [-]

You won't beat a good self-managed VPS with some docker containers unless you start adding criteria like SLAs and whatnot.

Then you'll still not beat a good self-managed VPS but you'll have someone else to blame

DanielHB an hour ago | parent | next [-]

I am not much of a devops person but running your own DB in a VPS with docker containers don't you also need to handle all this manually too?

1) Creating and restoring backups

2) Unoptimized disk access for db usage (can't be done from docker?)

3) Disk failure due to non-standard use-case

4) Sharding is quite difficult to set up

5) Monitoring is quite different from normal server monitoring

But surely, for a small app that can run one big server for the DB is probably still much cheaper. I just wonder how hard it really is and how often you actually run into problems.

csomar an hour ago | parent [-]

My guess is some people have never worked with the constraints of time and reliability. They think setting up a database is just running a few commands from a tutorial, or they're very experienced and understand the pitfalls well; most people don't fall into the latter category.

But to answer your question: running your own DB is hard if you don't want to lose or corrupt your data. AWS is reliable and relatively cheap, at least during the bootstrapping and scaling stages.

h33t-l4x0r 2 hours ago | parent | prev [-]

CF workers are v8 isolates FYI

csomar an hour ago | parent | prev [-]

AWS RDS. I have no intention of managing my own DB and the insanity that comes with that.

locknitpicker 2 hours ago | parent | prev [-]

> I'm building my entire back-end on CF Workers. The DX was really frustrating starting out, but I'm using Rust/WASM, which means most of my issues get caught at compile time.

Cloudflare Workers support WASM, which is how they support any runtime beyond JavaScript. Cloudflare Worker's support for WASM is subpar, which is reflected even in things like the Terraform provider. Support for service bindings such as KV does not depend on WASM or anything like that: you specify your Wrangler config and you're done. I wonder what you are doing to end up making a series of suboptimal decisions.

csomar an hour ago | parent [-]

The bindings are still done at the JS level. But to answer your question, I'm building a git workflow engine (kind of a lightweight GitHub Actions alternative; see https://codeinput.com). In that context, you get lots of events and payloads from Git/GitHub that typically require very little resources to respond to or relay.

The worker model made sense, so I developed the whole app around it. Now of course, knowing what I know today, I might have considered different options. But at the time, I read the description (and had some Cloudflare Workers experience) and thought this looked good.