Why Microservices Matter: From Monoliths to Scalable Architecture
This article explains the fundamentals of microservice architecture, contrasts it with monolithic designs, outlines the problems microservices solve, lists their advantages and drawbacks, provides a hands‑on code example, and describes practical strategies for splitting and migrating legacy systems.
1. Introduction
Microservices is an architectural style where a large complex application is composed of many independent services and a front‑end. Each service can be deployed independently and focuses on a single business capability.
2. What is a monolithic architecture
Monolithic architecture packages all layers of an application into a single deployable unit. A typical three‑tier web app (UI, database, server) is built as one codebase; any change requires rebuilding and redeploying the whole system.
3. What is microservice architecture
Microservice architecture models the system as loosely coupled independent services built around business domains. Each service has its own database, can be written in different languages, and can be developed, tested, deployed, monitored and scaled independently.
4. Problems solved by microservices
4.1 Scalability
Monoliths can only be scaled by replicating the whole application, wasting resources. Microservices allow independent horizontal scaling of individual services.
4.2 Long delivery time
Any change in a monolith requires rebuilding and redeploying the entire system, slowing continuous delivery. With microservices only the affected service is built and deployed.
4.3 Application complexity
As a monolith grows, code becomes tangled and hard to maintain. Microservices enable teams to work on separate services, keeping codebases clean.
4.4 Lack of clear ownership
In a monolith many teams share the same codebase, creating hidden dependencies. In microservices each team owns a complete service.
4.5 Cascading failures
Failures in one part of a monolith can bring down the whole system; microservices can use circuit breakers to isolate faults.
4.6 Dev‑Ops wall
Traditional hand‑off between development and operations is reduced; the same team can build, run and maintain its service.
4.7 Technology lock‑in
Monoliths tie you to a single technology stack; microservices let each service use the most suitable language or framework.
4.8 Tooling maturity
Container platforms and cloud PaaS now provide the necessary tooling to adopt microservices at scale.
5. Summary of microservice benefits
Small, cohesive services are easy to understand and develop.
Independent deployment enables continuous delivery.
Fine‑grained horizontal and vertical scaling.
Team autonomy and clear ownership.
Improved fault tolerance.
Technology‑agnostic implementation.
Reduced cost through reuse and focused development.
5.1 Drawbacks
Increased operational complexity and cost.
Need for DevOps culture and automation.
Monitoring, testing and data consistency become harder.
Potential for many small databases and distributed transactions.
6. Hands‑on microservice example
The example provides a simple Spring Boot controller that exposes three HTTP endpoints for querying programming languages.
@ApiVersion(2)
@RequestMapping("/programLanguage/getByName")
public List<String> getByName(@RequestParam String languageName) {
List<String> filterList = languageList.stream()
.filter(s -> s.toLowerCase().contains(languageName.toLowerCase()))
.collect(Collectors.toList());
return filterList;
}7. Microservice splitting strategy
7.1 Principles
Single responsibility, high cohesion, low coupling.
Appropriate service granularity – one service per complete business capability.
Avoid circular and bidirectional dependencies.
Align service boundaries with team structure.
7.2 Incorrect strategy
Replacing an entire legacy system with a huge new microservice set leads to long delays and high risk.
7.3 Correct strategy
Start with a small system, gain experience, then gradually expand.
Core splitting requirements: high cohesion, low coupling, minimal inter‑service calls, and avoidance of distributed transactions.
7.4 Design considerations
Consider non‑functional requirements (scalability, availability, security), complexity, team size, and existing heterogeneous technologies when defining service boundaries.
8. Migration patterns
8.1 Strangler (or “kill‑the‑old”) pattern
New functionality is built as independent services that gradually replace parts of the legacy monolith.
8.2 Rehab pattern
Problematic modules are isolated, rebuilt as services, and reintegrated, suitable for low‑change legacy systems.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
ITFLY8 Architecture Home
ITFLY8 Architecture Home - focused on architecture knowledge sharing and exchange, covering project management and product design. Includes large-scale distributed website architecture (high performance, high availability, caching, message queues...), design patterns, architecture patterns, big data, project management (SCRUM, PMP, Prince2), product design, and more.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
