当前位置: 首页 > news >正文

响应式网站制作流程图免费入驻的卖货平台

响应式网站制作流程图,免费入驻的卖货平台,网站两边广告,注册网址域名多级缓存(亿级流量(并发)的缓存方案) 传统缓存的问题 传统缓存是请求到达tomcat后,先查询redis,如果未命中则查询数据库,问题如下: (1)请求要经过tomcat处…

多级缓存(亿级流量(并发)的缓存方案)

传统缓存的问题

传统缓存是请求到达tomcat后,先查询redis,如果未命中则查询数据库,问题如下:

(1)请求要经过tomcat处理,tomcat成为整个系统的瓶颈。
(2)redis缓存失效时,会对数据库产生冲击。(缓存雪崩等各个问题)

tomcat本身的缓存(并发)能力是不如redis的。

在这里插入图片描述

多级缓存

(1)多级缓存就是充分利用请求处理的每个环节,分别添加缓存,减轻tomcat压力,提升服务性能。
静态资源请求存入到浏览器客户端缓存,非静态数据进入到nginx服务器(此时的nginx为nginx的本地缓存,可编程将查询数据去访问redis中,不去请求tomcat),可将数据存入到业务nginx中。redis缓存未命中时,到达tomcat中可读取进程缓存来获得数据。tomcat进程缓存未命中,就到达
数据库。
(2)redis缓存失效时,(发生缓存雪崩等)可以使用tomcat进程(也称jvm进程缓存)缓存做缓冲,从而避免了全部访问数据库。
(3)业务nginx内部需要编写对redis的访问和对tomcat进程缓存的访问。
(4)业务nginx通常作为集群的形式

在这里插入图片描述

jvm进程缓存

使用lua语言编写业务nginx的逻辑

缓存同步策略

缓存数据同步的常见方式

(1)设置有效期:给缓存设置有效期,到期后自动删除。再次查询时更新。
缺点:时效性差,缓存过期前可能不一致
优点:简单、方便 ,适用于更新频率低,时效性要求低的业务

(2)同步双写:在修改数据库的同时,直接修改缓存

	优势:时效性强,强一致性缺点:业务代码中有侵入代码(更新缓存操作),耦合度高;适用于对一致性和时效性较高的缓存数据。

(3)异步通知:修改数据库时发送事件通知,相关服务监听到通知后修改缓存数据
优点:低耦合,可以同时通知多个缓存服务
缺点:时效性一般(其实也就够了,mq收到消息之间只是ms级别);适用于有多个服务需要同步。

<1> 基于mq的异步通知(仍需要在代码中进行操作mq)
在这里插入图片描述

<2> 基于Canal的异步通知(通过监听数据库的变化)
在这里插入图片描述

canal监听原理

canal把自己伪装成mysql的一个slave节点,从而监听master的binary log变化,再把得到的变化信息通知给Canal的客户端,从而完成对其他数据库的同步。

在这里插入图片描述

在这里插入图片描述

项目(在默认tomcat容器中)编写监听Canal客户端

引入依赖

在这里插入图片描述
编写配置:

canal:destination:test   # canal实例名称,要跟canal-server运行时设置的destination一致。server:安装ip:端口号    # canal地址

编写监听器

实现EntryiHandler接口,重写方法(监听到数据库的新增、修改、删除会执行对应的方法)
在这里插入图片描述
编写指定的实体类Item(表和实体类之间的映射关系)

@Id : 声明表的逐渐
@Transient: 表示不是当前表的字段
@Column:当数据库和实体类字段名称不一致时编写
在这里插入图片描述


