Immutable Infrastructure. Learn all about it here

Programming requires special knowledge and dedication. Being a good programmer also requires valuable skills; all this makes the foundation quite solid and it is the starting point for great programs and, who knows, we may even produce a killer application!

But with trial and error over decades of computer use, concepts and paradigms have been refined when it comes to writing our algorithms.
While some opt for DevOps Architecture or others for pure cascade development, among other schemes and even combinations of them, we have seen that the Continuous Integration of Software, its Continuous Distribution and Continuous Implementation has gained strength in recent years. We don’t try to say what’s right, what’s regular or what’s wrong. We try to say that we are free to choose our development model.

In Pandora FMS we have bet, from version 7.0, to “rolling release” or Continuous Software Development, which covers all of the above… except for one component: the Immutable Infrastructure.

Immutable Infrastructure as a Component

Immutable Infrastructure

Immutable Infrastructure as a Component

We always have to keep the theory in mind. We are not quantum physicists who spend our time in mathematics, but in hard reality we must always have some theory. A reckless assertion, very personal, is that life is 90% practice and 10% theory.

Part of that hard reality is that we need to decrease the risk in each version in our software, to be at the same speed of the market with a very high quality and low costs … all this to keep our customers happy:

  • We must be clear that a task ends when it becomes fully operational (i.e. reaches the users).
  • We must have, in an expeditious way, one or several ways that each one of the tasks reaches the users.
  • We must be ready to make changes paid for by users and/or by our colleagues.
  • Processes must be automated
  • Every task or change must be implemented and that is the top priority.

Building binaries only once

Each task (improvement and/or patching) is a change and a change means a new compilation of the source code. This is now called a “binary file” or simply “binary”, perhaps to make the work of reheating processors and storage devices less painful – and even aseptic. That compilation will contain the same previous executable and only and exclusively the change -task- at that moment. There shouldn’t be anything else, but what if the destination environment changes?

When this doubt is raised we will have not just one change, but two or more changes, and this increases the possibility of some unforeseen failure. Let us remember: “fast, good and cheap”, as colloquial speech denotes, and all that collapses if we drag more tasks -changes- than we set out to do.

Immutable Infrastructure Comes on Stage

An Immutable Infrastructure, whether in concept or in practice, guarantees us programmers that our effort is aimed at a niche that we know well, but not only that: it is an environment that we ourselves design and that can be replicated as many times as we need.

In this way, all the machines or devices we work with will be standardized, they do not change, they are always the same, but in addition to this obvious advantage we will also have the ability to expand the number of devices on our platform in an automated way. We can also replace failed machines with new machines (real or virtual).

If we think about it -or rather remember- Immutable Infrastructures are nothing new: at the beginning of computing there were one or two models of computers and they didn’t change for years. Do you want a more stable environment than that? The number of devices that could be available was obvious, and that was solved with virtualization … in 1967!

Characteristics of an Immutable Infrastructure

  • It must be predictable: it will be a faithful reflection of the environment where we program our application, without any failure.
  • It must be scalable: and if it can be extended automatically at any time, even better.
  • It must be resilient: automatic recovery will ensure that our team can focus on building a better product and sleeping through the night rather than constantly maintaining the infrastructure.

Adaptation of an Immutable Infrastructure

Despite the word we use, the infrastructure needs to be changed for reasons beyond our control. The discovery of a vulnerability in the security of the central processors of the computers forces us to update our operating system(s): then we will “patch” and proceed – if possible all this in an automated way – to recompile our program, and apply the necessary tests to ensure its proper functioning. If all goes well, we will proceed to update all our Immutable Infrastructure (which we already see why the term is not strict).

Immutable Infrastructure

A humorous figure illustrating how complex an Immutable Infrastructure can be

The simplest Infrastructure Immutable

The best example of the construction, use and maintenance of an Immutable Infrastructure is that of a virtual computer and the image file that contains it. Our favorite hypervisor is VirtualBox, which can work with files in ISO format, a very popular standard nowadays.

Thus, we will make a virtual machine with the desired operating system and each and every one of its components. Each step can be marked with snapshots that will allow you to go back in time and even branch the desired ISO image. For example, if we need a database and a web server but also need other database servers to work in clusters with the main one, we will branch once we have installed the necessary database: Percona, MySQL, PostgreSQL, and so on. Then, to one of the images we will install a web server like Apache, for example, and thus we will have two images exported in ISO format.

These resulting images can be published, if necessary, for our customers to have a quick and functional demonstration. Here at Pandora FMS, we offer downloads in multiple formats. We kindly invite you to try them, visit this link.

Tools to make work easier

In ancient Greece the Phoenix bird was mythical and every five hundred years it died burnt by fire to be reborn from its ashes. Our servers get hot, but not that hot. But they must be “reborn from the ashes”: configurations that are jealously guarded and even include version control.

Immutable Infrastructure

Statue of the Union and the Phoenix Bird in Santa Cruz de Tenerife, Spain

Although in the previous point we offered you a simple case, actually to work with large development groups we will need to automate as much as possible everything related to the environment, and give the members of the development team the necessary rights, as well as a control over who did what and when.

Although all this still represents a strong job for a good systems administrator, there are tools that we have analysed throughout our blog, a kind of knowledge dispensary that will help us a lot:

  • Git: to control not only the software versions, but also the configuration files that will recreate our Immutable Infrastructure.
  • Ansible, Puppet, EngineCF, Chef, etcd: from installing an operating system to installing applications, user preferences, installing “patches” and much more. From the templates and scripts, files to the end, we will be able to control versions with Git.
  • Jenkis: for automated testing of our software.
  • Heroku: an excellent case that illustrates the above; we create an account in Github, we host our code, we go to Heroku to create an account connected to our account Github and will take care of deploying everything for us.
  • There are even tools to generate in animated graphics the evolution of any project that has had version control!
  • Of course, and not less important, although an Immutable Infrastructure can be destroyed, copied or created, we will need a very specialized tool for its monitoring, like Pandora FMS, and we will analyse it in the next section.

The market for monitoring tools

In Pandora FMS we are always very attentive to the evolution of technologies, and the Immutable Infrastructure is no exception. Placing the Pandora FMS Software Agents or by means of remote monitoring we will be able to centralize -previously studied nomenclature of names of virtual and real machines- and save for posterity all the relevant information that we have decided to monitor. Remember that Immutable Infrastructures can be destroyed at any time, but we must always keep in mind what happened or went wrong. Pandora FMS, without a doubt, is the solution.

Do you want to try Pandora FMS? Contact us at this link and we will help you.