我想知道在多个服务器(如 google、facebook)上存储大量图像的最佳解决方案是什么。
似乎存储在文件系统中比存储在数据库中更好,但是使用像 cassandra 这样的 noSQL 数据库呢?
Google/Facebook 是否将相同的图像存储在多个服务器中以实现负载平衡。 它是如何工作的?什么是最佳解决方案?
非常感谢
最佳答案
您采用的方法没有任何问题。如前所述,有一些注意事项,但可能性确实存在,许多人和公司都成功地将文件存储在 Apache Cassandra 中。
- zjffdu/cassandra-fs是我要研究的第一个解决方案。现在,这是 2 年前开发的,所以我对它第一次开箱即用有点谨慎。 Apache Cassandra现在是 1.0.x 版本,1.1.x 即将发布。 2 年前,那可能是 0.6.x 版? 24 个月内发生了很多变化和改进。
- semantico/cassandra-fs一个 fork ……最后一次接触是在 7 个月前
- favoritas37/cassandra-fs另一个 fork ……最后一次接触是在 3 个月前,表明与 Cassandra 的 1.0.5 分支兼容
这背后的原理是获取一个文件,将其分成一组 block 并将这些 block 存储为一行中的列。检索时,拉出每一列,重新组装文件,瞧。
Cassandra FAQ: large file and blog storage
...files of around 64Mb and smaller can be easily stored in the database without splitting them into smaller chunks...
...its files are broken down into blocks (whose sizes are capped), where each block (see FileBlock) is stored as the value of a column in the corresponding row...
您将在 Cassandra 邮件列表和 IRC channel 上获得更多积极的反馈。
最后,这是 2009 年的文章,由 Facebook 的人撰写,应该可以在某种程度上帮助回答您的更多基本问题:Cassandra - A Decentralized Structured Storage System .
关于database - 在多个服务器上存储大量图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9857341/