Data management method and device, server and storage medium
A data management and server technology, applied in the field of data processing, to achieve the effect of improving the utilization rate of shards
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0027] figure 1 It is a flow chart of a data management method provided by Embodiment 1 of the present invention. This embodiment is applicable to the data management of a distributed system. The method can be executed by a data management device, which can use software / hardware way to achieve. The device may be configured in an application server performing data management. Such as figure 1 As shown, the method specifically includes:
[0028] Step S110, acquiring routing rule data.
[0029] Wherein, the routing rule data is used to indicate the mapping relationship between the key of the business data and the database number, and the key of the business data may be a route named according to the business data.
[0030] The database number is the number of the database shard. For example, the database is fragmented to obtain a set number of database fragments. Wherein, the set number is an empirical value, and the number of slices to divide the database can be determined...
Embodiment 2
[0048] figure 2 It is a flowchart of another data management method in Embodiment 2 of the present invention. This embodiment is optimized on the basis of the above-mentioned embodiments, such as figure 2 As shown, the method includes:
[0049] Step S210, creating a Redis connection pool.
[0050] The Redis connection pool is connected between the application server and the Redis server, and is used to store the connection relationship between the application server and the Redis server. The application server pre-establishes the Redis connection pool. When the connection needs to be used, the application server obtains the established connection from the Redis connection pool through a certain algorithm, and returns it to the connection pool after use, which eliminates the need for database connections. time.
[0051] Step S220, judging whether the Redis connection pool has been created, if yes, execute step S230, otherwise return to execute step S210.
[0052] Exemplar...
Embodiment 3
[0064] image 3 It is a flow chart of another data management method in Embodiment 3 of the present invention. This embodiment is optimized on the basis of the above embodiments, such as image 3 As shown, the method includes:
[0065] Step S310, querying the setting database according to a preset frequency to obtain routing rule data.
[0066] The setting database is a common database pre-connected with the application server for storing routing rule data, and the setting database may be a relational database management system, such as MySQL.
[0067] Exemplarily, the routing rule data is stored in MySQL in advance, and when the application in the business center is started, the application server queries MySQL, and loads the routing rule data in MySQL into the memory of the application server.
[0068] Optionally, the application server may regularly read the routing rule data in the setting database. For example, the application server cooperates with the scheduled tasks...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


