Table of contents
How to judge which method to obtain data?
call api
advantage:
- The interface document specification is reflected in the strict description of the request method, the passed parameters and the parameter types
- Reduce developer logic processing. The api encapsulates the logic of the function inside the interface, and does not require developers to write the logic by themselves
- The interface returns rich information
shortcoming:
1. A business may call multiple interfaces. Such as business: judge whether the user creates a task in compliance with the specification:
Interface 1. Obtain the members under the specified project,
Interface 2. Obtain and create tasks according to members,
Interface 3. Obtain task specific information according to the task id.
Judging whether the task meets the specification
2. Excessive acquisition of data increases the corresponding time. Most of the information returned by the interface is unnecessary. For example, only the personnel under the project are obtained, and the remaining data is not needed, which increases the response time of the interface.
3. The data structure is not clear. You need to use postman or idea to call api and escape or parse before you know the returned data format
remote table
advantage:
- You can clearly see the data in the database locally, and the ZenTao data will be updated to the local
- flexible. The connection query between tables can be customized according to the requirements
shortcoming:
- Occupies server memory resources
- Does not support transactions (current business requirements only involve query operations on data tables, not transactions)
- Data can only be read locally, but cannot be modified (current business requirements do not involve modification)
- You need to be familiar with the table structure, which takes time
data source
advantage:
Flexible configuration. It is convenient to configure the address, user name, password, and library name of the data source in the configuration file, and the database connection information can be modified flexibly
shortcoming:
- Data can only be read locally, but cannot be modified (current business requirements do not involve modification)
- You need to be familiar with the table structure, which takes time
are p
Simulate user's artificial behavior
shortcoming:
If the website has crawler restrictions, information cannot be obtained
How to judge which method to obtain data?
- Is the database on our side and is it possible to connect directly to the database? -Remote tables, data sources
- Do you have permission to call the other party's API? - call api
- Simulate user's artificial behavior - crawler