在哪里存放东西喜欢使用Azure的用户图片? Blob存储? [英] Where to store things like user pictures using Azure? Blob Storage?

查看:91
本文介绍了在哪里存放东西喜欢使用Azure的用户图片? Blob存储?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚才已经迁移我的一个项目的测试用例来微软的Azure。

I have just migrated a project of mine for test cases to Microsoft's azure.

但对于类似于头像上传我需要写访问的硬盘中的文件的功能。但是,这是一个云,所以这是不可能的。
我怎样才能建立这样的功能呢?我应该使用Blob存储或是否有更好的解决方案?

But for functionalities similar to an avatar upload I need write access to the files on the harddrive. But this is a cloud, so this is not possible. How can I build such functionalities instead? Should I use the Blob Storage or is there a better solution?

是否有意义存储在Blob存储所有的网站图片(F.E.布局图像)?所以,我想有一个cookie的免费域名为我的静态内容?

Does it make sense to store all website images (f.e. layout images) in the Blob Storage? So I would have a Cookie-free Domain for my static content?

推荐答案

Blob存储肯定是把动态图像的化身一样的地方。虽然你可以写在VM磁盘,你会在运行,你不能依靠这是present - 如果您的应用程序被移出到另一台计算机(其中可能发生的任何原因)该存储将被删除。

Blob storage is definitely the place to put dynamic images like avatars. While you can write to the disk on the VM you'll be running in, you can't rely on this to be present - if your app gets moved off to another machine (which could happen for any number of reasons) this storage will be erased.

有一件事情你可以做的是存储在Blob存储您的图片,并缓存在本地VM磁盘(使用标准文件IO机制)上。这样你会得到pretty良好的性能,并节省一些存储数据,同时还确保你没有在易失性存储器存储。

One thing you could do is store your images in blob storage, and cache them on the local VM disk (using the standard file IO mechanisms). This way you'll get pretty good performance and will save on a few storage transactions while still making sure you're not storing in volatile storage.

如果你有这将是完全静态的静态图像,这些只是捆绑了您的应用程序,并可以像一个正常的文件引用。但是,如果你永远都需要改变他们,你需要重新部署应用程序 - 所以只能使用此技术,将不需要改变图像

If you've got static images which will be completely static, these are just bundled with your application and can be referenced like a normal file. But, if you will ever need to change them, you'd need to redeploy the application - so only use this technique for images which won't need to change.

这篇关于在哪里存放东西喜欢使用Azure的用户图片? Blob存储?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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