查找一个<键,值,值>表格外有600行 [英] lookup for one <key, value,value> out of table which has 600 rows

查看:50
本文介绍了查找一个<键,值,值>表格外有600行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是使用Azure的新手.我想启动从逻辑应用程序到功能的触发器,只想使用一个键(键,值,值)查找2个值.然后功能需要从主体读取一个按键,进行查找并将响应发送回去 通过将这两个值附加到主体中,将其添加到logicapp.

I am a newbie to azure functions. I would like to initiate the trigger from logic-app to function, just to look for 2 values using one key(key, value, value).  Then function needs to read the one key from the body, do lookup and send the response back to logicapp by appending those 2 values in the body.

从扩展角度看,logicapp将在每3分钟的窗口中启动1500个触发器.因此,我想使用函数来执行此查找,而不是在logic-app(涉及一些循环)本身中执行此查找,以获得更好的性能.

From scaling perspective, logicapp will be initiating 1500 triggers in every 3-minutes window. Hence I want to do this lookup using function instead of doing this in logic-app(which involves some looping) itself for better performance.

1. <键,值,值>将有600条记录,并且它们保持不变.如何将它们存储在azure函数中?

1.  The <key,value, value> will be having 600 records and they remain constant. How to store them in azure function ?

2.什么是最好/最简单的数据结构?

2. What are best/simplest datastructures to use ?

谢谢.

推荐答案

您可以根据需要将它们存储在内存中/Azure表/CosmosDB/Azure Redis缓存中.

You could store them in In-Memory / Azure Table / CosmosDB / Azure Cache for Redis based on your requirement.

1.内存中存储是最简单的方法,但是如果需要更新它们,则必须将其保留在代码中,需要重新部署.
您可以将它们存储在静态字典对象中(

1. In-Memory would be the simplest approach but you would have to maintain those records in code requiring you to redeploy if you need to update them ever.
You could just store them in a static dictionary object (dictionary for C#, just a simple JSON object for NodeJS) for best efficiency in retrieval by key.

2. Azure Table/CosmosDB/任何NOSQL DB都会这样做,因为您正在通过将在这些DB中建立索引的键进行查询,但在此确实考虑了额外的存储和检索成本.
使用这种方法,您无需重新部署功能就可以更新记录.

2. Azure Table / CosmosDB / Any NOSQL DB rather would do since you are querying by a key which would be indexed in these DBs but do consider the extra cost for storage and retrieval here.
With this approach, you can update records without reedploying your function.

3.与2一样,Azure Cache for Redis允许您将记录作为键值对存储在Redis中并直接访问它们.与2不同,Redis是一个内存中数据存储,可为您提供更高的吞吐量.
与2类似,您可以在不重新部署功能的情况下更新记录.

3. Like 2, Azure Cache for Redis allows you to store your records as Key-Value pairs in Redis and access them directly. Unlike 2, Redis is an In-Memory data store giving you much higher throughput.
Similar to 2, you can update records without reedploying your function.

由于您提到列表保持不变,具体取决于您的负载,所以我认为最有效的应该是1.

Since you mentioned that the list remains constant, depending on your load, 1 should be the most efficient I suppose.


这篇关于查找一个&lt;键,值,值&gt;表格外有600行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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