NOTE
Business System Design Analysis Method
Business-system analysis begins with requirements and prototypes, followed by actors, flows, and data relationships. These notes organize the design process around those steps.
This is a historical learning note and may contain outdated or incomplete understanding.
1. What Is the Requirement?
- Requirement document.
- Prototype.
2. Why Is This Needed?
- What problem does it solve?
- Can the requirement be avoided?
- Can the requirement be simplified?
3. Requirements Analysis
Use examples from the system to understand each concept.
3.1. What Is the Existing Flow?
Ask operations or product staff to demonstrate the flow. Read/write flow, business-facing and consumer-facing flows.
3.2. What Is the New Flow?
- What roles exist in the system and what can each role do?
- Use-Case Diagram
- What is the flow for each role to perform an action?
3.3. QPS Estimation
- Assume
DAU (daily active users)is 10 million, each user performs 10 operations, and operations are spread across 24 hours. PV (daily page views) = DAU * 10 = 10 million * 10 = 100 million.Average QPS = PV / 24h = 100 million / (24*60*60) = 1160.Peak QPS = average QPS * 10 = 1160 * 10 = 11600.
3.4. Bandwidth Estimation
Optimization methods: compression and pagination.
4. Solution Design
- Expose API interfaces to clients.
- Internally, combine different data components:
- Database.
- Cache.
- Search engine.
- Message queue.
4.1. Storage Design
-
Choose storage according to functionality, request volume, data volume, stability, scalability, cost, storage model, etc.
-
Functionality:
- Elasticsearch: complex retrieval.
- MySQL: ACID transactions + persistence.
- MongoDB: JSON + persistence.
- Redis: memory.
- Kafka: peak shaving, asynchronous processing, decoupling.
-
Request volume:
- Business-facing or consumer-facing.
Component Reads per second Writes per second MySQL 10000 5000 Redis 100000 100000 Kafka 100000 100000 MongoDB 20000-50000 10000-25000 -
Data volume:
- Daily data volume = daily request volume * data written per request.
- How many days to retain.
- Redis Capacity Estimation
- How to Estimate Table and Index Space
Component Max effective capacity MySQL 3TB Redis 16GB-128GB MongoDB -
Stability:
- Read/write success rate; refer to service-level-agreement availability.
- Whether failover is manual or automatic, how long it takes, and its business impact.
-
Scalability:
- Whether rapid scaling is supported and how fast scaling is.
-
Data-model design:
- What entities exist and what relationships exist among them?
- Data Model
- ER Diagram
4.2. API Design
- One API for each operation.
- Define the API protocol.
4.3. Architecture Design
Consider security, high concurrency, high availability, and maintainability together.
- Split into microservices.
- Draw an application architecture diagram.
- Draw a sequence diagram.
4.4. Code Design
Class Diagram Component Diagram
4.5. Critical Read/Write Paths
5. Effort Estimation
- Estimate 0.5-2 days per API.
6. Development
7. Testing
Functional testing, unit testing, API testing, load testing, etc. Testing
8. Release
- Service release checklist.
- Deployment.
- Deployment Diagram
machine count = expected system QPS / QPS per machine. QPS per machine can refer to Load Testing.
9. Operations
- Organize logs and monitoring for critical paths.
- Troubleshoot common problems.
10. Optimization
11. Summary
- Compare solutions.
- Problems encountered and how they were solved.
- Design highlights.
- Why component XXX was introduced.
- Pain points and improvement measures.
- How to handle N-times growth in request volume and data volume.
- Refactoring
12. References
Drag to pan, scroll to zoom, and click a node to expand or collapse it. Large maps start with deeper levels collapsed; click nodes to expand them.
Discussion
Sign in with GitHub to comment. Discussions are stored as GitHub Issues.View on GitHub