Backend Development 7 min read

Understanding Microservices: From Monolithic Architecture to Distributed Systems

This article explains the concept of microservices, contrasts it with monolithic architecture, outlines the drawbacks of monoliths, describes the advantages of microservice architectures, and briefly compares microservices with SOA, while also promoting a Java interview question resource.

Selected Java Interview Questions
Selected Java Interview Questions
Selected Java Interview Questions
Understanding Microservices: From Monolithic Architecture to Distributed Systems

Click the "Java Interview Questions Selection" above to follow the public account.

Interview practice, fill the gaps.

>>>> Notice: Previous interview questions are organized in groups of ten and placed in the public account menu under "Interview Questions"; feel free to browse them.

Stage summary collection: ++Microservice Interview Questions Summary++

Note: This article is intended for interview preparation; for deeper study, consult additional resources. Future updates will include microservice‑related interview questions.

What is Microservices

Microservice architecture is a distributed system that divides a business into independent service units, addressing the shortcomings of monolithic systems while meeting increasingly complex business needs.

I. Monolithic Architecture

1.1 What is Monolithic Architecture

In software design, the classic three‑layer model (presentation, business logic, data access) is often mentioned. A typical monolithic architecture places all layers for all business scenarios into a single project, which is then compiled, packaged, and deployed on a single server.

1.2 Drawbacks of Monolithic Architecture

For small applications with low traffic, this architecture is cost‑effective and fast to develop. However, as business grows, code volume, complexity, and maintenance difficulty increase, and concurrency capacity becomes limited.

Some may try to cluster the monolith, add load balancers, cache servers, file servers, and read‑write split databases, as shown below.

Although this improves concurrency to some extent, the system remains fundamentally monolithic, with poor code readability and maintainability, and limited scalability for massive user bases. These shortcomings motivate the shift to microservice architecture.

II. Microservices

2.1 What is Microservice

Microservices were originally introduced by Martin Fowler. In his words:

Microservice architecture builds a single application as a suite of small services, each running in its own process and communicating via lightweight mechanisms, typically HTTP RESTful APIs. Services are organized around business capabilities and can be deployed independently, using different programming languages and databases, with minimal centralized management.

In summary, microservices split a monolithic application into independent programs (services) that communicate via HTTP (or message queues such as RocketMQ, Kafka). Different services may use different languages, databases, and automated deployment tools (e.g., Jenkins). Because the number of services grows, centralized management tools like Eureka or Zookeeper are often employed.

2.2 Advantages of Microservices

Decompose complex business into smaller services, simplifying development and reducing learning curve for newcomers.

Being a distributed system, services are fully decoupled, allowing horizontal scaling and cluster deployment to handle high concurrency.

Services communicate via HTTP, enabling each service to choose the most suitable language and database for its domain.

Independent deployment means changes to one service do not affect others.

2.3 Relationship Between Microservices and SOA

SOA (Service‑Oriented Architecture) integrates large systems using an Enterprise Service Bus (ESB). Microservices can be seen as a lightweight, agile implementation of SOA, achieving similar componentization with less overhead.

Source: https://www.jianshu.com/p/d9504fc0af4d

Instead of searching for questions online, follow us now!

backenddistributed systemsmicroservicesSOAmonolithic architecture
Selected Java Interview Questions
Written by

Selected Java Interview Questions

A professional Java tech channel sharing common knowledge to help developers fill gaps. Follow us!

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.