8 ms·
I remember trying out docker sometime back in late 2013. Something about it never fully stuck with me. I always felt like the final boundary for a piece softwar
by bob1029 6y ago
I remember trying out docker sometime back in late 2013. Something about it never fully stuck with me. I always felt like the final boundary for a piece software should be the process, not the computer. Plopping an entire VM into a zipfile and saying "here's your software" felt like lazy engineering to many of us at the time (and still today).
For our current stack, the answer has been to make the entire business application run as a single process. We also use a single (mono) repository because it is a natural fit with the grain of the software.
As far as I am aware, there is no reason a single process cannot exploit the full resources of any computer. Modern x86 servers are ridiculously fast, as long as you can get at them directly. AspNetCore + SQLite (properly tuned) running on a 64 core Epyc serving web clients using Kestrel will probably be sufficient for 99.9% of business applications today. You can handle millions of simultaneous clients without blinking. Who even has that many total customers right now?
Horizonal scalability is simply a band-aid for poor engineering in most (not all) applications. The poor engineering, in my experience, is typically caused by underestimating how fast a single x86 thread is and exploring the concurrent & distributed computing rabbit hole from there. It is a rabbit hole that should go unexplored, if ever possible.
Here's a quick trick if none of the above sticks: If one of your consultants or developers tells you they can make your application faster by adding a bunch of additional computers, you are almost certainly getting taken for a ride.
- pantelisk 6y agoI agree with you. However, after spending years and years trying to compile software that came with cryptic install instructions. Or have the author insist that since it works on their machine I 'm just doing something stupid. Docker was largely able to fix that. It's a somewhat odd solution for a too common problem, but any solution is still better than dealing with such an annoying problem. (source: made docker the de facto cross-teams communication standard in my company. "I 'll just give you a docker container, no need to fight trying to get the correct version of nvidia-smi to work on your machine" type of thing) It probably depends on the space and types of software you 're working on. If it's frontend applications for example then its overkill. But if somebody wants you to let's say install multiple elasticsearch versions + some global binaries for some reason + a bunch of different gpu drivers on your machine (you get the idea), then docker is a big net positive. Both for getting something to compile without drama and for not polluting your host OS (or VM) with conflicting software packages.
- cactus2093 6y agoCompletely agree. The whole compile chain for most software and reliance on linked libraries, implicit dependencies like locale settings changing behavior, basically decades of weird accidents and hacks to get around memory and disk size limits, can be a nightmare to deal with. If using slow dynamic languages, or modern frontend bunglers, all the implicit c extension compilations and dependencies can still be a pain. The list goes on and on, it’s bizarre to me to think of this as the true, good way of doing software and think of docker as lazy. Docker certainly has its own problems too, but does a decent job at encapsulating the decades of craziness we’ve come to heavily rely on. And it lets you test these things alongside your own software when updating versions and be sure you run the same thing in production. If docker isn’t your preferred solution to these problems that’s fine, but I don’t get why it’s so popular on HN to pretend that docker is literally useless and nobody in their right mind would ever use it except to pad their resume with buzzwords.
- koheripbal 6y agoAren't we conflating compile complexities with runtime complexities here? There are plenty of open-source applications that offer pre-compiled binaries.
- cactus2093 6y agoThat difference isn't as black and white as you're making it out to be, sometimes it's just a design decision whether certain work is done at compile time or runtime. And both kinds of issues, runtime or compile-time, can be caused by the kinds of problems I'm talking about like unspecified dependencies.
- koheripbal 6y agoThis is why I wish github actually allowed automated compilation. That way we could all see exactly how binaries are compiled and don't need to setup a build environment for each open source project we want to build ourselves.
- dmingod666 6y agoAfter that single node crashes, the app you're running on that one server will run a little more slowly.. How big should the one server that serves the whole of netflix be..?
- ant6n 6y ago"You can handle millions of simultaneous clients without blinking. Who even has that many total customers right now?" Apparently netflix has that many customers. Then again, if you split Netflix into regions and separate all the account logic from the streaming, the recommendations engine and the movie-content, you could perhaps run the account logic for one region in one server.
- dmingod666 6y agoBesides just giving you a warm fuzzy feeling of running only one server. What is the point of running one server? Do you also object to them running in the cloud in VMs and not on physical hardware that they own? Sounds like an old man's "kids these days" rant..
- betaby 6y agoNetflix in fact 'run on servers' https://papers.freebsd.org/2019/fosdem/looney-netflix_and_freebsd/ https://papers.freebsd.org/2019/fosdem/looney-netflix_and_fr...
- dmingod666 6y agoOfcourse, everything runs on servers. Question is, who owns and maintains the hardware. The link you shared just says they manage their OS layer, ofcourse they do. Everyone running on AWS VMs is responsible for their own OS layer. Wether they want precise control over their OS doesn't change their preference for who owns and manages the hardware..
- betaby 6y ago
- yonixw 6y ago> Horizonal scalability is simply a band-aid for poor engineering in most (not all) applications. Maybe if your app handles < 10k concurrent connections. Otherwise it is the most cost efficient solution and exists because it solves the scaling problem in the best way as of today.
- pjmlp 6y agoVMs also autoscale.
- rbanffy 6y agoWhen you approach the limits of what your kernel can handle, then it may be time to split your workload across boxes or to carve smaller boxes out of your metal (and probably directly attaching NICs to the VMs to the host OS doesn't have to deal with them). Making your workload horizontally scalable is always a sound engineering choice. But... Splitting a horizontally scalable workload across a dozen virtual servers that are barely larger than the smallest laptop you can get from Best Buy, you are just creating self-inflicted pain. Chances are the smallest box you can get from Dell can comfortably host your whole application. The fact remains the odds of you needing to support more than 10K simultaneous connections are vanishingly small.
- yonixw 6y ago> When you approach the limits of what your kernel can handle Even before. If you want low latency. And banks handle more than 10K concurrent every day. Cost example: https://pt.slideshare.net/markmyers106/vertical-vs-horizontall/5 https://pt.slideshare.net/markmyers106/vertical-vs-horizonta...
- ThinkBeat 6y agoYes some banks need it As do giants like Google Facebook etc Chances are very high that the problem domain you are working in does not. Like the author said “1%” I think maybe 5% to 7% The point being that masses of software is developer everyday on a cargo cult adoption of solution they do not require.
- AndyMcConachie 6y agoContainers solve the dependency problem by simply pretending it doesn't exist. I used to do UNIX integration work in the late 1990's early 2000's and containers weren't really a thing. So you had to make sure libs from one program didn't crap on another program. And developers had to be conscious of what dependencies they included in their code. Nowadays they don't have to care as much because of containers. Every program can have its own dependencies. Thereby solving the integration problem. A better solution would be to actually integrate programs and their dependencies into working systems, but no one has time for that. Software bloat is fine. Computers are cheap and fast. And actually understanding what we're doing would be too expensive. So just wrap all your have finished crapware up in a giant black box and dump it on a server.
- rileymat2 6y agoWhy is this a better solution? Separating the dependencies between programs allows you to test and release independently to allow incremental upgrades. IMO that is better.
- piaste 6y agoI'm very interested in understanding what I'm doing and what I'm bundling into my software. What I'm not interested in, is this kind of walking uphill in the snow both ways: > So you had to make sure libs from one program didn't crap on another program. And developers had to be conscious of what dependencies they included in their code. ie. having to understand what everybody else is doing in order for my software to run properly. No thanks. That's not why I'm here. I'll put the exact dependencies I want, in the versions which work best for my software, into a Docker image or whatever tool offers a similar level of isolation, and I'll be working on my code while everybody else spends their time fighting over the ABI compatibility of C system libraries.
- fendy3002 6y agoI suppose your apps ran on windows. It isn't a problem (or at least it's a smaller problem) with windows ecosystem, especially enterprise one, since usually you're using same version and installation steps handled by infra with AD. Even without AD usually the installer and windows version is same, and Microsoft usually great at backwards compatibility. But it's not the case in linux, or at least non-enterprise / ldap linux. Installing mysql/redis/elastic/dotnet core/etc on each machine may be different, and has different installer available. With docker I just need to instruct them to install docker, setup docker compose and everything is handled via containerization.
- lordlimecat 6y agoForgive my ignorance, but can't that be solved by statically linking things? Don't you just end up with a less hackjob version of a container when you do that?
- pjmlp 6y agoBack when I was doing big boys UNIX, the respective package managers took care of everything. Which we later replicated in Red-Hat with RPM. Bare bones OS install + bunch of OS packages => done. And in what concerns containers I was working with HP-UX Vault in 1999.
- vitus 6y agoAgreed to an extent. Even outside RHEL, you have yum for RPM-based distros, Aptitude for deb-based distros, pacman for Arch, etc. You need to start with the same base operating system, and you need to make sure that you pull in the same versions of packages in case there are backwards-incompatible bugs, or version bumps such that the dynamically-loaded library is no longer detected (hence the common albeit dangerous workaround of "add a symlink"). (If you're using rpm directly, then you need to bundle the actual packages that you're installing, or point to specific packages that you're confident won't change. And at that point, what's the difference between your approach and Docker?) The challenge that I believe Docker solves (or, at least, attempts to) is environment reproducibility: without it, you have dependency hell.
- 6y ago
- rbanffy 6y ago> Horizonal scalability is simply a band-aid for poor engineering And don't even get me started on having instances labeled "large" that have less memory and CPU capacity than my personal backup laptop (currently on loan to my 8yo for COVID reasons)...
- deleted 6y ago[deleted]
- Spivak 6y agoBut that doesn’t make any sense. We’re not talking about physical hardware we’re talking about tiny tiny slices of it. When VMs are the logical isolation boundary in your infra they get really small — 512 MB is a lot of memory for a single purpose server.
- rbanffy 6y ago> 512 MB is a lot of memory for a single purpose server. Maybe. But when the time comes 512 MB doesn't seem like much anymore, what do you do? Do you pick the next larger instance or do you split the load across more 512 MB slices of a computer?
- speedgoose 6y agoDon't forget the ridiculously low and restricted IOs unless you pay a lot. But you can use other cloud providers with better value.
- MaxBarraclough 6y ago> Plopping an entire VM into a zipfile and saying "here's your software" felt like lazy engineering to many of us at the time (and still today). At the risk of nitpicking, docker images aren't the equivalent of VM images, as they don't include a kernel.
- JeremyNT 6y agoThis isn't nitpicking at all, it's an important distinction! Docker is not virtualization, it's just an abstraction that makes some Linux process isolation features easier to manage. It also allows you to bundle whatever dependencies you have in the same bundle, but that is not the same as having a VM.
- cyphar 6y agoLinux containers and equivalent technologies are virtualisation (specifically OS virtualisation[1]), just not a VM. Hardware virtualisation (VMs) isn't the only kind of virtualisation that exists. [1]: https://en.wikipedia.org/wiki/Operating_system-level_virtualization https://en.wikipedia.org/wiki/Operating_system-level_virtual...
- cameronh90 6y agoBy that logic, processes are arguably virtualisation too. They do after all use virtual memory. Threads, processes and containers exist on a continuum.
- __jem 6y agoThe key is that "containers" don't actually exist -- they're just processes running under a variety of different namespaces.
- MaxBarraclough 6y agoIt's true that Docker isn't a first-class abstraction at the level of the Linux kernel, but BSD has jails, and Solaris has Zones. This is important in some respects, but I don't see that it informs things here. Containers are still 'a thing' regardless of how they're implemented.
- fennecfoxen 6y agoI get where you're coming from, but it turns out that plopping the entire VM into a zipfile ends up being a good way to have the kind of reproducibility that makes your operations sane. Do you pin specific versions of dependencies for your install scripts? Might as well pin the whole image. It's like 88% of the benefit of reproducible builds, at 3% of the cost, and that's not nothing. Mind you, that's still Docker, though, not Kubernetes. > If one of your consultants or developers tells you they can make your application faster by adding a bunch of additional computers, you are almost certainly getting taken for a ride. Eh. There's a redundancy play in there somewhere too, if you know how to pull it off. (Big if.)
- m463 6y agoPersonally I think there is beauty to one text file that defines a reproducible build environment. Carefully controlled dependencies are quite nice. That said, I haven't really used docker as a runtime container.
- iandanforth 6y agowrt horizontal scaling. Do recall that the motivation for this strategy by Google was cheap-as-possible servers that failed constantly. Back when they built racks using legos the problem was hardware reliability. They had to 'scale' horizontally for reliability (given cost constraints) as much as load. People have since bought into the marketing reasons for 'being in the cloud' and having 'infinite scalability' but that largely misses the point (and the pain) that caused many of these technologies and patterns to be developed in the first place. The best example of how to scale without buying into this pattern I know of is Stack Overflow. At least circa 2016 - https://nickcraver.com/blog/2016/02/17/stack-overflow-the-architecture-2016-edition/ https://nickcraver.com/blog/2016/02/17/stack-overflow-the-ar...
- michaelcampbell 6y ago> Something about it never fully stuck with me. ... Plopping an entire VM... There's your first miss.
- jayd16 6y agoEven if you run one container, containers let you use off the shelf apps instead of only off the shelf libs. I'm not interested in being "not lazy." I only care about user value and ability to provide user value (tech debt/cost/velocity). For the price of an M5A.16xlarge to get those cores, I can get like 27 m4.larges and have way more fault tolerance. I think your disdain is misplaced.
- joshuamorton 6y agoHorizontal scaling brings down total compute use if you have many distinct uses. Imagine of your only unit of compute is a single bulky machine. You don't fully saturate it, but you need a second machine to avoid downtime anyway. Now you spin up a second or third service and suddenly you need 5 or ten machines and your compute utilization is 20%. You can pack things in tighter. But then you have a knapsack problem, and that's easier to solve efficiently with many small blocks even if it costs you a 1% overhead or whatever.
- toddh 6y agoProcesses were the original containers.
- AtlasBarfed 6y agoPerformance is not the only reason to scale. Redundancy / failure tolerance. Cassandra is a big PITA, but it hasn't gone down (knock on wood) in the 6 years I've been using it. PARTS of it have... How many distinct services do you have in your monorepo? A monorepo is fine... until it isn't.
- 908B64B197 6y ago> Plopping an entire VM into a zipfile and saying "here's your software" felt like lazy engineering to many of us at the time (and still today). I've seen this (a long time ago) in the education world market. Very small school with a STEM program. They had specific scientific software they wanted undergrads to use (and some of it was pretty proprietary and used to interface with lab equipment) + a pre-configured IDE. Instead of going through the compatibility matrix of OS and their versions they just gave all students a VM image that would "just work". Everyone could bring in their own devices and as long as you could run an hypervisor everything would "just work".
- nhumrich 6y agoHorizontal scaling is not a _performance_ tactic, but rather about availability and cost. Having higher availability means trading off consistency, or in other words, using distributed systems. Also, you can not elastically scale vertically, without also scaling horizontally. In other words, horizontal systems are cheaper if you have fluctuations in traffic.