What are microservices?

Microservices are a set of software applications designed for a limited scope that work with each other to form a bigger solution. Each service has minimal capabilities for the sake of creating a very modularized overall architecture. Microservices architecture is analogous to a manufacturing assembly line, where each service is like a station in the assembly line. Just as each station is responsible for one specific task, the same holds true for microservices. Each station is an “expert” in its given responsibilities, thus promoting efficiency, consistency, and quality in the workflow and the outputs. Contrast that to a manufacturing environment in which each station is responsible for building the entire product itself. This is analogous to a monolithic software application that performs all tasks within the same process.

How Do Microservices Work?

Microservices represent a design pattern in which each service is just one small piece of a bigger overall system. Each microsystem performs a specific and limited scope task that contributes to the end result. Each task could be as simple as “calculate the standard deviation of the input data set” or “count the number of words in the text.” The key behind building microservices is planning the system to identify the distinct subtask, then writing applications that address each subtask. As each microservice needs to deliver output data to the next, a microservices architecture often uses a lightweight messaging system for that data handoff.

Microservices Diagram
This diagram compares microservices architecture with monolithic architecture. Microservices are generally easier to build, to deploy, and to scale due to their smaller size and distributed nature.

Microservices are advantageous over monolithic applications for several reasons. They are easier to build (because of their smaller size), to deploy, to scale (as more microservices can be added to any step to run in parallel), to maintain, etc. They are not new, as the concept has roots in older design patterns such as service-oriented architectures (SOA), modularity, and separation of concerns. They represent a new way of architecting large-scale systems that could otherwise be more difficult to manage in a traditional monolithic architecture.

In general, there are no specific requirements around building microservices, which gives application developers a lot of flexibility in terms of programming language, technology environment, and deployment options. Specific requirements often drive the choice of technology, and when high performance and low latency are required, an in-memory processing engine is typically used. Engines like Hazelcast Jet leverages the power of in-memory processing to build and run extremely fast microservices in environments that need to react quickly to huge volumes of data.

Example Use Cases

Many use cases are applicable for microservices, especially those that involve an extensive data pipeline. For example, a microservices-based system would be ideal for a reporting system on a company’s retail store sales. Each step in the data preparation process would be handled by a microservice: data collection, cleansing, normalization, enrichment, aggregation, reporting, etc. The workflow naturally creates a trackable lineage so if any problems are encountered in the data, it is relatively easy to trace back which microservice might need to be updated.

Another use case entails machine learning (ML). A microservices-based ML environment collects, aggregates, and analyzes a data flow so that the ML framework can determine an outcome. In such an environment, the data runs through a workflow that has many steps, and each step is handled by a microservice. One advantage of using a microservices architecture for machine learning is that multiple machine learning frameworks can be included in the workflow so that multiple models can be created on the same data flow. This is useful when the machine learning frameworks are targeting a predicted outcome, and having multiple frameworks running simultaneously provides a comparison around which model is providing the best results.

Related Topics

Microservices Architecture

Edge Computing

Grid Computing

In-Memory Data Grid

Java Microservices

Further Reading

Six Advantages of Microservices

Knowledge Driven Microservices

Where Is My Cache? Architectural Patterns for Caching Microservices

How Streaming Microservices Can Advance Your Entire IT Environment

Streaming Microservices Use Case

Relevant Resources

White Paper

Getting Started with Microservices Using Hazelcast IMDG and Spring Boot

Microservices, as an architectural approach, has shown a great deal of benefit over the legacy style of monolithic single applications. Nevertheless, microservices are not without their drawbacks. The purpose of this white paper is to show the first steps for using Spring Boot and Hazelcast IMDG® and how they contribute to the microservices landscape, enhancing the benefits and alleviating some of the common downsides.

View All Resources