A monolithic application is built as a single, tightly-coupled unit. All logic (user interface, business logic, data access) exists in one codebase and is typically deployed as a single executable.
Characteristics:
A microservices system is composed of multiple small, autonomous services. Each service is responsible for a specific business capability and communicates with others over a network (usually HTTP or messaging queues).
Characteristics:
Benefits:
Challenges:
We will build a simplified E-commerce platform with the following microservices:
Service Name | Responsibilities | Technology |
---|---|---|
user-service |
User registration, login, authentication | Node.js, Express |
product-service |
Product catalog management (CRUD) | Node.js, Express |
order-service |
Handles order creation, status, total price | Node.js, Express |
notification-service |
Sends notifications or logs events | Node.js, Hono |
api-gateway |
Centralized routing and authentication | Node.js, Express |
Each service will have its own:
Required Tools:
Folder Structure Example:
1
2
3
4
5
6
7
/ecommerce-system/
├── user-service/
├── product-service/
├── order-service/
├── notification-service/
├── api-gateway/
└── docker-compose.yml (added in later epochs)
Task: In pairs or small groups, break down a well-known application (e.g., Shopee, Lazada, Amazon) into microservices.
Questions to discuss:
Example:
payment-service
– handles transactionsreview-service
– manages product reviewssearch-service
– full-text product searchinventory-service
– manages stock quantities