5 misconceptions about Microservices Architecture

Alexandre Jacquot
Pictet Technologies Blog
6 min readAug 29, 2023

--

Illustration by Luke H

In the world of modern software development, few concepts have gained as much attention and praise as the Microservices Architecture. While it is undeniable that this architectural approach brings several advantages, it is often misunderstood. This article doesn’t aim to explain what a Microservices Architecture is, as there are already plenty of great articles doing so. Instead, we will debunk a few misconceptions I have encountered in my professional career.

Misconception #1: The Microservices Architecture involves solely creating Web Services

While it is true that Web Services are an essential part of the Microservices Architecture, they are not the sole components. This misconception often arises due to the important role of Web Services in this architectural approach, leading people to believe that the two are synonymous. In fact, the Microservices Architecture encompasses a broader set of principles, practices, and components such as:

  • Scalability: The ability of a system to handle increasing loads by adding resources or replicating components.
  • Load Balancing: The process of distributing incoming network traffic across multiple instances to ensure optimal resource usage and prevent overloading.
  • Service Discovery: A mechanism that allows microservices to locate and communicate with each other dynamically in a distributed environment.
  • Resilience and Fault Tolerance: Designing systems to withstand failures and continue functioning by employing various techniques, such as circuit breakers, retry mechanisms, and rate limiters, to name a few.
  • Externalized Configuration: The process of externalizing and managing configurations for microservices enhances flexibility and maintainability.
  • API Management: Governing the lifecycle of APIs, including their creation, documentation, versioning, access control, and usage analytics.
  • Messaging: Asynchronous communication between microservices through messages, enabling decoupling and improving responsiveness.
  • Distributed Tracing: Capturing and analyzing transaction paths across microservices to identify performance bottlenecks and diagnose issues.
  • Monitoring and Alerting: Tracking the health and performance of microservices and raising alerts when predefined thresholds or anomalies are detected.
  • Distributed Logging: Recording events and activities within microservices to facilitate debugging and troubleshooting.

It is important to mention that not all elements are mandatory, and their inclusion depends on the context of the developed solutions, considering all aspects such as business requirements, non-functional considerations and costs. However, this illustrates the richness of the Microservices Architecture, which goes far beyond just creating Web Services.

Misconception #2: Microservice means small

Another misconception is that a microservice must be small in size. While the term “micro” suggests smallness, it is more about the single responsibility and focused functionality of a service rather than its size.

Striking the right balance in service size is crucial. Choosing the wrong service granularity can lead to issues, as excessively fine-grained services can result in increased communication overhead and coordination complexities, while overly coarse-grained services can amplify failure impact and have detrimental effects on agility and flexibility.

In case of uncertainty, it is always advisable to start by grouping several functionalities within the same service while ensuring a clear segregation and decoupling of responsibilities through a modular approach. This strategy helps avoid creating an excessive number of services, which could lead to increased overall complexity in the information system. Over time, if needed, specific functionalities can be extracted into separate services in a thoughtful and well-planned manner.

The key to a successful Microservices Architecture is not solely about size, but rather about designing services that are cohesive, independent, and perform their designated tasks efficiently.

Misconception #3: A Microservices Architecture is always better than a Monolithic approach

The Microservices Architecture offers numerous benefits, but it is not a one-size-fits-all solution. There are scenarios where a Monolithic Architecture might be more suitable, depending on the size, complexity, and team capabilities.

Despite their advantages, microservices introduce complexities, such as network communication, distributed data management, and increased operational overhead. Monoliths can be simpler to develop and deploy, especially for small-scale applications or projects with limited requirements.

Starting with a monolith could sometimes be better than jumping straight into microservices. Nonetheless, if you choose to adopt a Monolithic approach, it is essential to design your monolith in a modular manner. This will enable you to maintain flexibility and potentially facilitate a smooth migration to a Microservices Architecture if the need arises in the future. If you’re interested in such an approach, I recommend you take a look at solutions like Spring Modulith.

Therefore, it is crucial to evaluate the specific needs of the project and consider the trade-offs before making a decision on the architecture.

Misconception #4: Data duplication is a bad thing

Data duplication is often perceived as a complication in the realm of microservices. However, when approached strategically, it can offer advantages. One notable example of where data duplication can be beneficial is through the implementation of the Command Query Responsibility Segregation pattern. In this pattern, read models involve clear data duplication but are designed for specific purposes with the aim of achieving great performance. It’s important to note that duplicated data does not necessarily mean it is replicated as is. Instead, it can be transformed, and only the necessary information should be stored.

When it comes to storage, the costs associated with data duplication are often over estimated. With the continuous decline in storage prices, the financial implications of data duplication become less important. Instead of fixating on storage costs, the focus should be on effective data management and optimization strategies.

One more challenge that arises due to data duplication is the need to maintain data integrity. When a service updates its local copy of the data, synchronizing these changes across all instances of the same data in other services can pose a significant challenge. To address this, the concept of eventual consistency can be applied. Eventual consistency is a model that allows for temporary inconsistencies to exist between different copies of the same data across various services. Instead of demanding that all copies of the data be immediately synchronized, this model accepts that there may be some delay in propagating updates and changes throughout the system. The main idea behind this concept is to prioritize other important factors, such as performance and availability, over strict real-time consistency. In a highly interconnected and dynamic microservices architecture, striving for immediate consistency could lead to bottlenecks and increased latency, impacting the overall system performance.

To conclude, the strategic use of data duplication, in conjunction with appropriate consistency models, can lead to improved performance and overall system reliability.

Misconception #5: Microservice means Spring Boot and Java

Microservices are not limited to specific programming languages or frameworks, providing developers with a wide array of options to choose from. Some of the popular languages used for building microservices include Java, JavaScript and Python. Additionally, there are various frameworks available that facilitate microservices development.

Spring Boot has been traditionally associated with microservices due to its mature ecosystems and extensive libraries, simplifying the development process. Meanwhile, Node.js, with its asynchronous and event-driven nature, is well-suited for building lightweight and scalable microservices. Python, on the other hand, offers flexibility and ease of use with frameworks like Django, FastAPI, and Flask, which are popular choices for microservices development. Furthermore, Java frameworks like Micronaut and Quarkus have gained traction in the microservices community by providing low CPU and memory consumption leading to notable performances while promoting green software development.

The choice of language and framework for building microservices depends on factors such as team expertise, project requirements, scalability needs, and ecosystem support.

Whether this article introduced you to new information or reinforced existing knowledge, I hope it was a valuable experience. Stay curious and keep expanding your understanding of the World. Happy learning! 🤓📚

This article was partially generated using ChatGPT, an AI language model developed by OpenAI.

--

--

Alexandre Jacquot
Pictet Technologies Blog

Technical Lead at Pictet Technologies. Enthusiastic about coding and sharing experiences.