<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Caffeine on Anttu&#39;s Blog</title>
		<link>https://anTtutu.github.io/tags/caffeine/</link>
		<description>Recent content in Caffeine on Anttu&#39;s Blog</description>
		<generator>Hugo</generator>
		<language>zh-CN</language>
		
		
		
		
			<lastBuildDate>Mon, 11 Oct 2021 00:29:47 +0800</lastBuildDate>
		
			<atom:link href="https://anTtutu.github.io/tags/caffeine/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>caffeine和springcache</title>
				<link>https://anTtutu.github.io/post/2021-10-11-caffeine_springcache/</link>
				<pubDate>Mon, 11 Oct 2021 00:29:47 +0800</pubDate>
				<guid>https://anTtutu.github.io/post/2021-10-11-caffeine_springcache/</guid>
				<description>&lt;h2 id=&#34;前言&#34;&gt;前言&lt;/h2&gt;&#xA;&lt;p&gt;说到caffeine，一般会对比 google 家的 guava，这里只做浅析。&lt;/p&gt;&#xA;&lt;h3 id=&#34;缓存&#34;&gt;缓存&lt;/h3&gt;&#xA;&lt;p&gt;缓存分为本地缓存和远端缓存。&lt;br&gt;&#xA;常见的远端缓存有Redis，MongoDB；&lt;br&gt;&#xA;本地缓存一般使用map的方式保存在本地内存中。&lt;/p&gt;&#xA;&lt;p&gt;一般我们在业务中操作缓存，都会操作缓存和数据源两部分。&lt;br&gt;&#xA;如：put数据时，先插入DB，再删除原来的缓存；get数据时，先查缓存，命中则返回，没有命中时，需要查询DB，再把查询结果放入缓存中。&lt;br&gt;&#xA;如果访问量大，我们还得兼顾本地缓存的线程安全问题。&lt;br&gt;&#xA;必要的时候也要考虑缓存的回收策略。&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
