News for hackers. Stuff that matters.
Re:Programming Culture in the Late Aughts by divbzero on Thursday June 08, 2023 @12:27AM (#36237193)
12 years ago, even without AWS, you could get a Linode, host an app on its naked IP, and not made to feel too much like you weren't "serious" about hosting your app. These days you almost always need to know a fair bit of Docker and Docker Compose, a lot of people want to Kubernetes, ELBs got replaced by ALBs + NLBs which you gotta manage in VPCs which you gotta manage through Security Groups and your traffic gets routed through CDNs. Logs are structured and passed to a SaaS which will have a custom search syntax that takes tens of seconds to search them poorly, and they'll get lost in the noise of all those components. You'll spend a non-trivial amount of time devising systems for tracing requests through all these components.

That sounds so spot on.

We do have a choice though. Static HTML, server-side templating, vertical scaling and /var/log still exist and work just fine. We don’t need to adopt the newfangled techniques unless the use case calls for them.

Re:Programming Culture in the Late Aughts by Klonoar on Thursday June 08, 2023 @02:15AM (#36237934)
I feel fortunate to run one of my current projects in that aforementioned "Linode-esque" fashion.

It is just so, so much simpler to debug and trace what's going on. It can handle a surprising amount of traffic and work before any actual issues come up. Nothing changes from an upstream vendor, at all. It really "just works".

That said, I'm very aware there's a sweet spot and that this doesn't work past a certain point. I just think that point is so far beyond where most people actually get.

Re:Programming Culture in the Late Aughts by namaria on Saturday June 10, 2023 @02:05AM (#36268050)
Niche is ok, niche is good. The entire western civilization was built on shopkeepers and tradesmen. The concepts of private domicile, personal freedom, even democracy itself one could argue, are firmly founded on skilled people doing niche work for their communities. Corporations are inherently imperialistic. Bring back niche entrepreneurship, I say!
Re:Programming Culture in the Late Aughts by ilrwbwrkhv on Thursday June 08, 2023 @02:58AM (#36238240)
But you literally don't have to do any such thing though.

A simple make file and maybe a load balancer can easily let you launch large web applications used by millions of users.

I do not understand where people are getting stuck here that they need all of this complexity.

How many users do these apps have?

Re:Programming Culture in the Late Aughts by physicsguy on Thursday June 08, 2023 @03:10AM (#36238330)
Way less than people think they’re going to.

When I started my current job, the project was veering into microservices hell by a team that did not understand how to build a web application. A rough back of envelope calculation of potential customer base and what the product was aimed at (B2B in renewables) told me that even with world domination, the backend of the application would at most have 50k active users ever. So we didn’t really need 30 different microservices all which could scale independently, maybe just 2 or 3 larger services.

Re:Programming Culture in the Late Aughts by ep103 on Thursday June 08, 2023 @03:50AM (#36238576)
Yup, this is what I'm working on right now.

10 microservices to support a 2 page static html webpage.

We "needed" microservices for "Scalability", but we will never have more than a few hundred users at a time.

We can't have simple logging of our services, because all logs have to go to Loki, and Loki only does full text search. So first, learn how to query with Grafana's querying language in order to do any searches at all, then figure out what you will ever need to search, and turn that into a prometheus metric, but wait, now we have to properly compose our metrics for queryability....

I need to implement retry logic in one of my microservices. Would be easily implementable with an Amazon SQS or RabbitMQ queue. But we can't have queues, because they aren't stateless. We need to use Kafka because it has the ability to scale to billions of events, never mind that we never see more than 10k events in a 24 hour period. So now we'll need to write custom logic for retries and managing state outside of the queue, which means we're back to using database tables, which means there's no point to using kafka to begin with for our application...

Our services build in gitlab to docker images which then are hosted in the cloud and managed by k8s in custom vpcs. Sure, makes sense. But also, can someone show me how the developers on the team are supposed to be able to run the system locally? What? Can't do it? Replicating the production environment for local builds is now too heavy a lift and has been deprioritized by management? So how are they supposed to develop again? Oh, they'll just never learn how the whole system works, and continuously make changes they assume are isolated to their specific microservice without realizing they've introduced an error into the wider system unless the lead/manager catch it? Got it.

I could go on. Architects choosing technologies over listening to their engineers, in order to pad their resumes with technologies that look good to other architects. Committees of middle-managers choosing the 'safe' enterprise technologies instead of what is actually needed.

Re:Programming Culture in the Late Aughts by belmont_sup on Thursday June 08, 2023 @08:41AM (#36240914)
I can feel the raw anger and exasperation. Well done.
Re:Programming Culture in the Late Aughts by reidjs on Thursday June 08, 2023 @11:12AM (#36243204)
Resume based development!
Re:Programming Culture in the Late Aughts by collyw on Thursday June 08, 2023 @12:02PM (#36244112)
Sounds all too familiar. We had an application that ran MRI analyses. The web app to manage the jobs was all set up in kubernetes to scale on demand. But is was a basic CRUD app and we had less than 300 users.
Re:Programming Culture in the Late Aughts by namaria on Saturday June 10, 2023 @02:07AM (#36268056)
Do you work where I left earlier this year? Exact same description: extremely small total user base, 30~ people company, deploying 30~ services on Kubernetes... I was being asked to take over repositories full of configuration files. No, thanks.
Re:Programming Culture in the Late Aughts by citrin_ru on Thursday June 08, 2023 @03:27AM (#36238443)
Startup mentality - you preparing to serve 100M users even if you have 1.5 right now and it will be rare luck to have even 1M because if you will not hit high numbers it doomed: high investment will not bring equally high returns and everything will be scrapped.
Re:Programming Culture in the Late Aughts by ilrwbwrkhv on Thursday June 08, 2023 @11:49AM (#36243928)
100M records is ~ 20 GB database. One of my companies needs to deal with large spikes in traffic coming from sudden virality on Tiktok and it peaks at around 8M users within a day or so. I handle all of that on a single beefy Hetzner machine with cycles to spare.
Re:Programming Culture in the Late Aughts by collyw on Thursday June 08, 2023 @12:04PM (#36244161)
Stack overflow has very modest requirements considering it's one of the most visited sites on the net. https://stackexchange.com/performance
Re:Programming Culture in the Late Aughts by paganel on Thursday June 08, 2023 @03:26AM (#36238431)
> How many users do these apps have?

There aren't that many projects that have "millions" of users.

Re:Programming Culture in the Late Aughts by notmypenguin on Thursday June 08, 2023 @05:15AM (#36239158)
Not only that, half this supposedly necessary tech actually slows you down: containers and kubernetes, websockets galore, clients like giant barnacles on your server, then we get these best practices that weren’t thought out well: sessions, etc… mostly it’s the cargo cult implementation knee jerk response “gotta have it” like some frontend maniac from 2010 adding jquery to everything, when what is needed is to keep the hood open and keep people talking about the engine parts instead of calling it done and schlepping some guys tractor drag race motor around town delivering pizzas
Re:Programming Culture in the Late Aughts by dotxlem on Friday June 09, 2023 @09:48AM (#36257770)
> instead of calling it done and schlepping some guys tractor drag race motor around town delivering pizzas

This sounds way too specific to be a hypothetical

Re:Programming Culture in the Late Aughts by aa-jv on Thursday June 08, 2023 @03:32AM (#36238473)
>We do have a choice though.

I took the choice: to run from the web with my hair on fire, screaming.

Towards embedded, where none of this matters, and where the crux of the whole thing is really, really important: its the atoms, then the electrons...

We don't need the web if the user holds our interface in their hands. Surprisingly enough, the web holds an iron grip on that face/phone interface, but .. one easy solution to all the cruft, is simply return to the roots.

Yes, this requires hardware production capabilities. Its not for everyone, then.

But I tell you, 40 years into this industry, it was so refreshing to abandon all of the fancy front-end stuff and just get straight down to the embedded realm. Nothing nicer than having the machine - and the user - all to oneself.

Of course, this edge case gets discussed further in the article, but that is just one of a few things this old-timer could say about what went wrong with programming culture... (*cough* *cough*..should never have removed the compiler..*cough* *cough*.. this opened the door for all the weirdos to take over what should've stayed in the OS .. *cough*)

Re:Programming Culture in the Late Aughts by namaria on Saturday June 10, 2023 @02:14AM (#36268094)
I keep finding myself reading Forth literature and playing with gforth in the evenings, thinking fondly of hardware to escape the atrocities of editing yaml and waiting 10-30 minutes to see results. Maybe I should run in the same direction...
Re:Programming Culture in the Late Aughts by aa-jv on Saturday June 10, 2023 @04:01PM (#36274479)
You really should. I encourage you to do so. There is still so much potential in the embedded world to "get it right" - i.e. undo all the cruft and bloat of the desktop/web/etc.

But, be careful, its requires just as much rigour as any other market. Perhaps more so, in some ways. Tooling and methodology are a lot more important ..

Re:Programming Culture in the Late Aughts by marginalia_nu on Thursday June 08, 2023 @03:57AM (#36238611)
Works better than ever. If anyone ever asks how my search engine, running on consumer hardware and hosted off domestic broadband, how it survives the hacker news front page time and time again without the load times even deteriorating a bit, while many other websites that are ostensibly static in nature tend to keel over?

Then the answer is something like this.

* nginx

* Java

* Macroservice architecture

* Vertical scaling

* Server-side rendering

* Minimal javascript, no session cookies. These things bump the cost of each page-load.

* /var/log with relatively sparse logging in the sunny day path

Like this is a pretty strict design philosophy. You can probably do more JS and front-end stuff than I do, but it should be understood it's not free. My page loads incur for the most part a single request each. There are websites where each page load incurs hundreds of requests. It's worth repeating: Back-end requests are not free. They are cheap, but they are not free. When you have a dozen users and they incur a few thousand requests, that may be within what your server can deal with. When you have a thousand users and they incur hundreds of thousands of requests, it's probably not as fine.

Re:Programming Culture in the Late Aughts by Tade0 on Thursday June 08, 2023 @04:07AM (#36238697)
Let's also not forget that browsers generally limit the number of requests they send at a time - IIRC the current limit is 6, so a site may be slow just because it sends many requests.

Even (or maybe especially?) popular products like Gmail are guilty of this, sending easily over 200 requests. That's 700ms(!) worth of stalled requests in the best case scenario.

Re:Programming Culture in the Late Aughts by marginalia_nu on Thursday June 08, 2023 @05:34AM (#36239275)
HTTP/2 does mitigate this a bit, I think it's mostly just a limitation in the number of threads. Even with pools or green threads, a CPU can only do so many things in parallel.

Context switching is expensive.

Re:Programming Culture in the Late Aughts by mdaverde on Thursday June 08, 2023 @10:59AM (#36242971)
Question: how do you reliably deploy? And if it's just scp-ing tarballs, how do you handle dependencies? Do you run & upgrade any third-party processes that rely on having their filesystem or deps?

Struggling with this because even in a small app in a Linode box, I don't mind just cp-ing my bins but there's always other things/versions they need. Thinking of bringing in Ansible to help me out here.

Deploying feels easier in the container, Kubernetes world

Re:Programming Culture in the Late Aughts by marginalia_nu on Thursday June 08, 2023 @11:31AM (#36243584)
If your problem is needing to synchronize a complex mesh of services when you upgrade stuff, the solution is to not have a complex mesh of services that needs managing.

I have a dist-directory, in it is a directory for with each release version, and a symlink current pointing to the current release. To deploy a new version, I create a new directory, unpack each service, and then redirect the symlink ... then "systemctl restart service-name".

Re:Programming Culture in the Late Aughts by mdaverde on Thursday June 08, 2023 @12:25PM (#36244512)
Just read your article: https://www.marginalia.nu/log/09-system-upgrade/

You got rid of a lot but where did the functionality for those tools go? I understand wanting to get rid of containers & Kubernetes, but did you rewrite/bake the functionality in to your app? or maybe not care about monitoring and logs temporarily for now?

Re:Programming Culture in the Late Aughts by marginalia_nu on Thursday June 08, 2023 @05:00PM (#36248976)
I mostly just got rid of the functionality. I do logs with grep and monitoring with vanilla prometheus.

Kubernetes and the surrounding ecosystem can create many of the problems they set out to solve.

Re:Programming Culture in the Late Aughts by pdntspa on Thursday June 08, 2023 @11:12AM (#36243198)
capistrano makes it pretty easy/repeatable, at least for me deploying RoR code onto my VPS

All it is basically doing is a git pull, symlinking in the vendor code (gem) cache, doing all the rails preflight ceremony, and updating a "current release" symlink to point at the new folder. Oh and it restarts the servers (nginx, rails).

At a previous job I had an 8-line shell-script that did almost the same thing and it worked for years.

Re:Programming Culture in the Late Aughts by Capricorn2481 on Thursday June 08, 2023 @11:50AM (#36243938)
How do you handle authentication without cookies?
Re:Programming Culture in the Late Aughts by marginalia_nu on Thursday June 08, 2023 @04:59PM (#36248946)
I don't.
Re:Programming Culture in the Late Aughts by maccard on Thursday June 08, 2023 @05:10AM (#36239130)
I disagree. There are so many simpler options available. DO app platform is point and click deploy from GitHub for $5/month.

Knowing docker these days is a huge boon - it immediately removes the "works on my machine" problem, and honestly the amount of docker knowledge required to deploy a basic even crud app is about 10 lines that can be copy and pasted from stack overflow by searching for "Dockerfile for X"

Re:Programming Culture in the Late Aughts by collyw on Thursday June 08, 2023 @12:06PM (#36244188)
It solves that problem but adds it's own. I guess its overall a positive.
Re:Programming Culture in the Late Aughts by kqr on Thursday June 08, 2023 @12:09PM (#36244246)
Just one anecdote, but I've had a script run flawlessly on its own in multiple environments, but it's docker image exhibited the "works on my machine" problem for some reason!

(Never bothered figuring out why since the script ran fine on its own and was replaced with a proper application shortly thereafter.)

Re:Programming Culture in the Late Aughts by arp242 on Friday June 09, 2023 @12:34AM (#36253200)
The problem isn't so much that it's hard to get started with Docker, it's debugging stuff when it goes wrong is so hard. There's this 80M dockerd binary that needs to run as root and last time I checked it's over a million lines of code – lots of potential for failure there, ranging from "Docker doesn't do the right thing and I can't figure out so let's just nuke the entire server and start up a new one" to "Oh dockerd magical firewall rules made my firewall ineffective".

Is that a good tradeoff? I don't know; it seems to me you can get 95% of what Docker gives you with 5% of the complexity. Luckily the ecosystem has started to realize that and better tools have started to materialize.

Re:Programming Culture in the Late Aughts by spiffytech on Friday June 09, 2023 @06:20AM (#36255736)
Which alternatives are you thinking of?
Re:Programming Culture in the Late Aughts by arp242 on Friday June 09, 2023 @07:05AM (#36256070)
I've used runc, which worked out well for me, but it's not a "drop-in replacement" for everything Docker does; it's essentially just an OCI runtime (originally extracted from Docker I believe), but 9 times out of 10 that's what I want.

There are other tools too, such as containerd (and more I don't recall the name of first-hand), but I don't have first-hand experience with them.

Re:Programming Culture in the Late Aughts by collyw on Thursday June 08, 2023 @11:56AM (#36244052)
Trying to convince people of that seems to be a loosing battle.