02 April 2012

The Challenge of our Connected World

Soon enough, everything will be connected. Microelectronics progresses so fast that engineers can add sensors, actuators, microcontrollers, and transceivers in each and every object worth more than a few tens of bucks. Smartphones are the most obvious example of this trend, but there are many others: nowadays, cars have sensors for pretty much everything you would think of, and their control is more and more transferred from the human driver to the on-board electronics. Tomorrow, cars will share information about the traffic, the road condition, their destination, and adapt their behavior and itinerary accordingly.

Similarly, domestic appliances will become smarter: based on weather forecasts and your living habits, your heating system will adapt and optimize its functioning to minimize its energy consumption. Your window blinds will open and close automatically according to the internal and external temperature and sun exposure. Your fridge will keep track of its content and orders missing ingredients online. Your solar panels will sell energy to your neighbors because you are on vacation and your heating system went on standby.

This is the future: objects that used to be blind and stupid become sensing and smart. And systems that used to be monolithic become distributed. But that's a good thing, right? Well, the problem with distributed systems is complexity. Not only distributed systems are usually more complicated than monolithic systems, but they also become complex (which, from an engineering standpoint, is worse).

The exciting (and, at the same time, worrisome) feature of complex systems is called emergence, that is, the fact that interconnected parts exhibit properties as a whole that are not obvious from the properties of the individual parts. In other words, take a bunch of objects that you understand well, allow them to communicate, and their collective behavior might exhibit completely unexpected features. This is a very exciting promise, because it basically means that one can transcend some of the technological limitations of our current systems by interconnecting them (that's basically what cloud computing and social networks are about). However, it also means that we do not know what is the behavior of these distributed systems a priori. Ask music majors about the behavior of interconnected computers, they didn't see coming some of its behaviors, for sure.

Now, one must be very cautious when talking about complexity, and the distinction between complicated and complex systems. Let's give an (almost canonical) example of a complicated system: the computer. It is made of millions of electronic components interconnected in a very specific way. Yet, a computer is not complex, because it has a very predictable behavior (which is, actually, the essential feature of a computer).

Complex systems are, instead, utterly difficult to predict (sometimes to the extent that it is practically impossible to predict their behavior). A very good example of complex system is the weather. You've probably heard about the butterfly effect (or why the flap of a butterfly’s wings in Brazil can set off a tornado in Texas), which is a poetic way of describing an extreme sensitivity to initial conditions. Basically, if you do not know the exact state of your system at time t = 0, you cannot predict its state at time t = 1. Well, distributed systems often behave in this way; for instance, a system as simple as three objects interacting through gravity is already complex (and even chaotic, for that matter).

The world is already very complex (read: difficult to understand and predict), and it is going to become worse as it is getting more and more distributed. Is it a reason for giving up on trying to understand and predict it? Well, I would advocate more awareness of the concept of complexity when dealing with distributed systems (that are becoming ubiquitous); otherwise, they might lead to quite a few surprises (not all of them very pleasant, I fear).

No comments: