關於 Azure Cache for RedisAbout Azure Cache for Redis

Azure Cache for Redis 會根據 Redis 軟體提供記憶體中的資料存放區。Azure Cache for Redis provides an in-memory data store based on the Redis software. 針對在後端資料存放區上重度使用的應用程式,Redis 可改善其效能和可擴縮性。Redis improves the performance and scalability of an application that uses on backend data stores heavily. 其可以處理大量的應用程式要求,方法是將經常存取的資料保留在伺服器記憶體中,以供快速地寫入和讀取。It is able to process large volumes of application request by keeping frequently accessed data in the server memory that can be written to and read from quickly. Redis 將重要的低延遲和高輸送量資料儲存解決方案帶入到現代化的應用程式。Redis brings a critical low-latency and high-throughput data storage solution to modern applications.

Azure Cache for Redis 提供 Redis 開放原始碼 (OSS Redis) 和 Redis Labs 的商業產品 (Redis Enterprise) 作為受控服務。Azure Cache for Redis offers both the Redis open-source (OSS Redis) and a commercial product from Redis Labs (Redis Enterprise) as a managed service. 其提供安全且專用的 Redis 伺服器執行個體,以及完整的 Redis API 相容性。It provides secure and dedicated Redis server instances and full Redis API compatibility. 此服務由 Microsoft 運作並裝載於 Azure 上,可供 Azure 內部或外部的任何應用程式存取。The service is operated by Microsoft, hosted on Azure, and accessible to any application within or outside of Azure.

Azure Cache for Redis 可作為分散式資料或內容快取、工作階段存放區和訊息代理程式等等。Azure Cache for Redis can be used as a distributed data or content cache, a session store, a message broker, and more. 它可以與其他 Azure 資料庫服務(例如 Azure SQL 或 Cosmos DB)部署為獨立或並存部署。It can be deployed as a standalone or along side with other Azure database services, such as Azure SQL or Cosmos DB.

主要案例Key scenarios

Azure Cache for Redis 藉由支援常見的應用程式架構模式來改善應用程式效能。Azure Cache for Redis improves application performance by supporting common application architecture patterns. 最常見的一些模式包括:Some of the most common include the following:

模式Pattern 描述Description
資料快取Data cache 資料庫通常太大,無法直接載入快取中。Databases are often too large to load directly into a cache. 常見的方法是使用另行快取模式,只在需要時,將資料載入至快取。It is common to use the cache-aside pattern to load data into the cache only as needed. 系統變更資料時,也會同時更新快取,並散發到其他用戶端。When the system makes changes to the data, the system can also update the cache, which is then distributed to other clients. 此外,系統可以在資料上設定到期日,或使用收回原則,觸發資料更新進入快取。Additionally, the system can set an expiration on data, or use an eviction policy to trigger data updates into the cache.
內容快取Content cache 許多網頁都是從使用靜態內容 (例如標題、頁尾、橫幅) 的範本所產生。Many web pages are generated from templates that use static content such as headers, footers, banners. 這些靜態項目不應該經常變更。These static items shouldn't change often. 相較於後端資料存放區,使用記憶體內部快取可讓您快速存取靜態內容。Using an in-memory cache provides quick access to static content compared to backend datastores. 此模式可減少處理時間和伺服器負載,讓網頁伺服器更具回應能力,This pattern reduces processing time and server load, allowing web servers to be more responsive. 並可以讓您減少處理負載所需的伺服器數目。It can allow you to reduce the number of servers needed to handle loads. Azure Cache for Redis 會提供 Redis 輸出快取提供者,以使用 ASP.NET 來支援此模式。Azure Cache for Redis provides the Redis Output Cache Provider to support this pattern with ASP.NET.
工作階段存放區Session store 此模式通常會與購物車和其他使用者記錄資料這類資訊搭配使用,而 Web 應用程式則會讓使用者 Cookie 與這些資訊產生關聯。This pattern is commonly used with shopping carts and other user history data that a web application may want to associate with user cookies. 在 cookie 中儲存太多資料可能會對效能產生負面影響,因為 cookie 的大小會增加,且會與每個要求一起傳遞和驗證。Storing too much in a cookie can have a negative impact on performance as the cookie size grows and is passed and validated with every request. 一般解決方案是使用 Cookie 作為索引鍵,來查詢資料庫中的資料。A typical solution uses the cookie as a key to query the data in a database. 使用 Azure Cache for Redis 之類的記憶體中快取來將資訊關聯至使用者,速度會比與完整的關聯式資料庫互動快很多。Using an in-memory cache, like Azure Cache for Redis, to associate information with a user is much faster than interacting with a full relational database.
作業與訊息佇列Job and message queuing 當與要求關聯的工作需要時間執行時,應用程式通常會將工作新增到佇列。Applications often add tasks to a queue when the operations associated with the request take time to execute. 較長的執行作業會排入佇列,而且通常是由另一部伺服器依序處理。Longer running operations are queued to be processed in sequence, often by another server. 此延後工作的方法稱為工作佇列。This method of deferring work is called task queuing. Azure Cache for Redis 提供分散式佇列,以在您的應用程式中啟用此模式。Azure Cache for Redis provides a distributed queue to enable this pattern in your application.
分散式交易Distributed transactions 應用程式有時需要一系列針對後端資料存放區的命令,以執行單一不可部分完成的作業。Applications sometimes require a series of commands against a backend data-store to execute as a single atomic operation. 所有命令都必須都成功,或所有命令必須回復為初始狀態。All commands must succeed, or all must be rolled back to the initial state. Azure Cache for Redis 支援以單次交易執行命令批次。Azure Cache for Redis supports executing a batch of commands as a single transaction.