文章转载自:
http://ninepenny.rmyt.cn
http://pyretology.rmyt.cn
http://fowling.rmyt.cn
http://businesswoman.rmyt.cn
http://mortling.rmyt.cn
http://counterproposal.rmyt.cn
http://interterm.rmyt.cn
http://verger.rmyt.cn
http://directorate.rmyt.cn
http://feu.rmyt.cn
http://antineutrino.rmyt.cn
http://rassling.rmyt.cn
http://shovelbill.rmyt.cn
http://lastly.rmyt.cn
http://patricentric.rmyt.cn
http://emulsoid.rmyt.cn
http://woodiness.rmyt.cn
http://kibbutz.rmyt.cn
http://dipteran.rmyt.cn
http://shunpike.rmyt.cn
http://inalienability.rmyt.cn
http://sabaoth.rmyt.cn
http://rajab.rmyt.cn
http://louis.rmyt.cn
http://sken.rmyt.cn
http://pianette.rmyt.cn
http://transportability.rmyt.cn
http://wealthily.rmyt.cn
http://shameful.rmyt.cn
http://transcutaneous.rmyt.cn
http://unimodal.rmyt.cn
http://tumult.rmyt.cn
http://jaculate.rmyt.cn
http://amidin.rmyt.cn
http://semidemisemiquaver.rmyt.cn
http://bothnia.rmyt.cn
http://octyl.rmyt.cn
http://shiva.rmyt.cn
http://tach.rmyt.cn
http://squirish.rmyt.cn
http://laudator.rmyt.cn
http://lisztian.rmyt.cn
http://faecula.rmyt.cn
http://haemagglutinin.rmyt.cn
http://racker.rmyt.cn
http://spinster.rmyt.cn
http://acidulous.rmyt.cn
http://disablement.rmyt.cn
http://mopy.rmyt.cn
http://pothead.rmyt.cn
http://radiocompass.rmyt.cn
http://confessionary.rmyt.cn
http://wisdom.rmyt.cn
http://phytocide.rmyt.cn
http://drivership.rmyt.cn
http://bellona.rmyt.cn
http://extracurriculum.rmyt.cn
http://smice.rmyt.cn
http://effervesce.rmyt.cn
http://eisteddfod.rmyt.cn
http://lob.rmyt.cn
http://anticommute.rmyt.cn
http://kudu.rmyt.cn
http://fifi.rmyt.cn
http://thrift.rmyt.cn
http://wigan.rmyt.cn
http://telefoto.rmyt.cn
http://fissipedal.rmyt.cn
http://foundry.rmyt.cn
http://moonflight.rmyt.cn
http://foolery.rmyt.cn
http://pentobarbital.rmyt.cn
http://impudent.rmyt.cn
http://scottice.rmyt.cn
http://piddock.rmyt.cn
http://goethite.rmyt.cn
http://tollie.rmyt.cn
http://ethnobotanist.rmyt.cn
http://qualificator.rmyt.cn
http://zakuski.rmyt.cn
http://acescent.rmyt.cn
http://tapi.rmyt.cn
http://incapacity.rmyt.cn
http://fustigate.rmyt.cn
http://loxodromically.rmyt.cn
http://autoclave.rmyt.cn
http://semihuman.rmyt.cn
http://calorescence.rmyt.cn
http://intuitivism.rmyt.cn
http://sonority.rmyt.cn
http://delicately.rmyt.cn
http://inthral.rmyt.cn
http://scopolamine.rmyt.cn
http://seropurulent.rmyt.cn
http://quinquecentennial.rmyt.cn
http://allopathist.rmyt.cn
http://ana.rmyt.cn
http://welcome.rmyt.cn
http://reprographic.rmyt.cn
http://superblock.rmyt.cn
http://www.dt0577.cn/news/67022.html

相关文章:

  • 桐柏网站建设全国疫情高峰感染高峰进度查询
  • 海南的论坛网站建设百度一下你就知道官网网址
  • openwrt做网站下载官方正版百度
  • 郑州做音响网站的公司电商seo优化是什么意思
  • 丰富政府网站功能网站seo优化推广外包
  • 哪些网站适合新手编程做项目做搜索引擎优化的企业
  • 成都专业网站设计公司搜索引擎官网
  • 动漫做美食的视频网站培训推广 seo
  • 设计方案怎么写seo优化培训课程
  • 上海公安网站备案网络营销ppt讲解
  • 做网站跟客人怎么沟通cpa推广接单平台
  • 做调查问卷赚钱网站有哪些挖掘关键词爱站网
  • 国家建设部网站培训方案怎么做
  • 深圳招聘网站排行学前端去哪个培训机构
  • 中企动力宁波分公司seo服务如何收费
  • 铜陵网站建设互联网广告销售好做吗
  • 绵阳专门做网站的公司有哪些武汉seo公司哪家专业
  • 怎么做素材设计网站网页友情链接
  • 中华室内设计网招聘seo是搜索引擎营销
  • 360doc 网站怎么做数据统计网站有哪些
  • 做网站报价单百度大搜是什么
  • 1网站免费建站推广之家app
  • 做淘宝美工图片网站百度下载官方下载安装
  • 足球比赛直播在哪看优化关键词的公司
  • 武功县住房和城乡建设局官网站搜索引擎优化工具有哪些
  • 博彩网站开发需要多少钱二十条优化疫情措施
  • 前端网站开发总结seo优化排名推广
  • 网站备案 拉黑石家庄seo推广
  • 做企业网站多青岛网站建设策划
  • 武汉网站建设seo优化营销制作推广形式