Live data from Hacker News

You can just port things to Cloudflare Workers

sigh.dev

41–50 of 56 posts

Re: You can just port things to Cloudflare Workers

#41

I really like the offering that Cloudflare has with workers, but for me they just seem to be lacking some DX tooling/solutions. Debugging is hell, but for quick projects like this I'll definitely look into it again. These days Railway is my go-to for hosting "throw-away" projects. Always wondering how its going for folks that are using Cloudflare Workers as their main infra?

> Debugging is hell Most people won't care because the extent of their debugging skills is console.log, echo, print. repeat 5000 times.

You missed out the important bit - think about the problem and data flow first.

After that it doesn’t matter much which tool you use to verify assumptions.

Re: You can just port things to Cloudflare Workers

#42

The really annoying thing about Cloudflare is that Workers don’t belong to zones (i.e. editing any worker is an account level permission, either: Read only or Edit), and thus you can’t scope a particular user or API key access to a particular set of workers. This means you can’t physically set different permissions between prod and dev workers, which is a disaster waiting to happen. (You can’t just make a second Clou…

> can’t just make a second Cloudflare account for Prod

Multi account support when you pay for enterprise.

Re: You can just port things to Cloudflare Workers

#43

As someone growing up with shared hosting, VPS and eventually K8s, I never really got Cloudflare's offering (apart from CDN/DDOS/DNS). I'm not sure if it's their positioning or if I never had the problems they're trying to solve, but it just doesn't click for me. Durable objects, Wrangler, D1, some custom Node.js API... it's all kind of opaque to me how it really solves any problem better than just using Postgres, Re…

Edge compute.

The workers execute from the same colos as the CDN, which are regionally distributed. They respond fast because they are physically close to the visitor and CloudFlare limits which runtimes they support to only very highly optimized ones.

And for my money, any platform that doesn’t require K8s is superior thank any which does.

Re: You can just port things to Cloudflare Workers

#44

As someone growing up with shared hosting, VPS and eventually K8s, I never really got Cloudflare's offering (apart from CDN/DDOS/DNS). I'm not sure if it's their positioning or if I never had the problems they're trying to solve, but it just doesn't click for me. Durable objects, Wrangler, D1, some custom Node.js API... it's all kind of opaque to me how it really solves any problem better than just using Postgres, Re…

Cloudflare seems to exclusively offer "serverless" products, which rules out applications like Postgres (or any other "standard" database technology).

Why don't they just offer "managed Postgres"? This is because their infrastructure is as homogenized as possible so does not offer hosting of arbitrary services or software, the only customizable code made available to customers are things like workers which are deliberately constrained (in execution time, resource usage, etc) to, again, allow them to keep all their infrastructure as homogenized as possible.

Most of their other products are to provide supplementary capabilities to workers.

For example, their durable objects are comparable (in terms of technical approach, problems they solve and trade-offs) to AWS's DynamoDB or Azure's Cosmos DB. These products are distributed by nature and work very well for certain kinds of projects and not so well for others. They're also fully in-line with the generally homogenous infrastructure that Cloudflare is engineered to work on.

In summary, Cloudflare has essentially homogenous infrastructure globally and is able to make their extensive edge infrastructure available to customers for customized applications by constraining it to "serverless" offerings. For customers that can work within the trade-offs of these serverless products, it's an appealing product.

Re: You can just port things to Cloudflare Workers

#45
post #42

The really annoying thing about Cloudflare is that Workers don’t belong to zones (i.e. editing any worker is an account level permission, either: Read only or Edit), and thus you can’t scope a particular user or API key access to a particular set of workers. This means you can’t physically set different permissions between prod and dev workers, which is a disaster waiting to happen. (You can’t just make a second Clou…

> can’t just make a second Cloudflare account for Prod Multi account support when you pay for enterprise.

Thanks, didn’t know. Starting at $2k/month though.

Re: You can just port things to Cloudflare Workers

#46
post #16

Earlier quoted context omitted.

Yeah, they are the only ones everyone uses, there is nothing else. And even those, have you ever tried anything beyond printf debugging? I bet not.

What language are you using that can't compile to WASM and isn't otherwise supported?

Java, C# for example.

Yeah, they are supported depending on the semantic interpretation of what the English word supported means.

As long one is happy with printf debugging, a language subset, and gimmick toolchains.

Re: You can just port things to Cloudflare Workers

#47

Cloudflare Workers has really improved lately, e.g. "Observations" and "Metrics", and on top of that their product suite keeps growing all the time. If you use Astro[1] together with Cloudflare then you have a solution that is at least on par with NextJS and Vercel, but that only costs a fraction. My latest project[2] also uses Astro and Cloudflare and it is rendered on the "edge" (i.e. SSR) in about 100ms – you won'…

Until they allow to deploy native code for serverless, they aren't on pair with Vercel.

Re: You can just port things to Cloudflare Workers

#48

Earlier quoted context omitted.

> Debugging is hell Most people won't care because the extent of their debugging skills is console.log, echo, print. repeat 5000 times.

printf() debugging is still considered a best practice in the eyes of many. I still remember being really surprised when I heard my famous (Turing award-winning) CS professor tell the class this for the first time. https://tedspence.com/the-art-of-printf-debugging-7d5274d6af...

The thing about printf debugging is that it works universally. All languages, all platforms, all stacks. Even down to the lowest levels of most software, there will always be some sort of log available.

While some tools/frameworks might have more robust debugging tools, if you have a dynamic role within an organization, you may not find it worth the effort to set them up if your target platform is constantly changing.

One real world example of this from my own work in PHP - there is a tool/lang-extension called XDebug that is great and provides step through debugging, but historically, it has been a pain to configure. It's gotten better, but when I can just as easily add a few `dump()` statements that expose the same data, it's overkill. Very rarely do I need to actually pause the running request to debug something and 99% of the time, I just want to know the state of that object within an specific `if()` block and a debug log gets me that same information.

Re: You can just port things to Cloudflare Workers

#49

Earlier quoted context omitted.

Is Cloudflare Pages still a thing? It looks like it's just Workers now.

It is, they've just aligned them under the same umbrella. It's literally "Workers & Pages" under the CF navigation.

It is mostly just workers though. There's a teeny tiny link there that says "are you looking for pages?".

Re: You can just port things to Cloudflare Workers

#50

Earlier quoted context omitted.

> Most people won't care because the extent of their debugging skills is console.log, echo, print. repeat 5000 times. I don't agree. The first thing any developer does when starting out a project is setting up their development environment, which includes being able to debug locally. Stdout is the absolute last option on the table, used when all else fails.

I don't agree! It's easiest to printf() things since you don't have to have tooling to debug every language you want to work with! while you should know this for anything you're proficient in, I usually reach for printf since it's usually quicker than messing with a debugger :)

> I don't agree! It's easiest to printf() things since you don't have to have tooling to debug every language you want to work with!

Nothing is easier than setting a breakpoint in a line of code and running the app.

When a breakpoint is hit, you also have access to local variables and their state. Some debuggers even allow us to change variable values at runtime.

Using printf is effective, but far from being the best way to achieve anything.

Post reply on HN