将物理图像存储到数据存储区还是链接到它更好? [英] Is it better to store a physical Image into datastore or a link to it?

查看:114
本文介绍了将物理图像存储到数据存储区还是链接到它更好?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要存储图片,我有2个选项:
$ b

  • 将图像存储到GAE数据存储中。

  • 将图像存储在某处(也可以在Dropbox或其他网站上),并将其链接存储到GAE数据存储中。 最佳做法是什么时候我们需要将图像存储到数据库中,在假设中,每个图像都是双向链接到数据存储库的特定元素?

我认为这在很大程度上取决于用例。



我有一个运行在appengine上的小公司网站,内容图像全部存储在数据存储中,并且对于该应用程序来说它运行良好(它们都是相对较小的图像)。

如果您拥有高流量的网站,您可能会发现将它们存储在GCS中,或者其他一些支持更具成本效益的CDN的机制将更为合适。



如果图片很大(大于1MB),那么数据存储不是一个实用的解决方案。



将没有硬性规定。了解您的用例,成本结构,解决方案的复杂程度,然后选择最合适的解决方案。


I need to store images and I have 2 options:

  • store the image into GAE datastore.
  • store the image somewhere (maybe also on Dropbox or another website) and store its link into GAE datastore.

What's the best practice when we need to store an image into DB, in the hypotesis that each image is bijectivelly linked to a specific element of the datastore?

解决方案

I think it depends heavily on the use case.

I have a small company website running on appengine and the content images are all stored in the datastore and for that application it works well (they are all relatively small images).

If you have a high traffic site you may find storing them in GCS, or some other mechanism that supports a more cost effective CDN will be more appropriate.

If the images are large (more than 1MB) then the datastore isn't a practical solution.

There will be no hard and fast rule. Understand your use cases, your cost structure, how complex the solution will be to manage, and then choose the most appropriate solution.

这篇关于将物理图像存储到数据存储区还是链接到它更好?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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