Distributed database connection method and device

A connection method and connection device technology, applied in the field of database management, can solve problems such as waste of resources, idle connections in connection pools, failure to be reused, etc., and achieve the effect of reducing the number of threads and saving system resources

Active Publication Date: 2019-12-20
唯品会(广州)软件有限公司
View PDF7 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] On the one hand, each database corresponds to a connection pool. If the maximum number of connections in each connection pool is set to 20, but when there are hot and cold data in the 8 databases of the same database instance, resulting in a large difference in visits at different times, The connection pool with a large amount of access is not enough connections, while the connection pool with a small amount of access has idle connections that cannot be reused, resulting in waste of resources
[0005] On the other hand, each connection pool has some fixed background threads to do idle connection checks, create new connections, close connections and other maintenance operations. If each connection pool has 3 threads, then each application will have 128* 3 = 384 threads, and most operations to maintain connections can be completed with only a small number of threads, resulting in the connection pool wasting a lot of system resources of the application and reducing the service capability of the application

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Distributed database connection method and device
  • Distributed database connection method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0039] It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

[0040] Such as figure 1 As shown, the first embodiment of a distributed database connection method of the present invention is shown. The distributed database connection method of this embodiment includes:

[0041] Step S10, grouping multiple database instances, wherein each group of database instances includes at least one database, and configuring a connection pool for database sharing of all database instances;

[0042] The database connection is a very critical and limited resource. If the database connection is opened and closed repeatedly, a large amount of system resources of the database will be seriously wasted, and at the same time, the access efficiency of the database will be reduced. An efficient management method for database connections can significantly reduce the consumption of system resources by t...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention discloses a database connection method, comprising the steps of grouping a plurality of database embodiments, among which, each database embodiment comprises at least one database, and configuring a connection pool for sharing a database of all database embodiments; setting a specified thread of the connection pool to run operation of idle connection inspection and returning an idle connection to the client terminal based on the request and operation result of the idle connection inspection while receiving a request for application for connection with the connection pool from the client terminal. The invention further discloses distributed database connection device. The distributed database connection method and device realizes one connection pool shared by a plurality of databases, reduces thread quantity of connection pool and saves system resources.

Description

technical field [0001] The invention relates to the technical field of database management, in particular to a distributed database connection method and device. Background technique [0002] The traditional database connection pool technology effectively reduces the consumption of database system resources and improves the access efficiency of the database. However, with the rapid development of Internet technology, the number of visits and data volume of the database has grown explosively, resulting in the database being unable to meet the demand. The distributed database developed based on the open source database can effectively solve this problem. A group of databases to distribute database access and data storage. [0003] In order to take into account the investment of as little database server as possible in the early stage, and reduce the cost of database splitting and smoother upgrade after the database access volume is further increased in the future, a large num...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Patents(China)
IPC IPC(8): G06F16/25G06F16/27
CPCG06F16/25G06F16/27
Inventor 王军伟宋威张学诚刘璟宇韩国忠何涛余倩
Owner 唯品会(广州)软件有限公司
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products