Redis 版本Redis versions

Azure Cache for Redis 支援 OSS Redis 4.x 版,和作為預覽的 6.0 版。Azure Cache for Redis supports OSS Redis version 4.x and, as a preview, 6.0. 我們已決定跳過 Redis 5.0,將您帶到最新版本。We've made the decision to skip Redis 5.0 to bring you the latest version. 先前,Azure Cache for Redis 只會保持單一 Redis 版本。Previously, Azure Cache for Redis only maintained a single Redis version. 其會提供更新的主要版本升級,以及至少一個更舊的穩定版本繼續進行。It will provide a newer major release upgrade and at least one older stable version going forward. 您可以選擇哪一個版本最適合您的應用程式。You can choose which version works the best for your application.

服務層Service tiers

Azure Cache for Redis 可在以下層級使用:Azure Cache for Redis is available in the following tiers:

Tier 描述Description
基本Basic 在單一 VM 上執行的 OSS Redis 快取。An OSS Redis cache running on a single VM. 這一層沒有服務等級協定 (SLA),適用於開發/測試和非關鍵工作負載。This tier has no service-level agreement (SLA) and is ideal for development/test and non-critical workloads.
標準Standard 在複寫組態的兩個 VM 上執行的 OSS Redis 快取。An OSS Redis cache running on two VMs in a replicated configuration.
PremiumPremium 高效能的 OSS Redis 快取。High-performance OSS Redis caches. 這一層提供較高的輸送量、較低的延遲、更佳的可用性,以及更多功能。This tier offers higher throughput, lower latency, better availability, and more features. 相較於基本或標準快取,進階快取會部署在功能更強大的 VM 上。Premium caches are deployed on more powerful VMs compared to those for Basic or Standard caches.
EnterpriseEnterprise Redis Labs 的 Redis Enterprise 軟體提供高效能快取。High-performance caches powered by Redis Labs' Redis Enterprise software. 這一層支援 Redis 模組,包括 RediSearch、RedisBloom 和 RedisTimeSeries。This tier supports Redis modules including RediSearch, RedisBloom, and RedisTimeSeries. 此外也提供比進階層級更高的可用性。In addition, it offers even higher availability than the Premium tier.
Enterprise FlashEnterprise Flash 符合成本效益的大型快取,由 Redis Labs 的 Redis Enterprise 軟體提供技術支援。Cost-effective large caches powered by Redis Labs' Redis Enterprise software. 這一層會將 Redis 資料儲存體擴充至 VM 上的非動態記憶體,其價格會比 DRAM 低。This tier extends Redis data storage to non-volatile memory, which is cheaper than DRAM, on a VM. Enterprise Flash 可降低每 GB 記憶體的整體成本。It reduces the overall per-GB memory cost.

功能比較Feature comparison

Azure Cache for Redis 價格會提供每一層的詳細比較。The Azure Cache for Redis Pricing provides a detailed comparison of each tier. 下表可協助說明階層所支援的一些功能:The following table helps describe some of the features supported by tier:

功能描述Feature Description 基本Basic 標準Standard PremiumPremium EnterpriseEnterprise Enterprise FlashEnterprise Flash
服務等級協定 (SLA)Service Level Agreement (SLA) -
資料加密Data encryption
網路隔離Network isolation
調整大小Scaling
OSS 叢集OSS cluster - -
資料持續性Data persistence - - 預覽Preview 預覽Preview
區域備援Zone redundancy - - 預覽Preview
異地複寫Geo-replication - - 預覽Preview 預覽Preview
單元Modules - - -
匯入/匯出Import/Export - -
排程的更新Scheduled updates - -

