Skip to Content
构建可扩展分布式系统:方法与实践
book

构建可扩展分布式系统:方法与实践

by Ian Gorton
May 2024
Intermediate
278 pages
5h 24m
Chinese
China Machine Press
Content preview from 构建可扩展分布式系统:方法与实践
108
|
6
这与旁路缓存模式(在这种模式下应用逻辑必须感知到缓存未命中)形成了鲜明的
对比。
通读、通写和后写策略需要这样一种缓存技术,该技术可以通过特定应用的处理程序进
行扩充,以便在应用程序访问缓存时执行数据库的读取和写入。例如,
NCache
https://
oreil.ly/v6Xio
)支持
提供者接口
provider interface
)由应用程序实现。接口会在通读缓
存未命中和通写缓存写入时自动调用。其他此类缓存本质上都是专用的数据库缓存,因
此需要缓存访问与底层数据库模型一致。
Amazon
DynamoDB
加速器(
DAX
https://
oreil.ly/lfltM
)就是一个例子。
DAX
位于应用代码和
DynamoDB
之间,透明地充当高速
内存缓存,以减少数据库访问时间。
旁路缓存策略的一个显著优势是它对缓存故障更具弹性。在缓存不可用的情况下,所有
请求基本上都当作缓存未命中来处理。性能会受到影响,但服务仍能满足请求。此外,
扩展
Redis
memcached
之类的旁路缓存平台非常简单,得益于其简单的分布式哈希表
模型。因此旁路缓存模式是大规模可扩展系统使用的主要方法。
6.2 Web
缓存
网站响应速度如此之快的原因之一是互联网上充满着
Web
缓存。
Web
缓存会在定义的时
间段内存储给定资源(例如,网页或图像)的副本。缓存会拦截客户端请求,如果它们
在本地缓存了请求的资源,就会返回副本而不是将请求转发到目标服务。因此,可以在
不给服务增加负担的情况下满足许多请求。此外,由于缓存在物理上更靠近客户端,因 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

What Successful Brick-and-Mortar Retailers Get Right

What Successful Brick-and-Mortar Retailers Get Right

Rob Angell
What Successful Project Managers Do

What Successful Project Managers Do

W. Scott Cameron, Jeffrey S. Russell, Edward J. Hoffman, Alexander Laufer
Three Essentials for Agentic AI Security

Three Essentials for Agentic AI Security

Paolo Dal Cin, Daniel Kendzior, Yusof Seedat, Renato Marinho

Publisher Resources

ISBN: 9787111750697