Monolith to Microservices in the Physical World

By December 19, 2019July 21st, 2020Postcards from the Edge

 

By Antonio “Pelle” Pellegrino — Founder & CEO, Mutable

Mutable helps software developers create scalable and fast web services by automating DevOps and providing edge technology all around the world.

IoT devices will transform everything we do and how we do them. With the lower latency and computing power provided by edge computing, data processing happens in much closer physical proximity to IoT devices. These advances transform industries  industries across the board, freeing humans to pursue creative roles, and letting the machines take care of the straightforward repeatable tasks.

Over the past 10 years —and particularly in the last three—we have observed a shift from monolithic application development to microservices, which fundamentally changes how apps are built and deployed. A similar shift is about to upend the devices in our physical world. By treating devices not as single-function monoliths, but, instead, as a collection of smaller services, we can create a reality where devices will operate with more autonomy while also integrating and sharing data with other devices.

As the name suggests, a monolithic application is like a standalone black box. Loosely defined, this can mean that all the inputs, outputs, and everything in-between reside in a single code base. Typically, the results that come out are predictable and narrowly focused. A good example would be a common home appliance like a doorbell. While robust and reliable, monoliths are difficult to modify and costly to iterate due to the intertwined nature of the wiring of internal components.

Microservices, on the other hand, provide the independence needed for rapid iteration, language-agnostic development, and functional programming paradigms. For example, the same data can be processed by different services yielding different results. This way of developing calls for API-oriented architecture where services talk to each other.

The result is the freedom to rearrange services and their functionalities, while decreasing the time it takes to deploy products and solutions. Think of a microservice as a small sensor or an IoT device. These services can be scaled, replaced, and rebuilt independent of each other. However, these advantages come at the price of increased network communication, since everything depends on network calls to one another for additional functionality.

The Digitization of Hardware

Manufacturers have been rapidly digitizing physical hardware. This transformation has unfolded on a device-by-device, company-by-company basis, and is in need of abstractions and simplifications. Fortunately, todays common yet complex everyday appliances can have their functions broken down into three core components: inputs, outputs, and processes.

By separating device functions into inputs, outputs, and processes, we can create an infinite combination of solutions using the same physical devices. Going back to our doorbell  example, a doorbell can leverage a camera and become an extension to your security system, a remote intercom, or automatic door entry with facial recognition.

Today, these are built as a monolith, as it is a single-purpose black box. The input and the outputs are the same every time. However, if we redefine the doorbell as a collection of microservices, then it’s easier to break it out of its historically closed-loop systems. Yes, the input stays the same (it is a cheap camera) — what changes is the access to the input, how and where it is processed, and the derived outputs.

This new doorbell can now be programmed to let you know when your kids are home. Or, it could become part of a larger network of devices that function as a neighborhood watch, capable identifying and catching the local package thief.

Part of a Larger Trend

The shift from on-premises infrastructure to the cloud, combined with the evolution of virtual machines (VMs) to containers, has catalyzed the shift from monoliths to microservices. In turn, open-source tools and cloud services have continuously evolved to meet developer demand for microservices-oriented architectures.

This proliferation of tools has benefited from the patronage of industry leaders such as Netflix, Google, and Amazon, and their eagerness to publicly share their expertise. This has eased, if not removed, the aforementioned difficulties pertaining to the use and development of microservices.

Organizations using microservices have reaped the benefits over time from decreased costs, increased velocity, and overwhelming versatility they generate. Anecdotal examples of these competitive advantages include Amazon developers deploying code every 11 seconds, and the 13 services which are used for a single Google search.

Presently, monolithic architectures dominate the physical realm. Once we leave the confines of software, the tangible devices around us are mainly built as stand-alone items.

Microservices on the Edge

To further illustrate this point, we need only look to the Tesla Model S, which is equipped with eight cameras. These cameras and sensors are essential components for its autonomous operation and advanced safety features, but what else can they be used for? What if the data feed from the car could be accessed by other services – ones operated by Tesla, but also ones operated by other companies and entities? Think of Google Maps being constantly enriched by fresh data pushes, or letting other autonomous vehicles share the data to make predictions easier, cheaper, and safer.

The Model S right now is a monolith on the cusp of  joining the shift towards microservices on the edge.

Among the many challenges that must be overcome to enable this transformation, three stand out: security, latency, and bandwidth.

Security: Whenever you are dealing with mass data collection, as in this case the cameras on the Model S, security, and use of the data, becomes a concern. The ecosystem in which these services function will need to be secure and meet local, state, federal, and international data privacy laws. We will need to make use of the data immediately, the data is most valuable as soon as it is captured. Think of the other cars or autonomous operations happening in the vicinity: they will need to know about each other in real-time and quickly react to a changing environment.
Latency: By placing edge computing infrastructure, as in the form of micro data centers, in close proximity to the devices, data processing can happen outside the device while still providing rapid analysis and response.
Bandwidth: Many IoT devices will produce large streams of data. In the example of the Model S, there are at least eight video streams per vehicle that could be pushed out for external processing. If all of this data must traverse the entirety of the Internet to land in a centralized data center, it will place a huge strain on our Internet infrastructure, and will be wasteful when only local devices need the data in real time.
One downside of microservices is communication. Luckily, networks have caught up with one gigabit connections and 5G cellular technology will soon be widely deployed. What was once a bottleneck is now an enabler that warrants the need for edge computing and allows for these devices to be connected microservices. More than ever, these devices have increased accessibility, are easier to mass produce, and are adaptable for many different solutions.

The Fourth Industrial Revolution

If we can separate the inputs, outputs, and processes, we can create an infinite number of solutions using the same physical devices. The world of IoT transforms everything we do and how we do it. Changing industries across the board, freeing humans to pursue creative roles, and letting the machines take care of the straightforward repeatable tasks. This will enable a new era of machine-to-machine communication, the key to the Fourth Industrial Revolution’s success.