preface

When we do architectural design, we usually go through three stages: requirements analysis, outline design and detailed design.

  1. Requirement analysis stage: it mainly sorts out all Use cases and scenarios, abstracts the users and roles facing the system, and sorts out the functional and non-functional requirements provided by requirements for these users.
  2. Summary design stage: according to the product of demand analysis: core requirements, the whole system is divided into modules, and the interaction between modules is defined.
  3. Detailed design stage: Describes the architecture of the system through multiple views, including but not limited to: logical system, physical view, data view, and physical view

Nonfunctional requirements

Non-functional requirements are mainly reflected in high performance, high availability, scalability, scalability, and security.

Non-functional requirements correspond to different system metrics

Non-functional requirements correspond to different system indicators, which are mainly divided into four parts:

  • Application server
  • The database
  • The cache
  • The message queue

1. Application servers

The application server is the entry point for requests and all traffic is forwarded through the application server. Mainly concerned with QPS, RT and other indicators. The following table lists capacity and performance indicators

1. Daily request volume 2. Peak access of each interface 3. Maximum response time 5. Request size 6. Nic and disk I/O responsibility 7. 8. CPU usageCopy the code

2. The database

Deployment structure-related indicators

Replication model 2. Failover policy 3. Dr Policy 4. Archive policy 5. Read/write separation policy 6. Database and table separation policyCopy the code

The following table lists capacity and performance indicators

Current data capacity 2. Estimated data capacity 3. Peak read per second 4. Peak write per second 5. Peak transaction per secondCopy the code

3. The cache

Deployment structure-related indicators

1. Replication model 2. Failover 3. Persistence strategy 4. Threading modelCopy the code

Capacity and performance indicators

1. Cache content size 2. Cache content quantity 3. Cache data structure 5. Peak read per second 6. Peak write per secondCopy the code

4. Message queues

Deployment structure-related indicators

1. Replication model 2. Failover 3Copy the code

Capacity and performance indicators

1. Average data increments per day 2. Message retention time 3. Peak write per second 5. Size per message 6. Average response time 7. Maximum response timeCopy the code

reference

  • Distributed service architecture principle, design and practice