In May 2011, a group of software architects at a workshop near Venice used the word “microservice” to describe a process they had recently worked on. The philosophical essence of a microservice can be described as, “Focus on one task and do it well.” Microservices are a flexible, single-purpose software program essentially compatible with any application. Shipping microservices do not care which application asks something be shipped to a customer. Nor does such a microservice care what is being shipped. The only focus of shipping microservices is to send something somewhere, to someone. The task is focused and efficient.
Imagine three “microservice entities,” each simplistic and very focused on performing a specific task. One scans information from a data silo, searching Big Data for the keywords: ultra-thin solar cells ultra-thin cells, and perovskite. The second monitors the overall system for problems and corrects them, as needed. The third microservice entity scans security, watching for intruders or viruses. These small, simplistic microservice entities aren’t really bright enough to be called AIs (though they may evolve in that direction).
Jack Norris, Senior Vice President of Data and Applications at MapR, stated:
“As companies turn to analyze Big Data to transform their business operations, microservices promote an Agile approach to developing applications, especially converged applications. Microservices are relatively simple, single-purpose processes that work in unison via lightweight communications like data streams. With an underlying data platform that provides data elasticity, microservices can be used to develop useful applications and include Machine Learning as part of the process. They are really transformational.”
The ways traditional businesses and Internet enterprises function tend to be quite different. Traditional businesses are slowly adjusting to microservices, and are more focused on transactions, such as processing service claims or gathering information from shipping orders. They generally use a monolithic system (a traditional computer system where everything is interconnected and interdependent). Internet companies, on the other hand, are less dependent on monolithic systems, and tend to be more flexible, more cutting edge, and use microservices and the Cloud to handle huge volume issues and scaling.
The Pitfalls of Microservices
There have been concerns about the use of microservices. For example, they can be more difficult to build than monolithic systems (they are easier to work with, not easier to build). After being built, deployment becomes more complicated, as it now needs a complicated script to operate. Microservices on the Cloud often incorporate automated load balancing and scaling services, which may force a development team to become dependent on specific cloud providers.
Other problems with using microservices include having to manage multiple separate entities, and the possibility of dealing with more complex deployments and versioning. As the total number of microservice entities rises, latencies (data transfer delays), develop. A large number of microservice entities communicating with one another can be a recipe for disaster. Without the tools to view these entities as they work, it can be difficult to understand the problems taking place. (The tools are available. Monitoring and Testing APIs can help prevent this.)
Also, it has been reported microservices use up a lot of memory. While a microservice entity has a single focus/task, it has to store a multitude of languages to be fully functional.
The Benefits of Microservices
Microservices are described as “loosely coupled,” meaning they can be worked on separately, without shutting down the entire system. As a consequence, microservices psychologically promote working on business scenarios, rather than focusing on the restrictions of technology. Smaller teams can develop a microservice for customer scenarios that are compatible with any technology available. In other words, the organization doesn’t need to limit itself to maintain monolithic applications.
Many organizations are considering microservices as a supplement to their more traditional monolithic system. Microservices are typically inexpensive and quite efficient. They break applications into smaller, more manageable segments, resulting in faster deployments and more efficient update cycles. During the development process, the smaller modules permit each application service to be opened, managed, and updated, independently, without shutting down the entire system. Microservices can be scaled up or down, and may be deployed, tested, and managed independently. “Applications that use microservices are easier to update because updating one component of the application does not affect other components.”
In monolithic systems, there is a focus on developing tiered applications, with each tier using specific technologies. The phrase “monolithic application” has been used to describe this approach. The interfaces were typically placed between the tiers, and include a more tightly coupled design between the components of each tier. While a monolithic design does have some benefits, such as a simple design, and faster communications between components, the downside is the tight coupling that exists between tiered layers. If a repair or upgrade is necessary, the entire system must be shut down, interrupting the work flow.
The benefits of using microservices include:
- Ideas to improve the business are given a higher priority than technical strategies.
- Loose coupling allow for changes and repairs without shutting down the system.
- Systems can be easily altered and reorganized for optimum use on a specific project.
- Microservices tend to be inexpensive and easy to work with.
More and more organizations are discovering that rebuilding the overall system with independent, scenario-focused microservice entities makes for a superior, flexible, long-term arrangement.
Microservices on the Cloud
The Cloud offers an ideal environment for the use of microservices, and generally improves operational efficiency. Using microservices in the Cloud provides an inexpensive, and extremely scalable infrastructure, offering total self-service and a pay-as-you-go arrangement. The use of containers, with their quick startup, standardized application packaging, and availability as an isolation model, also contribute to its efficiency and agility.
Containers are an abstract operating system, a virtual reality designed to imitate the physical operating system. Containers do share an operating system, which gives them the ability to communicate with one another, interconnect, and become a single application.
A Cloud provider’s API calls can be used for handling event-driven computing, helping developers to create efficient applications. While organizations using microservices may not “need” the Cloud, they can still take advantage of it.
Polyglot Programming and Persistence
Polyglot programming is a key element in the design of a microservice entity. It is a term describing how applications can take full advantage of the way certain languages are better at dealing with certain problems, by writing the application in a multitude of languages. Complicated applications blend different kinds of problems together, so choosing the best language for dealing with a job can be more efficient than trying to adapt all aspects (a program “aspect” is a feature linked to many other parts of the program) into a single language.
The same concept can also be used on databases. In this case, it is called polyglot persistence, which means an application that communicates with different databases, and uses the most appropriate language to achieve an end goal. More simply, polyglot persistence is the use of varying data storage “technologies” in handling multiple data storage “requirements.”
The Internet of Things
Microservices can help process data taken form the Internet of Things. Many businesses view the Internet of Things (IoT) as a unique opportunity. The IoT consists of control and sensor devices which are connected by way the Internet. These devices, however, accept a broad mix of data formats and languages, and analyzing and managing that data can be quite difficult for organizations. Microservices can help resolve this problem through their acceptance of multiple languages. Additionally, when an organization uses microservices, it can more easily assure privacy. If choosing to use microservices “and” the Cloud, organizations should align their IoT security to match their cloud requirements and policies.
Microservices on the Cloud allow a broad range of specific tasks to be performed. When using the Cloud, the IoT can be thought of as a collection of Cloud-based microservices, rather than a collection of sensors. With this kind of flexibility, businesses can apply policy and security filters to oversee the way the IoT gets used. If the data from the IoT is collected and stored in the Cloud, then microservice analytics can locate and extract the data as needed. This transforms the IoT into a cloud challenge, rather than a network challenge. Users will need to collect the IoT data, indexing and storing it for later access.
When using Cloud-based microservices to research the Internet of Things, one microservice entity can collect information from controllers and sensors, making it visible as data and acting as a gateway box.
“It could even add time-stamped data to make it easier for users to project trends and identify correlations. The data could also be indexed by location, allowing it to link to a user’s location or route. With the addition of a gateway box, any sensor network can be added to the IoT device collection. This can build up a critical mass of data very quickly, and at a minimal cost.”
WANT TO STAY IN THE KNOW?
Get our weekly newsletter in your inbox with the latest Data Management articles, webinars, events, online courses, and more.