0
0
HLDsystem_design~12 mins

Logging strategies in HLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Logging strategies

This system shows how logging is handled in a scalable application. Logs capture important events and errors from services. The system ensures logs are collected, stored, and analyzed efficiently without slowing down the main application.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
Application Service
  |
  +--------------------+
  |                    |
  v                    v
Log Collector       Main Database
  |
  v
Log Storage
  |
  v
Log Analysis Service
Components
User
user
End user interacting with the application
Load Balancer
load_balancer
Distributes incoming requests evenly to application services
Application Service
service
Handles user requests and generates logs for events and errors
Log Collector
service
Receives logs asynchronously from application services to avoid slowing them down
Main Database
database
Stores application data, separate from logs
Log Storage
database
Stores collected logs in a scalable and searchable format
Log Analysis Service
service
Processes and analyzes logs for monitoring and alerting
Request Flow - 6 Hops
UserLoad Balancer
Load BalancerApplication Service
Application ServiceMain Database
Application ServiceLog Collector
Log CollectorLog Storage
Log Analysis ServiceLog Storage
Failure Scenario
Component Fails:Log Collector
Impact:Logs from application services are lost or delayed, reducing monitoring visibility but user requests still succeed
Mitigation:Use retry mechanisms and buffer logs locally in application services until collector is available again
Architecture Quiz - 3 Questions
Test your understanding
Why does the Application Service send logs asynchronously to the Log Collector?
ATo avoid slowing down user request processing
BTo ensure logs are stored before responding to users
CTo reduce network traffic
DTo encrypt logs before sending
Design Principle
This design separates logging from main request processing to keep the application fast and reliable. Asynchronous log collection and dedicated storage allow scalable log management without impacting user experience.