Should applications manage themself?

Should applications manage updates themself or does an OS package manager or some other mechanism better do that? At one end of the spectrum, we might have NixOS, where everything is tightly constrained by a central definition file of the system, and at the other end, we have WordPress, which can update itself and its plugins. There are tradeoffs with either method and probably a lot of “it depends.” The biggest factor is probably the coupling between software components. The linking of C/C++ applications to libraries is an example of strong coupling and is sometimes necessary for performance. Using a message bus and standard data types to communicate between components (example Simple IoT) is an example of weak coupling.

There are several challenges with the “distro” or “app store” model of application management:

  1. you have to package your app for every OS distribution
  2. application updates require you to update this meta-data for every OS distribution/App Store

There are several trends moving away from the centralized management of applications:

  • Languages like Go encourage static linking with no dependencies.
  • Use of the browser platform to run applications is becoming more common. This platform is universal.
  • Progress Web Apps (PWA) are becoming more common and can be easily distributed through a website with no other package management required.
  • Docker is commonly used to deliver a bundle that has everything needed for an application.
  • Embedded assets (frontend files, etc.) in a binary are becoming more common. Both Go and Qt offer good support for this, and I’m sure other languages do as well. This allows you to distribute and update a single binary for an application instead of a number of files that must be installed and managed.

It is becoming more common for an application to update itself. Having run WordPress for many years where it just flawlessly updates itself, I’m starting to really like that model. Perhaps the biggest challenge that still remains is the initial installation. For Wordpress, this is definitely the case – it is a pain to set up.

All this is the background for deciding what direction we should go with Simple IoT. We have already added support to self-install (sets up a systemd service file and starts/enables it). I currently use Ansible to deploy SIOT to my small fleet of servers and devices, and that works pretty well. However it is still friction and work to keep everything updated, and most people who run SIOT will probably not want to set up and run Ansible. I think self-update will be next and there are some very interesting packages available to help do this. Maybe SIOT should even install Caddy, InfluxDB, and Grafana? Oh No! – now SIOT is becoming a package manager ???****!!!