選擇正確的階層Choosing the right tier

在選擇 Azure Cache for Redis 服務層級時,您應該考慮下列各項:You should consider the following when choosing an Azure Cache for Redis tier:

  • 記憶體:基本和標準層提供 250 MB - 53 GB;進階層則提供 6 GB - 1.2 TB;Enterprise 層則為 12 GB - 14 TB。Memory: The Basic and Standard tiers offer 250 MB – 53 GB; the Premium tier 6 GB - 1.2 TB; the Enterprise tiers 12 GB - 14 TB. 若要建立 120 GB 以上的進階層快取,您可以使用 Redis OSS 叢集。To create a Premium tier cache larger than 120 GB, you can use Redis OSS clustering. 如需詳細資訊,請參閱 Azure Redis 快取價格For more information, see Azure Cache for Redis Pricing. 如需詳細資訊,請參閱 如何設定進階 Azure Redis 快取的叢集功能For more information, see How to configure clustering for a Premium Azure Cache for Redis.
  • 效能: Premium 和企業層中的快取是部署在處理器較快的硬體上,相較于基本或標準層,提供更好的效能。Performance: Caches in the Premium and Enterprise tiers are deployed on hardware that has faster processors, giving better performance compared to the Basic or Standard tier. 高階層快取的輸送量較高,延遲性較低。Premium tier Caches have higher throughput and lower latencies. 如需詳細資訊,請參閱 Azure Cache for Redis 效能For more information, see Azure Cache for Redis performance.
  • Redis 伺服器的專用核心:除了 C0 的所有快取都會執行專用 VM 核心。Dedicated core for Redis server: All caches except C0 run dedicated VM cores. 根據設計,Redis 只會使用一個執行緒進行命令處理。Redis, by design, uses only one thread for command processing. Azure Cache for Redis 會利用其他核心來處理 i/o。Azure Cache for Redis utilizes additional cores for I/O processing. 擁有更多核心會改善輸送量效能,即使其可能不會產生線性擴增。Having more cores improves throughput performance even though it may not produce linear scaling. 此外,較大的 VM 大小一般會比小一點的大小有更高的頻寬限制。Furthermore, larger VM sizes typically come with higher bandwidth limits than smaller ones. 這可協助您避免網路飽和,這會導致您的應用程式發生逾時。That helps you avoid network saturation, which will cause timeouts in your application.
  • 網路效能:如果您的工作負載需要高輸送量,與「基本」層或「標準」層相比,「進階」層或 Enterprise 層可提供更大的頻寬。Network performance: If you have a workload that requires high throughput, the Premium or Enterprise tier offers more bandwidth compared to Basic or Standard. 此外,因為每一層內有裝載快取的基礎 VM,較大型快取還有更大頻寬。Also within each tier, larger size caches have more bandwidth because of the underlying VM that hosts the cache. 如需詳細資訊,請參閱 Azure Cache for Redis 效能For more information, see Azure Cache for Redis performance.
  • 用戶端連線數上限:「進階」層提供可連線至 Redis 的最大用戶端數目,針對較大型的快取可提供較高的連線數。Maximum number of client connections: The Premium tier offers the maximum number of clients that can connect to Redis, with a higher number of connections for larger sized caches. 叢集化不會增加叢集快取的可用連線數目。Clustering does not increase the number of connections available for a clustered cache. 如需詳細資訊,請參閱 Azure Cache for Redis 價格For more information, see Azure Cache for Redis pricing.
  • 高可用性:Azure Cache for Redis 提供多個 高可用性選項。High availability: Azure Cache for Redis provides multiple high availability options. 我們的 SLA 保證標準、進階或 Enterprise 快取的可用性。It guarantees that a Standard, Premium, or Enterprise cache is available according to our SLA. SLA 的範圍僅涵蓋與快取端點的連線。The SLA only covers connectivity to the cache endpoints. SLA 未涵蓋資料遺失防護。The SLA does not cover protection from data loss. 建議您在 Premium 和企業層中使用 Redis 資料持續性功能,以提高資料遺失的復原能力。We recommend using the Redis data persistence feature in the Premium and Enterprise tiers to increase resiliency against data loss.
  • 資料持續 性: Premium 和 Enterprise 層可讓您將快取資料分別保存到 Azure 儲存體帳戶和受控磁片。Data persistence: The Premium and Enterprise tiers allow you to persist the cache data to an Azure Storage account and a Managed Disk respectively. 基礎結構發生問題,可能會導致資料遺失。Underlying infrastructure issues might result in potential data loss. 建議您在這些階層中使用 Redis 資料持續性功能,以提高資料遺失的復原能力。We recommend using the Redis data persistence feature in these tiers to increase resiliency against data loss. Azure Cache for Redis 同時提供 RDB 和 AOF (preview) 選項。Azure Cache for Redis offers both RDB and AOF (preview) options. 您可以透過 Azure 入口網站和 CLI 來啟用資料持續性。Data persistence can be enabled through Azure portal and CLI. 如需高階層次,請參閱 如何設定 premium Azure Cache for Redis 的持續性。For the Premium tier, see How to configure persistence for a Premium Azure Cache for Redis.
  • 網路隔離:Azure Private Link 和虛擬網路 (VNET) 部署可為您的 Azure Cache for Redis 提供增強的安全性和流量隔離。Network isolation: Azure Private Link and Virtual Network (VNET) deployments provide enhanced security and traffic isolation for your Azure Cache for Redis. VNET 可讓您透過網路存取控制原則進一步限制存取。VNET allows you to further restrict access through network access control policies. 如需詳細資訊,請參閱具備 Azure Private Link 的 Azure Cache for Redis 以及如何設定進階 Azure Cache for Redis 的虛擬網路支援For more information, see Azure Cache for Redis with Azure Private Link and How to configure Virtual Network support for a Premium Azure Cache for Redis.
  • 擴充 性:企業 層支援 RediSearchRedisBloomRedisTimeSeriesExtensibility: Enterprise tiers support RediSearch, RedisBloom and RedisTimeSeries. 這些模組會將新的資料類型和功能新增至 Redis。These modules add new data types and functionality to Redis.

