在Azure Redis中进行数据分区的最佳做法是什么? [英] What is the best practise to do partitoning data in Azure Redis

查看:78
本文介绍了在Azure Redis中进行数据分区的最佳做法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算在我的应用程序中使用Redis缓存,数据大小可能在10KB到500 MB之间。如果我使用Redis中的大键/值条目,Reding和Saving数据可能会出现性能问题,
意味着我必须通过网络将更多数据从服务器传输到客户端,我可能会得到以下结果。 (以下内容来自 @stackoverflow


  1. 传输数据需要更多时间,所以客户端可能需要配置一个更高的超时值来允许这个额外的传输时间。
  2. 对服务器的请求可能会卡在大转移后面并导致其他请求超时。
  3. 用于传输此数据的网络缓冲区可能会影响客户端或服务器上的可用内存,这会加剧碎片周围描述的可用内存问题。
  4. If这些大的键/值项经常被访问,如果我们一遍又一遍地反复传输这些数据,这会放大影响。

    所以我想在Redis缓存中进行分区。


示例:我有一个端点(GetEmployees(一些计算恰好得到了所有员工)),它返回大约500条大小为400 MB的记录(例子)。我得到相同的数据,直到我添加任何新员工
所以我想有缓存机制,以便我可以存储这些记录并从缓存中获取它而不是一次又一次地进行计算。

Example: I have an endpoint(GetEmployees(Some computation happens to get all employees)) which returns around 500 records with size 400 MB ( Example). I get the same data until I add any new employee so I want to have cache mechanism so that I can store these records and get it from the cache instead of doing calculations again and again.

如果我将所有记录存储在Redis的单个分片中,将面临上述问题。

If I store all records in the single shard of Redis, will face above mentioned issues.

Key / Value:GetEmplyeesTodayDate / {List of Records}

Key/Value : GetEmplyeesTodayDate/ {List Of Records}

因此,我想分割数据和跨分片,并在从Redis读取时获取所有记录。

So, I would like to split the data and across shards and get all records when reading from Redis.

使用相同/多个密钥存储Redis中所有500条记录并检索它们的最佳方法是什么?

What is the best way to store all 500 records in Redis with same/multiple keys (s) and retrieve them?

推荐答案

你好Balu,

Hello Balu,

你的用例最好是没有sql store lik e Cosmos Db并且更具成本效益。 

Your use case is best served by a no sql store like Cosmos Db and is more cost effective. 

Redis缓存不是存储大量交易实体(如员工,订单,客户等)的理想后端.Redis的一些用例记录为

here

Redis cache is not the ideal backend for storing high volume transactional entities like employees, orders, customers etc. Some of the use cases for Redis are documented here

P 租约如果您还有其他问题,请告诉我们。

Please let us know if you have further questions.


这篇关于在Azure Redis中进行数据分区的最佳做法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