cache ideas

In J2EE, there are many basic data tables - these tables are not frequently modified, added, deleted, but used very frequently

 

If we query the database every time we use these tables, the efficiency will become very low, so we often "cache" these data and put them in the static properties of a class, only the first time It will be queried when it is used, and the database will not be queried when it is used again.


In order to ensure the consistency of the data, every time we need to add, delete, and modify these basic tables, we need to update the "cache", so as to ensure that the data is accurate when using

 

Generally, in the code, a package (cache.util) is created, and the "cache" is placed under this package, which is convenient for unified management of a large amount of cache information.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327033882&siteId=291194637