Temporary storage is a technology in developing software to temporarily store application resources, and data in a nearby location is accessible for its effective retrieval when necessary. In general, resources or data that are used repeatedly but often do not change good candidates for temporary storage in software design. Temporary storage is performed to achieve many benefits in the software system such as
- Reducing cumin in response to the request
- Reducing the number of network calls and thus using a lower network frequency range
- Reducing the chances of failure in the software system by serving data from cache instead of making a call to the actual back interface system
There are many articles in the web that talk about temporary storage and a different implementation strategy. This article does not repeat these in another way. Instead, this article provides a comprehensive image of a different type of cache that we implement in a large software system, from a conceptual standpoint how we accomplish this for all types and how it is usually done in a system that is home to be hosted in a local devices in exchange for how this is done in modern cloud platforms.
Public store storage storage
The graph below (graph 1) is the structure of the model web application hosted at the Foundation’s local data center. The graph 2 represents a specific type of cache that each component of architecture contributes to the implementation of cache.
Before we start interpreting the above graph (graph 2), let’s first talk about the classification classification in the web application. It can be done based on two different dimensions – what is cache and where it is temporarily stored.
What is temporary?
- Application Supplier – By temporary storage of application resources, we mean primarily fixed contents such as CSS and JavaScript, photos, etc. that are used to design the appearance and appearance of a web page. The application supplier also includes media files despite sound and video.
- Application data – according to the storage of application data, we mean storing the interim storage data found in the first place in the rear interface databases of the application
Where is a hideout?
-
In general, the application resources are temporarily stored at the infrastructure level (EG CDN, reverse agent, etc.) or on the customer side (such as a browser, device).
-
While the application data is temporarily stored on the side of the server (such as memory, disk or dedicated cache).
Let’s analyze the graph 2, which shows the different layers of temporary storage and explain how the traditional temporary storage of the application is performed. The typical web application consists of 3 different levels – web levels host the Fronting application that works in a web server, the level of background services works in the application server and the database level.
The traffic from the Internet through the web browser does not press the web server and the application server directly. The protection wall usually sits on the web app (WAF)/DDOS. This tool often also acts as a content delivery network (CDN). Traffic from the WAF/DDOS/CDN tool strikes the reverse agent of the network. The reverse agent layer acts as an interface to accept all traffic from the Internet, and hides the identity of the actual back interface servers from the outside world where the application is turned on. The server of the reverse agent finally directs traffic to the appropriate background server based on the supplier’s path in the URL for order.
If the request from the browser is to apply the web, then the reversal of the agent layer redirects traffic to the web server. If the order is intended for the back interface service, traffic will be directed to the application server.
Storage of application resources
When the order is to provide a web page, fixed resources such as JavaScript and CSS, images used to present the web page in all three layers – reverse agent, CDN and browser. What can be stored temporarily and cannot be determined by various HTTP heads as specified by the web application such as the last/rate-rate, the control of the cache, etc.
When the browser submits another request for the same web page or to obtain a different web page that re -use some of the fixed assets (JavaScript, photos, CSS) for already accessible web, the browser first checks the assets if the assets are changed in the application or not (using the last/modified lens). If no change is found, the stored asset is temporarily used in the browser to present the web page. Otherwise, the browser submits an application to the application to download the updated origin. Once the browser is submitted to the back interface, the request is first intercepted by the CDN/DDOS/WAF layer. This layer does the exact same thing that the browser did, that is, it will be achieved whether the original copy of the asset is the same as the original in the background, if the answer is yes, the resource request will not be directed to the reverse agent but the return of the stored version from the supplier to the browser.
If the original is not temporarily stored in the CDN layer, the CDN layer does the same thing that the browser did to redirect the original request to the reverse agent layer. The reverse agent layer will be presented from the cache if it is not updated in the application, otherwise it will reach the background server to recover the new version of the original. Then the new version of the original is stored by the web server by all the three temporary storage layer – the reverse agent, CDN and the browser.
If the end user decides to clear the browser’s cache for some reason, then although the browser will communicate with the back interface to bring the original, the original will already be returned by CDN and/or the reverse agent instead of the backbone server. As a result, the final customer still tested the improved response time as the supplier is offered by some of the infrastructure layer on the source of the application instead of the actual background server. Needless to say, this also reduces the amount of traffic that strikes the actual background server.
The graph below (graph 3) shows the flow of application resources in different layers as shown above.
Temporary storage for application data
When we talk about the temporary storage of application data, this means usually storing cache that does not change frequently, and therefore it is a good filter for temporary storage to reduce the number of calls that go to the database. One of the good examples of this can be the list of countries or the list of countries in a country displayed on a web page. This is a type of data, the search schedule and can be stored safely after recovering it once to avoid calling the database every time for the mostly fixed data. Another example that we can think is the application of social media on the modern day where we may want to store the user’s home page extract so that when the user runs the home page, the user sees feeding the home page instantly instead of waiting for several seconds.
Even the appearance of cloud -based applications or the appearance of modern cache such as Memcrated, Redis applications, used to rely on the temporary storage of the session in the application server. This usually means that the data for cache will be in the user session that is created after logging in, but it will not be available for re -use during the next login.
Some applications such as Websphere had a separate temporary storage solution to circumvent the temporary storage of the session called Dynacache – a distributed map. DYNACACHE will allow the application to store cache as storing the value of unrelated keys. Websphere is used to keep this data in the server memory and also provide discharge data in a disk if necessary. I worked well due to the lack of a temporary storage tool in the modern era that we went through at that moment, but he had restrictions on the cache do not escape the restart of the server (unless it was discharged in the disk). There were also challenges to maintain the consistency of data in the cache in an assembled environment as each application server in the block will have its own version of the cache. Technically, there was a ruling to repeat the cache between the application servers in a group to address the consistency problem, but this was not easy to implement and will come at a cost of performance.
However, as shown in the 2nd graph above, storing cache data in the application server layer is one of the options for cache data on the side of the server. Databases and the appointment to the ORM relationship (Orna) such as Hibernate provides an option to store cache data using something called cache for inquiries. Data rules can the result of the result as well as the SQL query in full memory and serve the data from the memory as long as the data is not updated. To a large extent most common databases such as MySQL, Oracle, PostGRESQL, SQL Server, etc. supports the cache of the inquiry.
In modern era applications, temporary storage capacity on data has improved significantly with specialized storage techniques such as Redis or Memcrated. Moreover, the modern API gate layers that work as reverse agents (along with providing many other features such as synchronization, price reduction, etc.) also provide the ability to store data for API calls. Although API Gateway (for example APIGE) and a cache like Redis/Memcrated can be implemented in a local solution to store energy data, in fact, these tool groups are more popular for use in applications that work on cloud platforms (such as AWS, Azure etc.).
The next pair of the plans shows the use of API gate and the cache (for example Redis, Memcrated) for local applications as well as the hosted cloud.
Temporary storage strategies
When the combination of the database and the tool for temporary storage in architecture (joint scenario in modern era applications) is many technologies available for the implementation of temporary storage. There are no correct or wrong techniques because they all come with barters. Depending on the nature of the state of use, the right technique must be chosen.
- Timor storage – read the application from the cache, if the data is not available in the cache, the application reads from the database and update the cache. This is the temporary storage pattern that you mostly used for use cases that I have personally faced.
- Read through the cache – read the application from the cache and if the data is not available in the cache, the temporary storage tool reads from the database, update the temporary storage memory and returns the response.
- Write through the cache – write applications in cache, Cache sends an acknowledgment immediately to reduce cumin in the customer’s response and write the data in an unsafe data to a database after that. This is a useful case that can be adopted for the application of social media where a post can be provided by a user to display other users with sub -access time. The actual operation of the data storage occurs in a continuous store (database) in an unequivocal way.
- Write the cache again – the data is written in the cache only. Immediately before the end of the cache (TTL data also known as TTL) is usually written in the database for stability. This technology can be used for a ride sharing system like Uber. In general in the ride sharing system, the car sends its current location every 30 seconds or so the contestant can get a site update in the actual time of the driver who is waiting for it. In this cache, the car site will only be updated in the cache and before the expiration memory ends, the site data will be written to the database. This cache allows the user/contestant to recognize the driver’s website immediately in the Uber app. If you fail in any reason, writing to the database leads to data loss. However, this is generally acceptable if the application does not have a website data history for a small interval (such as 5 minutes) in continuous storage.
conclusion
This concludes the comprehensive exploration of different types of temporary storage, which includes the place of storage in data, the contrasting curricula used in local applications against those modern, and the various technologies used in this field. With the development of technology, temporary storage storage strategies will continue to adapt, providing new ways to balance speed, expansion and consistency. Whether improving a small application or teaching large distributed systems, taking advantage of the effective storage effectively remains a major aspect of building high -performance solutions.
adxpro.online