Monomer application architecture and implementation method thereof
By adopting the intelligent cache strategy in the single application architecture, including the cache district and active cache, the limitations of cache update strategies in the traditional monomer application architecture have been solved, which significantly improves the performance and response speed of the system.
Patent Information
- Application Number
- CN202411907269.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When traditional single-unit application architecture faces complex business scenarios and large-scale data processing, there are limitations of cache update strategies, resulting in system performance degradation and slowdown in response speed.
Adopt intelligent caching strategies, including cache partitioning strategies and active caching strategies. The cache partitioning strategy performs structural isolation by partitioning the caches of different functional modules; the active caching strategy updates the cached data in real time by monitoring the change log of the database and combining it with the message queue.
Effectively improve the overall efficiency and response speed of the system, solve the limitations of traditional cache update strategies, and improve the performance and user experience of the system.
Smart Images

Figure CN119356644A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of application architecture, and in particular to a monolithic application architecture and an implementation method thereof. Background Art
[0002] In the field of modern software development, a reasonable architecture design is of irreplaceable importance to ensure the stability, scalability and maintainability of the system. However, the traditional monolithic application architecture has gradually revealed its inherent limitations when dealing with increasingly complex business scenarios and large-scale data processing.
[0003] Compared with the microservice architecture, the monolithic architecture has some obvious limitations, which are mainly reflected in the following aspects: 1. Large executable files drag down performance: In a monolithic architecture, as more and more functions are accumulated, the size of a single executable file will continue to increase. This leads to a gradual decline in the performance of deploying and running this single huge application.
[0004] 2. Average cache performance: In a monolithic architecture, the same cache is usually used to store the results of all functional modules. This cache strategy may make the cache results relatively complex and may generate unnecessary cache items. Since all functional modules share the same cache, this may cause cache pollution and reduce cache hit rate, which in turn affects the performance of the system. Summary of the invention
[0005] In view of the current deficiencies, the present invention provides a monolithic application architecture and an implementation method thereof, which can effectively solve the limitations of the traditional monolithic architecture cache update strategy and improve the overall efficiency and response speed of the system.
[0006] To achieve the above object, the embodiments of the present invention adopt the following technical solutions: A method for implementing a monolithic application architecture, wherein the monolithic application architecture includes a front end, a back end, and business services, and the implementation method includes the following steps: The front end receives the request and sends it to the back end; The backend performs business services according to the request and executes the business logic corresponding to the request to obtain the result; Among them, during the execution of business services, the business is executed through dynamic module loading, and the cache data is dynamically adjusted through intelligent cache strategies; The business service encapsulates the result into a response message and returns the result to the front end through the back end.
[0007] According to one aspect of the present invention, the intelligent cache strategy includes: a cache partition strategy and an active cache strategy.
[0008] According to one aspect of the present invention, the cache partitioning strategy includes: partitioning caches of different functional modules to perform structural isolation.
[0009] According to one aspect of the present invention, the cache partitioning strategy includes: creating an independent cache space for each functional module or business domain, each cache space having its own cache strategy, cache invalidation mechanism and cache data structure.
[0010] According to one aspect of the present invention, the active caching strategy includes: updating cache data in an active caching manner, specifically, synchronizing database changes to the cache in real time by monitoring the change log of the database in combination with the message queue.
[0011] According to one aspect of the present invention, executing services through dynamic module loading includes: implementing dynamic loading and unloading of modules by using Java's dynamic loading mechanism and OSGi framework.
[0012] A monolithic application architecture includes a front end, a back end and business services. The monolithic application architecture also includes: a dynamic module management unit and a storage layer access unit. The dynamic module management unit is used to implement business execution through dynamic module loading during business service execution. The storage layer access unit is used to dynamically adjust cache data through an intelligent cache strategy when a storage layer needs to be read or written during business service execution.
[0013] According to one aspect of the present invention, the monolithic application architecture includes an infrastructure unit for providing infrastructure support for the front-end, back-end and business services.
[0014] According to one aspect of the present invention, the infrastructure unit includes: a service discovery and registration module, a log and monitoring module, a configuration center module and a security module.
[0015] According to one aspect of the present invention, the front end and the back end are connected and communicated via an Nginx gateway.
[0016] Advantages of the present invention: Modularity and dynamic loading mechanism: The system realizes the hot-swap function of modules by dynamically loading modules, thereby greatly improving the flexibility and scalability of the system.
[0017] Introduction of intelligent cache strategy: Dynamically adjust cache data through cache partitioning and active cache strategy, effectively improving system performance and user experience.
[0018] The technical solution of the present invention mainly lies in the combined application of cache partitioning and active caching, which improves the performance and real-time performance of the cache system by isolating the caches of different functional modules in structure and adopting active caching strategy to update the cache in real time. This innovative mechanism can effectively solve the limitations of traditional cache update strategies and improve the overall efficiency and response speed of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A schematic diagram of a method for implementing a monolithic application architecture according to Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of a single application architecture described in Example 2 of the present invention. DETAILED DESCRIPTION
[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0022] Embodiment 1
[0023] like Figure 1 and Figure 2 As shown, a method for implementing a monolithic application architecture, wherein the monolithic application architecture includes a front-end, a back-end, and business services, and the implementation method includes the following steps: Step S1: The front end receives the request and sends it to the back end; First, develop the front-end of the monolithic application architecture. In front-end development, users initiate various requests by interacting with the front-end interface.
[0024] These requests can include browsing web pages, submitting forms, and performing various other interactive operations. Specifically, when users want to browse the web, they can send a request to the server to obtain the corresponding page content by clicking a link on the page or manually entering the URL. In the case where users need to submit a form, they can fill in the necessary information on the front-end interface, such as entering text, selecting drop-down menu options, etc., and then click the submit button to send this data to the server for further processing. In addition, users can also interact with the front-end interface in a variety of ways, such as clicking buttons, selecting drop-down menus, and entering text boxes, thereby initiating various different requests. These requests will eventually be sent to the server, which will process the request accordingly based on the specific content of the request and return the processing results to the front-end to be displayed to the user.
[0025] In actual applications, an Nginx gateway is set between the front-end and the back-end. When a user initiates a request at the front-end, the request will first reach the Nginx gateway. Nginx is a high-performance and widely used reverse proxy server, which is mainly responsible for receiving various requests from front-end users or clients. Through its flexible and powerful configuration files, Nginx can efficiently distribute these requests to the corresponding back-end services according to pre-set rules. These rules can include but are not limited to matching based on multiple conditions such as domain name, URL path, request method, HTTP header information, etc., so as to achieve complex load balancing, cache processing, static resource services and other functions. In this way, Nginx can not only effectively manage traffic, but also provide functions such as load balancing and caching static resources, thereby improving the performance and reliability of the entire system. Specifically, after receiving the front-end request, the Nginx gateway will parse and match it according to the rules in the configuration file. These rules can be matching conditions based on domain name, URL path, request method, HTTP header information, etc. Once the match is successful, Nginx will forward the request to the specified back-end service according to the instructions in the configuration file. Backend services can be multiple applications running on different servers. Nginx distributes requests evenly to these backend services through the load balancing strategy in the configuration file, thereby avoiding overload of a single service. In addition, Nginx can also cache static resources such as images, CSS files, and JavaScript files to reduce the load of backend services and improve response speed. Through these mechanisms, the Nginx gateway can not only effectively manage frontend requests, but also improve the overall performance and reliability of the system.
[0026] Step S2: The backend performs business service according to the request and executes the business logic corresponding to the request to obtain the result; Among them, during the execution of business services, the business is executed through dynamic module loading, and the cache data is dynamically adjusted through intelligent cache strategies; Specifically, the backend in step S2 performs the business service according to the request and executes the business logic corresponding to the request to obtain the result, which includes the following process: Step S21: During the process of back-end processing the request, the back-end service will first receive the request sent by the front-end. When the request reaches the back-end service, the system will immediately start a series of processing processes.
[0027] First, the backend service will carefully analyze the URL, parameters, and other relevant information in the request to determine which specific business service should handle the request. This step usually includes the routing of the request, that is, correctly forwarding the request to the corresponding business service module. To achieve this goal, the backend service will accurately deliver the request to the correct business service according to the preset routing rules and logic. In addition, in order to ensure the security of the system and the integrity of the data, the backend service will also perform identity authentication. The purpose of this operation is to confirm that the initiator of the request has a legitimate identity and corresponding permissions to prevent unauthorized access and operation. Authentication usually involves checking the authentication information in the request, such as API keys, tokens, or user credentials. Only authenticated requests can continue to be processed. At the same time, security checks are also an indispensable link. The backend service will perform various security checks to prevent potential malicious attacks and data leakage risks. These security checks may include preventing common network attack methods such as SQL injection, cross-site scripting attacks (XSS), and cross-site request forgery (CSRF). Through these comprehensive processing measures, the backend service can effectively distribute requests to the correct business service and ensure the security and reliability of the entire processing process. During the entire processing process, the backend service will also record detailed log information for problem tracking and performance monitoring. These log information includes the time the request was received, the processing time, the processing results, and any exceptions or errors that may have occurred. By analyzing these logs, the development and operation and maintenance teams can promptly discover and solve problems in the system, optimize system performance, and improve user experience. In short, in the process of processing requests, the backend service must not only ensure that the request is correctly routed to the corresponding business service, but also ensure the security and reliability of the entire processing process. Through comprehensive measures such as identity authentication, security checks, and logging, the backend service can effectively ensure the stable operation of the system and the security of data.
[0028] Step S22: After receiving the request, the business service module will perform a series of detailed operations, including in-depth analysis and judgment of the type and content of the request; In the process of business service processing requests, the backend system plays a vital role. When the backend system receives the request data sent by the frontend, it will be responsible for passing the data to the business service module responsible for processing the business. After receiving the request, the business service module will perform a series of detailed operations, including in-depth analysis and judgment of the type and content of the request. This process is to ensure that the correct business logic can be executed to meet the needs of the frontend.
[0029] Step S23: during the execution of the business service, the business is executed by dynamic module loading; Specifically, the dynamic module loading and unloading functions are implemented through the dynamic module management unit to realize the business logic. Business logic may involve various complex calculations and analyses of data to extract valuable information or generate specific reports. These operations are essential to ensure the smooth progress of the business. In the process of processing requests, the business service module may also need to access external services or systems to obtain necessary data or perform certain specific operations. Such operations of accessing external services may include calling third-party APIs, accessing interfaces of other systems, etc. In this way, business services can make full use of external resources and improve the efficiency and quality of processing requests. In short, in the process of business service processing requests, the back-end system and business service module will comprehensively consider the type and content of the request and execute the corresponding business logic. This includes not only the processing, calculation and analysis of data, but also a variety of operations such as accessing external services. Through these comprehensive operations, business services can comprehensively and efficiently process various requests to ensure the smooth progress of the business.
[0030] Among them, the dynamic module management unit realizes the dynamic loading and unloading functions of modules by making full use of the dynamic loading mechanism provided by the Java language and the powerful functions of the OSGi framework. This process mainly relies on the ClassLoader class in Java, which is a core class dedicated to loading class files. The working principle of ClassLoader is to load class files into the Java virtual machine (JVM) and generate corresponding Class objects. In this way, new class files can be dynamically loaded during the operation of the application, and the functions provided by these classes can be used immediately without restarting the entire application. This dynamic loading mechanism greatly improves the flexibility of the application, and the application can be expanded and updated without interrupting the service. Therefore, the application not only has better flexibility, but also greatly improves its maintainability, making system upgrades and function expansions more convenient and efficient. Specifically, the core of dynamic module management lies in its ability to dynamically add, remove or replace modules at runtime without affecting the stability and availability of the entire system. This capability enables the system to respond to various changes more flexibly, such as adding new functional modules, fixing known vulnerabilities or optimizing the performance of existing modules. Through dynamic module management, developers can quickly perform system maintenance and upgrades without affecting user use, thereby improving system reliability and user satisfaction. In addition, dynamic module management also brings the advantages of modular design. By breaking down the application into independent modules, each module can be independently developed, tested and deployed, which not only improves development efficiency but also reduces system complexity. Modular design reduces the coupling between modules, facilitates team collaborative development, and also facilitates future maintenance and expansion. Each module can focus on implementing specific functions, making the architecture of the entire application clearer and easier to understand. In short, dynamic module management realizes dynamic loading and unloading of modules by utilizing the powerful functions of Java's ClassLoader class and OSGi framework, greatly improving the flexibility and maintainability of the application. This mechanism not only makes system upgrades and functional expansions more convenient and efficient, but also brings the advantages of modular design, improving development efficiency and system reliability.
[0031] Step S24: dynamically adjusting cache data through intelligent cache strategy during business service execution; The business logic in the execution process of business services may include but is not limited to the processing and calculation of data. For example, the business service module may need to perform various operations on the database, such as query, update, insert, etc., to obtain or modify the required data. Inevitably, it involves reading and writing operations on the database or other storage devices. In order to complete these operations, the business service will send the data to be processed to the storage layer. After receiving this data, the storage layer will perform corresponding database queries, data updates or transaction operations according to the request of the business service. These operations may include but are not limited to inserting new data, modifying existing data, deleting data or retrieving data. In this way, the business service can effectively interact with the storage layer to ensure the correct reading and writing of data, thereby supporting the smooth execution of business logic. Specifically, when the business service needs to operate on the data, it will build a data request, which contains the necessary information, such as the type of operation to be performed, the data table involved, the specific fields, and the conditions of the operation. Then, this request will be sent to the storage layer. After receiving the request, the storage layer will parse this information and perform the corresponding database operation according to the specific content of the request. For example, if the business service needs to insert a new record, the storage layer will insert the record into the specified database table; if the existing data needs to be modified, the storage layer will find the corresponding record according to the provided conditions and update its field value; if the data needs to be deleted, the storage layer will find the qualified record and delete it; if the data needs to be retrieved, the storage layer will retrieve the qualified data from the database according to the query conditions and return the result to the business service. Through this mechanism, the business service can interact with the storage layer efficiently to ensure the accuracy and consistency of the data. At the same time, this interaction method also supports the smooth execution of business logic, allowing business services to flexibly handle various data operations according to actual needs. Whether it is a simple data query or a complex transaction processing, the storage layer can provide stable and reliable support to ensure the efficient operation of the entire business system.
[0032] In this embodiment, the business logic implementation of access to the storage layer is to dynamically adjust the cache data through an intelligent cache strategy, and the intelligent cache strategy specifically includes: cache partition strategy and active cache strategy; the cache partition strategy includes: structurally isolating the cache partitions of different functional modules; the cache partition strategy includes: creating an independent cache space for each functional module or business domain, and each cache space has its own cache strategy, cache invalidation mechanism and cache data structure.
[0033] In the design of intelligent cache system, the cache partition strategy is a very effective method. The core idea of this strategy is to structurally isolate the caches of different functional modules to prevent them from interfering with each other. Specifically, this strategy is usually implemented by creating an independent cache space for each functional module or business domain. Each cache space has its own cache strategy, cache invalidation mechanism and cache data structure, which can ensure data isolation and consistency. Through cache partitioning, the cache data of each functional module or business domain is managed independently without interfering with each other. The benefits of doing so are obvious. First, it helps to improve the stability and reliability of the system. Since each cache space has its own cache strategy and invalidation mechanism, even if a module has a problem, it will not affect the normal operation of other modules. Secondly, cache partitioning can improve the performance of the system. Since each cache space is independent, the system can optimize the cache strategy in a targeted manner according to the characteristics and requirements of each module, thereby improving the cache hit rate and efficiency. In addition, cache partitioning can also simplify system maintenance and management. In a complex system, the cache data of each functional module is often very large and complex. Through cache partitioning, administrators can manage and maintain each cache space in a targeted manner without having to face the huge data of the entire system. This not only improves maintenance efficiency, but also reduces maintenance costs. In short, cache partitioning is a very effective strategy that can achieve cache isolation of different functional modules in the intelligent cache system, thereby improving the stability and performance of the system and simplifying the maintenance and management of the system. In this way, even in a complex system, the cache data of each functional module can be effectively managed and maintained. Cache partitioning not only helps to improve the overall performance of the system, but also ensures data isolation between modules to avoid potential conflicts and interference. In addition, cache partitioning can also provide better scalability for the system, because each cache space is independent and can be expanded as needed without affecting the operation of other parts. The implementation of this strategy enables the system to handle various requests more flexibly and efficiently when facing high concurrency and large data volume scenarios, thereby improving user experience and system availability.
[0034] In practical applications, the cache partitioning can be implemented through the following code example: class CacheManager: cacheSpaces = {} # cache area def addToCacheSpace(spaceName, key, value): cacheSpace = CacheManager.cacheSpaces.get(spaceName) if cacheSpace is None: cacheSpace = {} CacheManager.cacheSpaces[spaceName] = cacheSpace cacheSpace[key] = value def getFromCacheSpace(spaceName, key): cacheSpace = CacheManager.cacheSpaces.get(spaceName) return cacheSpace[key] if cacheSpace else None In this embodiment, the active cache strategy is a common data update and maintenance strategy in an intelligent cache system, which aims to ensure the real-time and validity of cached data. In order to achieve this goal, the intelligent cache system usually adopts an active cache method to update and maintain the data in the cache. The implementation method of this active cache is mainly to synchronize any changes in the database to the cache system in real time by monitoring the change log of the database in real time, combined with the message queue technology. In this way, the cache system can reflect the latest status in the database in a timely manner, thereby ensuring the accuracy and timeliness of the cached data. Specifically, when the data in the database changes, the system will generate a corresponding change log. The intelligent cache system will monitor these change logs in real time and pass these change events to the cache system through the message queue technology. After receiving these change events, the cache system will perform corresponding update operations on the data in the cache according to the event content. For example, if a data item in the database is updated, the cache system will synchronize the new value of the data item to the cache to ensure that the data in the cache is consistent with the data in the database. Similarly, if a data item in the database is deleted, the cache system will also delete the data item in the cache accordingly to avoid inconsistency between the data in the cache and the data in the database. Through this active caching strategy, the cache system can reflect the latest status in the database in real time, thereby ensuring the accuracy and timeliness of the cached data. This not only improves the response speed of the system, but also reduces the number of direct accesses to the database, thereby reducing the load pressure on the database. In addition, this strategy can also effectively solve the problem of inconsistency between cached data and database data, improving the reliability and stability of the system. In short, the active caching strategy plays a vital role in the intelligent caching system, ensuring the real-time and effectiveness of cached data.
[0035] In practical applications, the cache partitioning can be implemented through the following code example: # Define a database change listener class DatabaseChangeListener: def onDatabaseChange(self, changeEvent): changedData = parseChangeEvent(changeEvent) messageQueue.publish(changedData) # Define a message queue for cache data synchronization class MessageQueue: def publish(self, data): # Publish data to the queue pass # Define the cache manager class CacheManager: def updateCache(self, data): # Update the cache based on the data pass # Initialize components dbChangeListener = DatabaseChangeListener() messageQueue = MessageQueue() cacheManager = CacheManager() # Subscribe to database change events subscribeToDatabaseChanges(dbChangeListener) # Message Queue Consumer def onMessageReceived(data): # Receive data from the message queue cacheManager.updateCache(data) #Simulate database change events def simulateDatabaseChange(): #Simulate data changes in the database and trigger the database change listener pass #Simulate message queue processing def simulateMessageQueueProcessing(): #Simulate the data in the message queue to be consumed pass # Main logic if __name__ == "__main__": # Simulate database changes simulateDatabaseChange() #Simulate message queue processing and update cache simulateMessageQueueProcessing() Step S3: The business service encapsulates the result into a response message and returns the result to the front end through the back end.
[0036] After completing step S2 and obtaining the processing result, the business service will encapsulate the processing result to form a detailed response message. This response message not only contains the processing result, but also includes status code, error information and other related contents. These contents not only help the front end understand the specific situation of the processing result, but also help the front end to perform more accurate error processing and user prompts. Subsequently, this detailed and comprehensive response message is passed back to the front end through the back-end system. After receiving this response message, the front end will perform corresponding processing according to the information contained therein. If the response message contains the result of successful processing, the front end will further parse and process the data, and then update the user interface and display it to the user for viewing; in this way, the user can see the processing result in time and make corresponding decisions or adjustments. If the response message contains error information or abnormal status code, the front end will perform corresponding error processing or prompt operations based on this information so that the user can understand the current situation and take corresponding measures. In this way, the user can get feedback in time, whether it is success or failure, can clearly know the processing result of the system, so as to make corresponding decisions or adjustments. This mechanism ensures that users can get timely and accurate feedback when using the system, improving user experience and system availability.
[0037] Embodiment 2
[0038] like Figure 2As shown, a monolithic application architecture includes a front-end, a back-end and business services. The monolithic application architecture also includes: a dynamic module management unit and a storage layer access unit. The dynamic module management unit is used to implement business execution through dynamic module loading during the business service execution process. The storage layer access unit is used to dynamically adjust cache data through an intelligent cache strategy when a read or write operation is required on the storage layer during the business service execution process.
[0039] In actual applications, in the monolithic application architecture described above, an infrastructure unit is included. The main responsibility of this infrastructure unit is to provide the necessary support and resources for the different parts of the entire application. Specifically, the infrastructure unit is responsible for providing comprehensive infrastructure support for the front-end system, back-end system, and business service layer. This means that it covers all aspects from hardware resources, network connections to software environment and middleware services to ensure that the entire application can run efficiently and stably. In this way, the infrastructure unit provides a solid foundation for the display of the front-end user interface, the implementation of back-end data processing and business logic, thereby ensuring the smooth operation of the entire application architecture.
[0040] In actual applications, the infrastructure unit covers multiple key components to ensure the efficient operation and security of the system. Specifically, these components include service discovery and registration module, log and monitoring module, configuration center module and security module. The main function of the service discovery and registration module is to help the various service components in the system to identify and communicate with each other. Through this module, each service can dynamically register its own information at runtime and discover the existence of other services. In this way, the system can achieve efficient service calls and load balancing, thereby improving overall performance and reliability. The log and monitoring module is responsible for collecting and analyzing various log information and monitoring data during the operation of the system. By monitoring the operating status of the system in real time, this module can help administrators quickly discover and solve potential problems and ensure the stability and availability of the system. At the same time, log information can also be used for subsequent problem tracking and performance optimization. The configuration center module provides a centralized configuration management solution for the system. Through this module, administrators can uniformly manage and update various configuration information in the system, and each service component can dynamically obtain the latest configuration. This not only improves the efficiency of configuration management, but also enhances the flexibility and scalability of the system. The security module focuses on protecting the security of the system. It includes a variety of security mechanisms, such as authentication, authorization, encryption and anti-attack measures. Through these mechanisms, the system can effectively prevent unauthorized access and various security threats, ensuring the security and integrity of data. The various modules of these infrastructure units work together to provide a solid guarantee for the stable operation and security of the system.
[0041] In actual applications, the front end and the back end are connected and communicated through the Nginx gateway.
[0042] Advantages of the present invention: The core concept of the present invention is to skillfully combine cache partitioning technology and active cache strategy, and to achieve optimal allocation of cache resources by structurally isolating the caches of different functional modules. This partitioning method not only helps to reduce cache pollution, but also improves the cache hit rate. At the same time, the active cache strategy can dynamically update the cache content in real time according to system requirements and data access patterns, ensuring the timeliness and relevance of cache data.
[0043] The implementation of this innovative mechanism can effectively overcome many limitations of traditional cache update strategies. For example, traditional passive cache strategies often rely on fixed update mechanisms and cannot flexibly cope with complex and changing application scenarios, resulting in low cache efficiency and slow system response speed. The present invention, through an active cache strategy, can intelligently adjust the cache content according to actual application requirements, thereby significantly improving the performance and real-time performance of the cache system.
[0044] Specifically, the active cache strategy can dynamically determine which data should be cached and which data should be eliminated based on factors such as data access frequency, access mode, and system load. This intelligent cache management method not only improves cache utilization, but also reduces unnecessary data transmission, thereby reducing the overall latency of the system. In addition, the introduction of cache partitions prevents cache data between different functional modules from interfering with each other, further improving the stability and reliability of the system.
[0045] In summary, the present invention not only solves the limitations of traditional cache strategies through the organic combination of cache partitioning and active cache strategy, but also significantly improves the overall efficiency and response speed of the system, providing new ideas and methods for the design and optimization of cache systems.
[0046] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with the art within the technical scope disclosed in the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for implementing a monolithic application architecture, wherein the monolithic application architecture includes a front-end, a back-end, and business services, characterized in that: The implementation method comprises the following steps: The front end receives the request and sends it to the back end; The backend performs business services according to the request and executes the business logic corresponding to the request to obtain the result; Among them, during the execution of business services, the business is executed through dynamic module loading, and the cache data is dynamically adjusted through intelligent cache strategies; The business service encapsulates the result into a response message and returns the result to the front end through the back end.
2. The method for implementing a monolithic application architecture according to claim 1, characterized in that: The intelligent cache strategy includes: a cache partition strategy and an active cache strategy.
3. The method for implementing a monolithic application architecture according to claim 2, characterized in that: The cache partitioning strategy includes: partitioning the caches of different functional modules to perform structural isolation.
4. The method for implementing a monolithic application architecture according to claim 3, characterized in that: The cache partitioning strategy includes: creating an independent cache space for each functional module or business domain, each cache space having its own cache strategy, cache invalidation mechanism and cache data structure.
5. The method for implementing a monolithic application architecture according to claim 2, wherein: The active cache strategy includes: updating cache data in an active cache manner, specifically, synchronizing database changes to the cache in real time by monitoring the change log of the database in combination with the message queue.
6. The method for implementing a monolithic application architecture according to any one of claims 1 to 5, characterized in that: The execution of services through dynamic module loading includes: implementing dynamic loading and unloading of modules by using Java's dynamic loading mechanism and OSGi framework.
7. A monolithic application architecture, including a front-end, a back-end and business services, characterized in that: The monolithic application architecture also includes: a dynamic module management unit and a storage layer access unit. The dynamic module management unit is used to implement business execution through dynamic module loading during the business service execution process. The storage layer access unit is used to dynamically adjust cache data through an intelligent cache strategy when a read or write operation is required on the storage layer during the business service execution process.
8. The monolithic application architecture according to claim 7, characterized in that: The monolithic application architecture includes an infrastructure unit for providing infrastructure support for the front-end, back-end and business services.
9. The monolithic application architecture according to claim 8, characterized in that: The infrastructure unit includes: a service discovery and registration module, a log and monitoring module, a configuration center module and a security module.
10. The monolithic application architecture according to claim 7, characterized in that: The front end and the back end are connected and communicated via the Nginx gateway.
Citation Information
Patent Citations
Cache management method and device
CN108153890A
Data caching system and method
CN109614404A
Cache data synchronization method, server, application system and storage device
CN109800272A
Request processing method, device and equipment and computer readable storage medium
CN111083219A
Dynamic page caching method, electronic equipment, vehicle and storage medium
CN116842292A