建立後,您可以將快取從基本層擴充至進階層。You can scale your cache from the Basic tier up to Premium after it has been created. 目前不支援向下調整至較低的層級。Scaling down to a lower tier is not supported currently. 如需調整階層的逐步指示,請參閱如何調整 Azure Cache for Redis如何將調整作業自動化For step-by-step scaling instructions, see How to Scale Azure Cache for Redis and How to automate a scaling operation.

企業層的特殊考慮Special considerations for Enterprise tiers

企業層級依賴 Redis Enterprise,這是來自 Redis Labs 的 Redis 商用變化。The Enterprise tiers rely on Redis Enterprise, a commercial variant of Redis from Redis Labs. 客戶會透過 Azure Marketplace 供應項目取得並支付此軟體的授權。Customers will obtain and pay for a license to this software through an Azure Marketplace offer. Azure Cache for Redis 可協助取得授權,因此您不需要個別執行此動作。Azure Cache for Redis will facilitate the license acquisition so that you won't have to do it separately. 您必須具備以下先決條件,才能在 Azure Marketplace 中購買:To purchase in the Azure Marketplace, you must have the following prerequisites:

  • 您的 Azure 訂用帳戶具有有效的付款條件。Your Azure subscription has a valid payment instrument. 不支援 Azure 點數或免費 MSDN 訂用帳戶。Azure credits or free MSDN subscriptions are not supported.
  • 您的組織允許 Azure Marketplace 購買Your organization allows Azure Marketplace purchases.
  • 如果您使用私人 Marketplace,其必須包含 Redis Labs 企業版供應項目。If you use a private Marketplace, it must contain the Redis Labs Enterprise offer.

重要

Azure Cache for Redis Enterprise Cache 需要標準的網路負載平衡器,與快取實例本身分開收費。Azure Cache for Redis Enterprise cache require standard network Load Balancers that are charged separately from cache instances themselves. 如需詳細資訊,請參閱 Load Balancer 定價Refer to the Load Balancer pricing for more details. 如果企業快取設定為多個可用性區域,則會從2021年7月1日起,以 標準網路頻寬費率 計費資料傳輸。If an Enterprise cache is configured for multiple Availability Zones, data transfer will be billed at the standard network bandwidth rates starting from July 1, 2021.

此外,資料持續性會新增受控磁碟。In addition, data persistence adds Managed Disks. 在企業資料持續性的公開預覽期間,這些資源的使用將免費。The use of these resources will be free during the public preview of Enterprise data persistence. 這可能會在功能正式推出時變更。This may change when the feature becomes generally available.

下一步Next steps