CN112100554A - System and method for improving page response speed based on redis cache - Google Patents
System and method for improving page response speed based on redis cache Download PDFInfo
- Publication number
- CN112100554A CN112100554A CN202010817905.3A CN202010817905A CN112100554A CN 112100554 A CN112100554 A CN 112100554A CN 202010817905 A CN202010817905 A CN 202010817905A CN 112100554 A CN112100554 A CN 112100554A
- Authority
- CN
- China
- Prior art keywords
- data
- redis cache
- module
- persistent layer
- redis
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000004044 response Effects 0.000 title claims abstract description 22
- 238000000034 method Methods 0.000 title claims description 24
- 230000002085 persistent effect Effects 0.000 claims abstract description 43
- 230000002688 persistence Effects 0.000 claims abstract description 4
- 230000008569 process Effects 0.000 claims description 7
- 230000001960 triggered effect Effects 0.000 claims description 3
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
- G06F16/972—Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a system for improving page response speed based on Redis cache, which comprises a plurality of pages, a load balancing module, a Redis cache module, a data publishing component and a persistent layer database; the multiple pages are used for sending the data request to the load balancing module through an http protocol; the load balancing module is used for balancing the data requests of the front ends of the pages and sending the data requests to the Redis cache module through an http protocol; the Redis cache module is used for temporarily storing all or part of contents of the persistent layer database; the data publishing component is used for transmitting data between the Redis cache module and the persistence layer; the persistent layer database is used for storing data. The problem that the data access speed of the current Internet equipment is limited by the data access of the database is solved.
Description
Technical Field
The invention relates to the technical field of rapid data access, in particular to a system and a method for improving page response speed based on redis cache.
Background
With the development of internet technology and exponential growth of various terminal devices, more and more data access requests need to meet the requirement of high-speed response, while the traditional data access mode can not meet the requirement of high-speed data access, and the traditional data access and display mode is as follows:
the first step is as follows: inputting query elements and conditions;
the second step is that: directly accessing a bottom layer database by calling a middleware service or connecting a JDBC connection pool;
the third step: the service acquires data through directly connecting the database and returns the data;
the fourth step: the page is displayed to the user by receiving data returned by the service.
In the process, a large amount of time is consumed for accessing the underlying database, and the access becomes a bottleneck for meeting the high-speed response requirement of a user, so that a new framework is needed to meet the current internet data access requirement.
Disclosure of Invention
Aiming at the problem that the data access speed of the current internet equipment is limited by the data access of a database, the invention provides a system and a method for improving the response speed of a page based on a redis cache.
The invention discloses a system for improving page response speed based on Redis cache, which comprises a plurality of pages, a load balancing module, a Redis cache module, a data publishing component and a persistent layer database;
the multiple pages are used for sending the data request to the load balancing module through an http protocol;
the load balancing module is used for balancing the data requests of the front ends of the pages and sending the data requests to the Redis cache module through an http protocol;
the Redis cache module is used for temporarily storing all or part of contents of the persistent layer database;
the data publishing component is used for transmitting data between the Redis cache module and the persistence layer;
the persistent layer database is used for storing data.
Preferably, the load balancing module completes balancing of data request load of each page front end through a nginnx reverse proxy.
Preferably, the Redis cache module temporarily stores the content of the persistent layer database as a data table that needs to be accessed frequently, and the threshold of the frequency is set by a manager.
Preferably, the process of the data publishing component transmitting data between the Redis cache module and the persistent layer is as follows: and after the data of the Redis cache module is updated, writing the small table through a Redis trigger, and acquiring and synchronously transmitting the small table to a persistent layer by an application.
Preferably, when the Redis cache module responds to the load balancing module data request, if the request data is stored in the Redis cache of the Redis cache module, the data is directly accessed, if the Redis cache of the Redis cache module does not have the access data, the persistent layer data is directly accessed, and meanwhile, the data publishing component is notified to load the full-field data in the accessed persistent layer database to the Redis cache.
Preferably, the method for loading the data in the persistent layer database into the redis cache comprises: and loading each table in the persistent layer database as an access object into a redis memory base so as to access data atomically.
A method for improving page response speed based on a redis cache comprises the following specific operation processes:
the method comprises the following steps: a user requests data through page front-end operation;
step two: the load balancing module reasonably distributes access requests according to the received data operation requests of the front end of the page and the load balancing of the Nginx and sends the access requests to the distributed redis cache module for data access;
step three: if the redis cache module can access data through the redis cache, directly acquiring the data from the redis cache and returning the data, otherwise, directly accessing the data of the persistent layer database, and simultaneously informing the data publishing component to load the accessed data in the persistent layer database into the redis cache;
step four: if the front end of the page carries out data updating operation on the data, the redis cache data is preferentially updated, the notification data publishing component is triggered, the persistent layer database is synchronously updated, and consistency between the redis cache and the persistent layer database is ensured.
Compared with the prior art, the invention has the beneficial effects that:
after the system and the method for improving the page response speed based on the redis cache are adopted, the access speed of the data of the bottom database is greatly improved by fully utilizing the redis cache, the requirement of the current internet equipment on high-speed access of the data is met, the whole system can stably operate at a high speed, and the practicability of the system and the customer satisfaction degree are improved.
Drawings
FIG. 1 is a schematic diagram of a system architecture of a system for increasing a page response speed based on a redis cache according to the present invention.
FIG. 2 is a flowchart illustrating the operation of a method for increasing the response speed of a page based on a redis cache according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
The invention is described in further detail below with reference to the attached drawing figures:
referring to fig. 1, a system for improving page response speed based on a Redis cache includes a plurality of pages, a load balancing module, a Redis cache module, a data publishing component, and a persistent layer database;
the multiple pages are used for sending the data request to the load balancing module through an http protocol;
the load balancing module is used for balancing the data requests of the front ends of the pages and sending the data requests to the Redis cache module through an http protocol;
the Redis cache module is used for temporarily storing all or part of contents of the persistent layer database;
the data publishing component is used for transmitting data between the Redis cache module and the persistence layer;
the persistent layer database is used for storing data.
In specific implementation, the load balancing module completes the balancing of the data request load of the front end of each page through the Nginx reverse proxy.
In specific implementation, the Redis cache module temporarily stores the content of the persistent layer database into a data table which needs to be accessed at a high frequency, and the threshold value of the high frequency is set by a manager.
In specific implementation, the process of the data transmission between the Redis cache module and the persistent layer by the data publishing component is as follows: and after the data of the Redis cache module is updated, writing the small table through a Redis trigger, and acquiring and synchronously transmitting the small table to a persistent layer by an application.
In specific implementation, when the Redis cache module responds to the load balancing module data request, if the request data is stored in the Redis cache of the Redis cache module, the data is directly accessed, if the data is not accessed in the Redis cache of the Redis cache module, the data is directly accessed, and meanwhile, the data publishing component is notified to load the full-field data in the accessed persistent-layer database to the Redis cache.
In specific implementation, the method for loading the data in the persistent layer database into the redis cache comprises the following steps: and loading each table in the persistent layer database as an access object into a redis memory base so as to access data atomically.
Referring to fig. 2, a method for increasing a page response speed based on a redis cache specifically includes the following operation processes:
the method comprises the following steps: a user requests data through page front-end operation;
step two: the load balancing module reasonably distributes access requests according to the received data operation requests of the front end of the page and the load balancing of the Nginx and sends the access requests to the distributed redis cache module for data access;
step three: if the redis cache module can access data through the redis cache, directly acquiring the data from the redis cache and returning the data, otherwise, directly accessing the data of the persistent layer database, and simultaneously informing the data publishing component to load the accessed data in the persistent layer database into the redis cache;
step four: if the front end of the page carries out data updating operation on the data, the redis cache data is preferentially updated, the notification data publishing component is triggered, the persistent layer database is synchronously updated, and consistency between the redis cache and the persistent layer database is ensured.
According to the system and the method for improving the page response speed based on the redis cache, the access speed of the data of the bottom database is greatly improved by fully utilizing the redis cache, the requirement of the current internet equipment on high-speed access of the data is met, the whole system can stably operate at a high speed, and the system practicability and the customer satisfaction degree are improved.
The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes will occur to those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (7)
1. A system for improving page response speed based on a Redis cache is characterized by comprising a plurality of pages, a load balancing module, a Redis cache module, a data publishing component and a persistent layer database;
the multiple pages are used for sending the data request to the load balancing module through an http protocol;
the load balancing module is used for balancing the data requests of the front ends of the pages and sending the data requests to the Redis cache module through an http protocol;
the Redis cache module is used for temporarily storing all or part of contents of the persistent layer database;
the data publishing component is used for transmitting data between the Redis cache module and the persistence layer;
the persistent layer database is used for storing data.
2. The system for improving page response speed based on redis cache of claim 1, wherein: and the load balancing module completes the balance of the data request load of the front end of each page through the Nginx reverse proxy.
3. The system for improving page response speed based on redis cache of claim 1, wherein: the Redis cache module temporarily stores the content of the persistent layer database into a data table which needs to be accessed at a high frequency, and the threshold value of the high frequency is set by a manager.
4. The system for improving page response speed based on redis cache of claim 1, wherein: the process that the data publishing component transmits data between the Redis cache module and the persistent layer is as follows: and after the data of the Redis cache module is updated, writing the small table through a Redis trigger, and acquiring and synchronously transmitting the small table to a persistent layer by an application.
5. The system for improving page response speed based on redis cache of claim 1, wherein: when the Redis cache module responds to the data request of the load balancing module, if request data are stored in a Redis cache of the Redis cache module, the data are directly accessed, if no data are accessed in the Redis cache of the Redis cache module, the data in the persistent layer database are directly accessed, and meanwhile, the data publishing component is informed to load full-field data in the accessed persistent layer database to the Redis cache.
6. The system for improving page response speed based on redis cache of claim 2, wherein: the method for loading the data in the persistent layer database into the redis cache comprises the following steps: and loading each table in the persistent layer database as an access object into a redis memory bank.
7. A method for improving page response speed based on a redis cache is characterized in that: the method comprises the following specific operation processes:
the method comprises the following steps: a user requests data through page front-end operation;
step two: the load balancing module reasonably distributes access requests according to the received data operation requests of the front end of the page and the load balancing of the Nginx and sends the access requests to the distributed redis cache module for data access;
step three: if the redis cache module can access data through the redis cache, directly acquiring the data from the redis cache and returning the data, otherwise, directly accessing the data of the persistent layer database, and simultaneously informing the data publishing component to load the accessed data in the persistent layer database into the redis cache;
step four: if the front end of the page carries out data updating operation on the data, the redis cache data is preferentially updated, the notification data publishing component is triggered, the persistent layer database is synchronously updated, and consistency between the redis cache and the persistent layer database is ensured.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010817905.3A CN112100554A (en) | 2020-08-14 | 2020-08-14 | System and method for improving page response speed based on redis cache |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010817905.3A CN112100554A (en) | 2020-08-14 | 2020-08-14 | System and method for improving page response speed based on redis cache |
Publications (1)
Publication Number | Publication Date |
---|---|
CN112100554A true CN112100554A (en) | 2020-12-18 |
Family
ID=73754556
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010817905.3A Pending CN112100554A (en) | 2020-08-14 | 2020-08-14 | System and method for improving page response speed based on redis cache |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112100554A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112765221A (en) * | 2021-02-27 | 2021-05-07 | 中电万维信息技术有限责任公司 | Data retrieval method based on redis cache |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107734004A (en) * | 2017-09-26 | 2018-02-23 | 河海大学 | A kind of high concurrent SiteServer LBS based on Nginx, Redis |
CN109831536A (en) * | 2019-03-22 | 2019-05-31 | 成都六四三六五科技有限公司 | A kind of front end load balancing service degradated system and method |
CN110012098A (en) * | 2019-04-04 | 2019-07-12 | 浙江工业大学 | A kind of web high concurrent access process system and method |
CN110489696A (en) * | 2019-07-31 | 2019-11-22 | 上海艾融软件股份有限公司 | Buffering updating method, device and electronic equipment, storage medium |
-
2020
- 2020-08-14 CN CN202010817905.3A patent/CN112100554A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107734004A (en) * | 2017-09-26 | 2018-02-23 | 河海大学 | A kind of high concurrent SiteServer LBS based on Nginx, Redis |
CN109831536A (en) * | 2019-03-22 | 2019-05-31 | 成都六四三六五科技有限公司 | A kind of front end load balancing service degradated system and method |
CN110012098A (en) * | 2019-04-04 | 2019-07-12 | 浙江工业大学 | A kind of web high concurrent access process system and method |
CN110489696A (en) * | 2019-07-31 | 2019-11-22 | 上海艾融软件股份有限公司 | Buffering updating method, device and electronic equipment, storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112765221A (en) * | 2021-02-27 | 2021-05-07 | 中电万维信息技术有限责任公司 | Data retrieval method based on redis cache |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109145020A (en) | Information query method, from server, client and computer readable storage medium | |
US6523040B1 (en) | Method and apparatus for dynamic and flexible table summarization | |
CN105631035B (en) | Date storage method and device | |
CN101854378B (en) | Data operating method and data operating equipment | |
JPH06161957A (en) | Workstation | |
US20080249994A1 (en) | System and process for server side stateless data interchange | |
US10649964B2 (en) | Incorporating external data into a database schema | |
WO2019041670A1 (en) | Method, device and system for reducing frequency of functional page requests, and storage medium | |
CN109388351A (en) | A kind of method and relevant apparatus of Distributed Storage | |
CN112163001A (en) | High-concurrency query method, intelligent terminal and storage medium | |
CN101673217B (en) | Method for realizing remote program call and system thereof | |
CN107636655A (en) | Data are provided in real time to service(DaaS)System and method | |
CN115878245A (en) | Data processing method and device, electronic equipment and storage medium | |
CN112100554A (en) | System and method for improving page response speed based on redis cache | |
CN108038169A (en) | A kind of page display method and device | |
CN111638946A (en) | Request information hierarchical processing method and device | |
CN112035524A (en) | List data query method and device, computer equipment and readable storage medium | |
CN111464574B (en) | Calling, loading, registering and managing method and route, server, node and medium | |
CN111522850A (en) | Data object storage and query method, device, equipment and storage medium | |
CN102761617A (en) | Workflow queue server and workflow scheduling system and method | |
CN106446272B (en) | Method and apparatus for sending data | |
CN113779326A (en) | Data processing method, device, system and storage medium | |
US8990146B2 (en) | Systems and methods to provide server-side client based caching | |
CN112231129A (en) | Data proxy service method, server, storage medium and computing equipment | |
CN111125025A (en) | Metadata storage system, metadata storage method, metadata calling device and readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |