+-------------------+
| User Interface |
+---------+---------+
|
+---------v---------+
| API Gateway / |
| Load Balancer |
+---------+---------+
|
+---------------+----------------+
| | |
+---v---+ +---v---+ +---v---+
|User | |Content| |Search |
|Service| |Service| |Service|
+---+---+ +---+---+ +---+---+
| | |
| | |
+---v---+ +---v---+ +---v---+
|Auth | |Database| |Index |
|DB | |(Posts, | |Store |
| | |Likes, | | |
+-------+ |Comments)| +-------+
+---+---+
|
+------+------+
| Notification |
| & Messaging |
| Service |
+--------------+Request Flow
1. User sends request via UI to API Gateway
2. API Gateway authenticates user and routes request to appropriate service
3. User Service manages profile and connections data
4. Content Service stores or retrieves posts, likes, comments
5. Search Service indexes new content and handles search queries
6. Notification Service listens to events and pushes real-time updates
7. Caching layer serves frequent reads to reduce database load
8. Responses flow back through API Gateway to user interface
Database Schema
Entities: User (id, name, email, password_hash), Post (id, user_id, content, timestamp), Like (id, user_id, post_id), Comment (id, user_id, post_id, content, timestamp), Connection (user_id, friend_id), Notification (id, user_id, type, content, read_status, timestamp). Relationships: User 1:N Post, User N:N User via Connection, Post 1:N Like, Post 1:N Comment, User 1:N Notification.