Hello, diggers.
Seven times technology project | everything may continue to ing Serverless essay is hot, before the technology project for the field of technology limited, we issue 8 will be no obvious areas of limit.
In this installment, we’ll talk about the benefits and problems of caching, how you use caching to solve problems, and what new problems it creates!
To go back to the original meaning of cache: a type of high-speed memory that is accessed faster than ordinary random access memory (RAM), usually using the expensive but faster SRAM technology rather than DRAM technology like system main memory. The setting of cache is one of the important factors for the high performance of all modern computer systems.
As you can see, the initial use of caching was at the system level, but as generations of engineers dig and practice caching has gradually moved into more ecological areas, such as: In the browser cache, the backend system of level 1, level 2 cache, such as MyBatis framework based on Redis build cache service and so on, even when the situation is poor in order to ensure the quality of the network the normal use of the APP, we will also for all of the API and cache, say from another aspect, the cache has become an essential part of the Internet ecosystem.
To sum up, caching is the best way to improve performance.
In the design and use of Cache, there are a variety of techniques and schemes. This paper introduces the most commonly used Cache design scheme by taking the Cache Aside update mode as an example. The main logic is to consider the actions of invalidation, hit and update.
Invalid: The application first obtains the data from the Cache. If it does not obtain the data, it retrives the data from the database and, after success, puts the data into the Cache. Hit: The application retrieves data from the Cache and returns the data. Update: first save data to the database, after successful, then disable the cache.
In this way, a simple caching service can be set up to provide the interface with the most efficient query speed. But here’s the question, my friends: is this really the perfect solution? We ask questions like this:
Why not update the cache after you write the database how to ensure that the cache hits how to ensure that the data is strongly consistent How to design the cache elimination strategy how to effectively scale the cache service how to design the maximum throughput system with the cache how to monitor the cache how to design the multilevel cache
Oh, thinking about these problems all of a sudden bald head, dig friends, gold jam’s hair is waiting for you to save! I hope you can actively participate in the technical essay of this issue. You can refer to the following technical topics:
How do you use caching to improve system performance in a real project? What are the problems with caching and how do you solve them? How do you use caching to solve front-end rendering problems when the network quality is poor
Participate in the way
The essay solicitation activity is open to all gold digger users. The participation methods are as follows:
Participate in active users please to “post title | 🏆 technology project issue 8 essay” title as writing content. When publishing the article, there is no restriction on the tag for this period of shooting, please select the corresponding technical classification and tag, but also need to attach the link of this essay campaign at the end of the article.
Format for:
- Those using the Nugget Markdown editor will copy the following directly after the article
[🏆 technology use and problems of the special issue 8 chat | cache] (https://juejin.cn/post/6909884662638706702/)Copy the code
-
Those of you who are using the Nugget Rich text editor will copy the following directly after the article
🏆 technology project issue 8 chat | magical function and problems of cache
Award setting
Again, we have plenty of prizes for this event:
-
🏆 First prize: The top 5 authors will get “Nugget Surrounding gift package”, a total of 5 authors.
-
💙 second prize: Among the articles participating in the activity, the authors of the top 5 articles with the highest number of likes will get “Gold Digging Enamel Cup + how MySQL Works: Understanding MySQL from the root”;
-
👏 third prize: the author of the article with the highest number of comments and interactions will get a “hat”;
-
🎉 new person encouragement award: we will randomly draw “gold nugget enamel cup” in the new person participating in the essay;
-
🐱 Participation Award: All writers who participate in writing and meet the requirements can get “three universal 40% discount codes of the whole booklet”, no limit on ranking.
-
The above awards cannot be won repeatedly (excluding the participation award), and the repeat will be postponed (if two of the awards are won at the same time, the award category with the highest ranking will be sorted according to the classification);
-
Overall dimension: content quality
Traffic support
All the participating articles that meet the requirements of the essay soliciting activities will get "popular recommendation on the home page of Nuggets", and have the chance to get recommended by channels such as official Weibo and wechat public account, so that more users can see your articles.Copy the code
Special thanks to
-
Thanks @kerwin for supporting this article.
-
Welcome all authors above LV3 to contact me on wechat: 229199157 and join the author recommendation group!