4 ms·
There are a bunch of things that don't really make sense in modern software. For example, we now commonly package things up as docker containers with immutable/
by jillesvangurp 7y ago
There are a bunch of things that don't really make sense in modern software. For example, we now commonly package things up as docker containers with immutable/ephemeral file systems. For better or for worse, that's how a lot of server-side stuff gets deployed.
The whole point of that is simply emulating what the program is expecting to such an extent that it can run as if it was running on a normal file system. Often that means working around many broken assumptions. For example it might expect some configuration in a particular place in the filesystem. However, since the filesystem is immutable, you can't really modify that after you build the docker container. So you work around it by e.g. using dockerize to template the config file and then inject the actual configuration from the environment variables on the docker command line. Likewise, applications produce logs but writing those to an ephemeral file system is kind of pointless; so you instead write to stderr/stdout and leave it to the host OS, Docker, Kubernetes, or whatever is running your container.
These workarounds are something to avoid if you are writing new software. When you ship as a Docker container, you don't care about the host OS. It might be Linux, BSD, Mac, Windows, or whatever else is capable of running docker containers these days. Chances are that the host OS itself is also running in some VM if you are shipping to a cloud environment. The nice thing with Docker is that you (mostly) don't have to care about any of that.
With WASM this is extending to other places. People are running edge computing functions in WASM form, running WASM programs in a browser, or even in operating system kernels. Most of those places don't necessarily even have filesystems, environment variables, or log files that you can access (or should access).
IMHO modern development requires a bit of upfront thinking on how to configure things, where to send logs, and where to store data. Rarely is the answer for any of those things a file on an (ephemeral) disk. Logs need to be aggregated so they can be analyzed. Local storage is not always available/reliable. Configuration gets injected rather than loaded from a file. Files/state gets written to some specialized service (a networked file bucket, some DB, a queue, REST service, etc.). Most of those things are accessed via networking rather than a file system.
This is also true of most frontend development these days. A browser application does not have a filesystem; it has no access to environment variables; and while it has a console, it's considered bad form to actually log to it in production apps. Instead browser apps write to remote services (including logging and analytics data) and get their configuration from things like cookies, in browser databases, and remotely stored user preferences.
Come to think of it, most modern development is kind of detached from the operating system these days.