by smokel · 3y ago · 0 comments
It seems so much is lost, for no apparent reason. We used to have clean interfaces, architecture independence, pretty good performance, low startup times, low memory usage, and heaps of experience with the JVM or .NET for years.
We now seem to have regressed to modularising software into separate unix processes with less strict interfaces, extremely complex dependency chains, and many more moving parts.
Obviously, this is all fine if you are actually building systems at enormous scale, but I see this move to containers in all fields, even for applications that run on a single CPU where performance or scalability is not an issue.
What would be the reason for this? Is it simply that younger generations need to relearn from their own mistakes? Or is this part of the micro service hype?
(Of course I'm not ignorant to some positive aspects of containers, especially for interfacing with databases or web servers, and other unix services.) My problem is mostly with using containers to split even the most straightforward applications, where existing techniques were (at least IMHO) vastly superior.)
Yes, you can make all of this work without containers. They make all this very easy and reliable though.
So your container has the right Java Runtime Environment and your app inside. I don't even need to know it's Java!
Thing is, I see a lot of people go way beyond this, and split applications in many separate services, because they think the abstractions are free.
The idea is to reduce the surface area.
Nowadays we work with way more traffic that incentivizes strict bin packing of traffic within the tightest bounds of the resource pool, with the fastest actuation time. VMs won't give you that. Containerization just makes that so much easier and snappier for large amounts of traffic. But then we had to go global, and orchestrating containers across continents is a PITA. So there's value in k8s for dealing with that. These tools vastly reduce the complexity with regards to managing globally distributed services. But as usual, we start customizing these tools, leading to more complexity.
With that said, I believe startups need to focus on the fastest development and deployment times. So stuff like Docker, Kubernetes or Terraform are entirely unnecessary. As I commented elsewhere before, no one with a total QPS of 10 needs anything beyond GCE or EC2 or on-prem servers. People born in the Cloud age seem to have forgotten that they can just run the cheapest Linux machine with HAProxy and httpd behind a static IP. The focus on always going straight to Cloud complexity, if anything, smells more like engineers in on some VC grift.
Side note: It's hard to hire senior/motivated Java developers. It became a self-fulfilling cycle. Happened somewhere around 2011-2014, no one other than fresh grads graduating from legacy courses still used Java or .NET.
Specifically, the simplicity of managing things once you go through the initial pain of setting it up (much reduced with GKE), cost savings from bin packing your apps (not just your product but also anything else you need for your company that you can't afford SaaS for [1]). You can share servers for dev/test/prod till you get enough clients to migrate up. And as much as I love HAproxy, configuring it is way more annoying than dealing with some basic ingress controller + certmanager (+ optional external-dns, not needed if you just set a wildcard).
Right now I have a super cheap (compared to cloud) hetzner server which provides (using k3s) services to multiple clients, ranging from just VPN (using headscale) to handling git etc. All with SSO, low maintenance, etc.
[1] costs of SaaS service per employee hit differently when you're not VC backed and you're not based in the United States.In my experience it's often cheaper to get another full time engineer to handle some self hosting than pay for various cloud/SaaS/PaaS.
I also didn't like to resolve issues with different versions of log4j, and OSGi didn't make things a lot easier either. Then there's classpath misery, gradle, and IDE incompatibilities.
But I'd still rather live in a world where we'd try to fix things, instead of moving to completely new ideas. Probably easier to change my yearnings than the world of software development.
No need to worry about some some other app using port 8080, dont need to ensure your scripts do a ps and filter out other users stuff, all those kinds of things.
Then theres libraries and vulnerability management which is easier to manage where the blast radius is just a single container.
Your broader point still stands, but I just wanted to say that finding processes to signal (presumably to kill or restart?) via `ps` is insane. Linux has really good process management tools available, whether service management via the init system (systemd, OpenRC, GNU Shepherd, etc.) or some other process management tool (supervisord, daemon tools, runit, etc.). Even beyond that, there's good ol' nohup and pidfiles. All of those things are well established and easy to do. Filtering ps output and using it to decide what to do is indeed painful, but it's painful because it's the wrong approach for Unix, not because Unix multitenancy is more painful than containers.
Containers are nice but it sounds like maybe you have some trauma from bad ops mixed into your assessment!
Why do businesses spend insane amounts of money and go through painfully slow and laborious sales and purchase processes to buy software that is utter garbage?
Is it most likely to happen when their needs are highly specialized, so there's just not much competition?
I know that enterprise software often has terrible or dated UX, and I understand the reasons for that. But beyond the UI, why is software that costs $5 million more likely to be shoddy and carelessly made than software that costs $50?
The only problem is that it all didn't work.
First, we've go the "worked on my machine" type of problem: Conflicting dependencies? Different version of the JVM? Native libraries?
Then you had the issues with the application servers themselves. All the configuration was usually done in some tedious GUI environment. Lost your server? Good luck. Want to automate something? Good luck. Want to use CLI? You're not a proper enterprise developer, who hired this crazy Linux hacker, fire him before he'll try to Open Source something. To be serious again, it was just downright uncomposable.
Lastly we had all the devops issues: How do you automate a deployment of a new version?
For classic PHP or cgi-bin apps you'd just upload everything to an FTP server (well, it's not as perfect as classic PHP fanboys make it, you do have to handle deleted files - rsync would still be safer).
For containerized apps, you just create a manifest file (or a Helm chart or whatever suits your fancy) and hit deploy. Kubernetes will take care of everything, including upgrading the container image if necessary.
It's the stuff in the middle that gives me nightmare. It's not enough to just dump a new JAR file on a server. You've got to stop the server and restart it using the new version. At the very least you'll need to have provisions for backup and quick rollback, and probably also a blue-green environment to avoid lost connections. In more critical services you'll want to have canary releases and a pipeline that carries your server through multiple environment.
This is why containers are unavoidable for most kinds of networked service. It's the deployment story. That's why you see people wrapping single-binary go apps in containers, even these binaries are completely static and often don't even depend on libc.
Are containers an overkill sometimes? Yes. They are far from ideal for CLI apps. That's where you want fast startup times, quick download, better package management and better integration with your host environment. But most CLI apps that I've seen using docker went that route because their installation process was too troublesome to bother with. You'd see that a lot with Python apps, which are quite hard to package. But even Java apps could be a hit or miss if you don't have the right JVM.
> jars in the JVM
See "JAR hell"
Also, Node.js, CPython, Ruby, .NET, etc etc versioning.
Again, if your systems are complex enough and span multiple programming languages, then containers may be great. Thing is, I see teams of n Java developers splitting their application in n+1 services, each with their own container, and thinking they're on the right track.