Objectives

1. Monolithic and Microservice

1.1. Monolithic Architecture

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:

1.2. Microservice Architecture

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:

2. Target Architecture: E-commerce System

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:

3. System Design: Architecture Diagram

4. Local Development Environment Setup

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)

5. Hands-on Activity: Architecture Brainstorm

Task: In pairs or small groups, break down a well-known application (e.g., Shopee, Lazada, Amazon) into microservices.

Questions to discuss:

Example: