Uber 如何通过集成缓存以更强一致性保证实现每秒超过 1.5 亿次读取

This is the second blog about the integrated cache infrastructure for Docstore, our online storage at Uber. In the previous blog, we presented CacheFront and outlined its core functionality, design principles, and architecture. In this blog, we share some exciting improvements we’ve implemented since then as we scaled up its footprint by almost 4 times.

这是关于 Docstore(Uber 的在线存储系统)集成缓存基础设施的第二篇博客。在上一篇博客中,我们介绍了 CacheFront,并概述了其核心功能、设计原则和架构。在本篇博客中,我们将分享自那以后实现的一些令人兴奋的改进,这些改进使我们将 CacheFront 的覆盖范围扩大了将近 4 倍。

The previous blog has a detailed explanation of the overall Docstore architecture. For this blog, it’s sufficient to remember that CacheFront is implemented in our stateless query engine layer, which communicates with the stateful storage engine nodes to serve all read and write requests.

上一篇博客对 Docstore 的整体架构有详细说明。对于本文,只需记住 CacheFront 是在我们的无状态查询引擎层中实现的,该层与有状态的存储引擎节点通信,以处理所有读写请求。

Image

Figure 1: CacheFront read and write paths.

图 1:CacheFront 的读取和写入路径。

The reads are intercepted at the query engine layer to first try fetching the rows from Redis™. The rows that weren’t found in Redis are fetched directly from the storage engine and subsequently written to the cache to keep the cache warm. The read results are then merged and streamed back to the client.

读取操作在查询引擎层被拦截,首先尝试从 Redis™ 获取行。未在 Redis 中找到的行则直接从存储引擎获取,并随后写入缓存以保持缓存热度。读取结果合并后流式返回给客户端。

Docstore generally supports two types of updates:

Docstore 通常支持两种更新类型:

  • Point writes: INSERT, UPDATE, DELETE queries that update a predefined set of rows, specified as the arguments of the DML query itself.
  • 点写:INSERT、UPDATE、DELETE 查询,用于更新 DML 查询参数中预定义的一组行。
  • Conditional updates: UPDATE or DELETE queries with a WHERE filter clause, where one or more rows can be updated based on the condition in the filter.
  • 条件更新:带有 WHERE 过滤子句的 UPDATE 或 DELETE 查询,可根据过滤条件更新一行或多行。

The writes aren’t intercepted at all, mainly because of the presence of  conditional updates. Without knowing which rows are going to change or have changed as a result of running the DML query, we couldn’t know which cache entries r...

开通本站会员,查看完整译文。

首页 - Wiki
Copyright © 2011-2025 iteam. Current version is 2.146.0. UTC+08:00, 2025-08-28 06:39
浙ICP备14020137号-1 $访客地图$