Blob SAS WCF和性能 [英] Blob SAS WCF and perfomance

查看:56
本文介绍了Blob SAS WCF和性能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

链接讨论性能并绕过门户.对我而言,进行身份验证的WCF服务类似于门户.

This link talks about performance and bypass the portal. To me a WCF service that authenticates is similar to a portal.

轻量级服务根据需要对客户端进行身份验证,然后 生成SAS.客户端收到SAS后,便可以访问 存储帐户资源直接具有由 SAS以及SAS允许的时间间隔. SAS减轻了 需要通过前端代理服务路由所有数据.

A lightweight service authenticates the client as needed and then generates a SAS. Once the client receives the SAS, they can access storage account resources directly with the permissions defined by the SAS and for the interval allowed by the SAS. The SAS mitigates the need for routing all data through the front-end proxy service.

该应用程序是一个胖.NET WPF客户端,该客户端与使用Azure AD进行身份验证的Azure应用程序中托管的WFC服务进行通信.

The application is a thick .NET WPF client communicating with a WFC service hosted in an Azure App using Azure AD for authentication.

这是一个文档管理应用程序,因此文件传输很多.搜索和搜索结果的流量相对较小.需要搜索才能做出响应.

It is a document management application so lots of file transfer. Search and search results is a relatively small amount of traffic. Need search to be responsive.

使用

Is it over optimization to use SAS for file upload and download?
The other option is to upload and download the files via the WCF service.
What would be some gotcha for one or the other?

我的想法是,我希望使文件不包含在WCF服务中,以使其保持响应状态.

My thought is I would like to keep the files off the WCF service to keep it responsive.

如果这是一个单独的问题,那么很好.客户端一次获得搜索结果1000.即使在SAS上有很长的过期时间,如果他们将结果保留几个小时,它也可能过期.如果SAS是属性绑定,我如何检测过期的SAS?每个文件在应用程序中都有一个唯一的ID.仅在索取中请求SAS会更好吗?

If this should be a separate question then fine. The client gets the results of the search 1000 at a time. Even with a long expiration on the SAS it could expire if the they left the results up hours. If the SAS is a Property binding how might I detect an expired SAS? Each file has a unique ID in the application. Would it be better to just request the SAS in the get?

在某些情况下,用户可以访问搜索结果中的几乎每个文件,而在其他情况下,用户只能基于搜索结果中的信息访问100个文件中的1个.他们可能正在进行一些大型搜索,以仅获取计数并访问零个文件.

Have cases where a user may access almost every file in the in search results and others where they may only access 1 of 100 based on information in the search results. They may be running some large searches to get counts only and access zero files.

推荐答案

使用SAS进行文件上载和下载是否超出了优化范围?

Is it over optimization to use SAS for file upload and download?

我不这么认为.使用SAS上传/下载文件对我来说完全有意义.

I don't think so. Uploading/downloading files using SAS makes complete sense to me.

另一个选择是通过WCF上传和下载文件 服务.一个或另一个会有些陷阱吗?

The other option is to upload and download the files via the WCF service. What would be some gotcha for one or the other?

使用基于SAS的方法的最大优势是,您可以直接与Azure存储进行交互,而无需通过WCF服务进行数据路由.因此,您可以保持服务真正的轻量级,而不必在扩展后增加过多的基础结构.对于SAS,WCF服务将仅在Blob上获得对SAS的请求,并返回该Blob的SAS URL,您的客户端应用程序可使用该URL来上传文件.

Biggest advantage of using SAS based approach is that you're interacting directly with Azure Storage without having the data route through your WCF Service. Thus you could keep your service really lightweight and not put too much infrastructure behind it for scaling purposes. For SAS, the WCF service would simply get a request for a SAS on a blob, and it returns the SAS URL for the blob which your client application can use to upload the files.

使用SAS时,一个关注点可能是共享SAS URL和使链接获得意想不到的受众.但是,您可以通过保留短命的SAS令牌并在SAS上应用IP ACL来减轻这种担忧.

With SAS, one point of concern could be sharing of SAS URL and the link getting in hands of unintended audience. However you could mitigate this concern by keeping short-lived SAS tokens and apply IP ACLing on the SAS.

关于您的应用程序(尤其是搜索部分)的共享信息很少,但是我猜测有关文件的信息保留在某种关系数据库中,而实际文件保留在Blob存储中.我会避免将SAS令牌作为搜索结果的一部分生成,而仅按需生成它们.如果用户尝试上载文件,则在实际上载过程之前会获得一个用于上载的SAS URL.同样,当用户下载文件时,您会在那时获得该文件的SAS URL并进行下载.

Not much information is shared about your application (especially the search part) but I am guessing that information about the files is kept in some kind of relational database and actual files are kept in blob storage. I would stay away from generating SAS tokens as part of search result and only generate them on demand. If a user is trying to upload a file, you get a SAS URL for upload just before the actual upload process. Similarly when a user is downloading a file, you get a SAS URL for the file at that time and do the download.

这篇关于Blob SAS WCF和性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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