150億枚(異なるサイズの複製もいれれば600億枚)の写真を抱えるFacebookは、写真アプリケーションのためだけに膨大なストレージ場所を食われている。メンバーは毎週2億2千万枚の写真をアップロードしている。Facebookの写真ストレージの容量は1.5PB(ペタバイト)で、毎週25TB(テラバイト)ずつ増加している。昨年Facebookは写真を始めとするコンテンツの増加に対応するためにNetAppのストレージ機器の購入に$30M(3千万ドル)を支払っていると推定されている。このコストを少しでも減らすために、FacebookはHaystackという独自のストレージ技術を開発した。
今回、その技術がどんなふうに働くのか、かなり詳しく発表された。簡単にいえば、HaystackはFacebookが高価な専用データ保管機器ではなく、安価な市販のハードウェアを利用できるようにする。Haystackは通常のネットワーク・ファイルシステムではなく、写真の保管処理だけに特化した機能を持つ。FacebookはHaystackで市販ハードウェアを利用できるようになっただけでなく、ストレージ容量自体も3倍に改善することでコスト節約に成功した。つまり、従来10台のハードディスクが必要だったところが3台ですむわけだ。
何十億枚もの画像を保管している場合、必要な画像を直ちに取り出すのはことわざにいう「干し草の山から針を探す」のに等しい。従来のネットワーク・ファイルシステムでは、個々の写真について、最終更新日、ディレクトリ名その他大量のメタデータのやり取りが必要になる。こうしたメタデータのやり取りが処理のボトルネックとなっていた。そこでHaystackを開発したFacebookのエンジニア(Doug
Beaver、Peter Vajgel、Jason Sobel)はこうしたメタデータのほとんどを使わずにすませる方法を考え出した。Facebookのエンジニアリング・ブログに詳細な説明がある。〔以下英文〕
The new photo infrastructure merges the photo serving tier and storage tier into one physical tier. It implements a HTTP based photo server which stores photos in a generic object store called Haystack. The main requirement for the new tier was to eliminate any unnecessary metadata overhead for photo read operations, so that each read I/O operation was only reading actual photo data (instead of filesystem metadata)
All of that metadata is stored in what Facebook is calling “needle.” Each needle pulls together the metadata for hundreds of thousands of images. The needles are paired with an index to make up the Haystack object store. You can read all the technical details on the Facebook engineering blog. The company will keep its existing network file system for the 15 billion photos already uploaded (after all, those NetApp boxes are sunk costs). But going forward, all new photo uploads will be handled by Haystack. And in the future, Facebook may even open-source the architecture so other companies can benefit from it. Not bad, for something that was built by three engineers.
(Photo credit: Flickr/Vitor Antunes)
[原文へ]
(翻訳:Namekawa, U)




