Facebook にストアされた 100 Peta Byte イメージ・データは、写真に換算すると 6,660 億枚になる!
Why 900M isn’t the only number that matters to Facebook
http://wp.me/pwo1E-4gQ
By Derrick Harris May. 17, 2012
http://gigaom.com/cloud/why-900m-isnt-the-only-number-that-matters-to-facebooks-success/
You’ve no doubt heard or read in the past few weeks that Facebook’s hyperinflated valuation heading into its IPO has everything to do with its promise, and very little to do with its actual profits. That much is true.
この数週の間に、IPO へと突き進む Facebook のハイパー・インフレ資産価値について、きっと何かを読んだり聞いたりしてきただろう。しかし、そこに含まれるものは、目論見を実現していくという目標のみであり、また、現実的な利益に関しては、僅かな約束だけがある状況だ。 それは、たしかに、そうなのだ。
But apart from the fact that it has more than 900 million users, a lot of other important numbers never get mentioned. Here are some numbers we know about Facebook’s infrastructure that also speak to its promise as a company that could generate a lot of money.
しかし、Facebook が 9億人以上のユーザーを有しているという事実を別として、その他の重要な数字について言及される機会は、きわめて少ない。 そして、私たちが Facebook のインフラについて知っている若干の数字は、同社における背景を、つまり、莫大な利益を生み出す構造を物語ってくれるのだ。
- 100 petabytes of users’ photos and videos. If it were all photos, that would be more than 666 billion of them.
- 30-plus petabytes of user data in its Hadoop cluster, which is used as a giant data warehouse.
- $1.6–$1.8 billion on planned infrastructure spending in 2012. Google usually spends between $2 billion and $4 billion a year, but bought in more than 10 times Facebook’s revenue in 2011.
- The overall server market was estimated at $52.3 billion in 2011, and Facebook’s Open Compute Project is trying to turn that market on its head by redefining how servers are built and sold at webscale.
- Facebook doesn’t disclose the number of custom-built servers it runs, but by this point it’s far more than the 60,000 estimated in 2010.
- It took Facebook less than 30 days to provision and bring online tens of thousands of servers when it fired up its Prinveville, Ore., data center.
- 100 Peta Bytes のユーザー Photo/Video。 その全てを写真として換算すると、6,660 億枚になる。
- 30 Petra Bytes 以上の Hadoop クラスタ・データ。巨大な、データ・ウェアハウスとして利用されている。
- $1.6–$1.8 billionの、2012年に費やされる予定のインフラ予算。 Google の場合は、$2 billion ~ $4 billion を年間で投資しているが、同社における 2011年の売上は、Facebook の 10倍に達する。
- 2011年における全体的なサーバー市場は、$52.3 billion だと見積もられている。 そして、Facebook の Open Compute Project は、Web スケールを達成するサーバー・ビジネスを再定義することで、このマーケットの向かう先を切り替えようとしている。
- Facebook は、自社で運用しているカスタム・ビルド・サーバーの台数を明らかにしていない。しかし、2010年の時点で、60,000 台以上だと指摘されている。
- Prinveville, Oregon のデータセンターが開所したとき、Facebook は30日以内で、数万台のサーバーをプロビジョニングし、オンラインに接続している。
Is Facebook actually worth $100 billion? Who knows. But it’s a company with so much data and with its finger on the pulse of how web infrastructure works. Managed properly, there’s an awful lot there to work with as Facebook tries to figure out new ways to make a dollar.
実際のところ、Facebook に $100 billion の価値があるのだろうか? 誰が、分かるのだろう。 しかし、Facbeook は膨大なデータを保有している企業であり、また、Web インフラストラクチャの発する鼓動を、その指先で聞き取れる企業でもある。 そこには、適切な管理がある。 そして、Facebook が $1 を稼ぎ出すための、新しい方法を身に付けようするように、とても多くの、取り組むべき課題がある。
Related research and analysis from GigaOM Pro:
- Dissecting the data: 5 issues for our digital future
- Creating value out of machine-driven big data
- A near-term outlook for big data
ーーーーー

久々の、Facebook ウルトラ・スケール話しです。 Oregon の立ち上げに際して、30 P Bytes の Hadoop クラスタが引越ししたというニュースをポストしましたが、フォト+ビデオで 100 P Bytes になるとは、新しい驚きです。 また、文中にもあるように、Open Compute というハードウェアとデータセンターのためのオープンソースを介して、このインフラ・レイヤを刷新しようとする動きも見逃せません。 この IT のコストを大幅に引き下げ、ノウハウを開示し、エコシステムを構築していこうとする、Facebook の試みには大賛成です! ーーー 
ーーーーー
<関連>
Facebook Timeline は、データの非正規化という破壊力で誘う
Facebook が $1 Billion を費やす、データセンター連携の規模を探る
Amazon の James Hamilton が語る、効率の良いデータセンター運用のコツとは?
Facebook が推進する Open Compute Project は、離陸できるのだろうか?
オープンなハードウェアは、データセンターに地殻変動を起こせるのか?
Twitter サーチを 3倍速にする新アーキテクチャとは? _3
Twitter Search is Now 3x Faster
Wednesday, April 6, 2011
http://engineering.twitter.com/2011/04/twitter-search-is-now-3x-faster_1656.html
ーーーーー
これは、三部作の最終回です。初めての方は、1 と 2 をお先に ど~ぞ。
Twitter サーチを 3倍速にする新アーキテクチャとは? _1
Twitter サーチを 3倍速にする新アーキテクチャとは? _2
Twitter サーチを 3倍速にする新アーキテクチャとは? _3
ーーー ![]()
ーーーーー
MULTIPLEXING INCOMING REQUESTS
Because workflows are mapped to Netty pipelines in Blender, we needed to route incoming client requests to the appropriate pipeline. For this, we built a proxy layer that multiplexes and routes client requests to pipelines as follows:
このワークフローは、Brender における Netty パイプラインにマップされるため、Incoming リクエストを、適切なパイプラインに送る必要があった。 そのため、以下のようなマルチプレックスのプロキシー・レイヤを構築し、パイプラインにクライアント・リクエストをルーティングしている:
- When a remote Thrift client opens a persistent connection to Blender, the proxy layer creates a map of local clients, one for each of the local workflow servers. Note that all local workflow servers are running inside Blender’s JVM process and are instantiated when the Blender process starts.
- When the request arrives at the socket, the proxy layer reads it, figures out which workflow is requested, and routes it to the appropriate workflow server.
- Similarly, when the response arrives from the local workflow server, the proxy reads it and writes the response back to the remote client.
- リモート Thrift クライアントから Blender に、永続的なコネクションをオープンするときに、このプロキシー・レイヤがローカル・クライアントを作成し、それぞれのローカル・ワークフロー・サーバーにマップしていく。 注意すべきことは、すべてのローカル・ワークフロー・サーバーが、Bernder の JVM プロセス内で実行され、また、Brender プロセスがスタートするときにインスタンス化される点である。
- それらのリクエストがソケットに到着するとき、プロキシー・レイヤによる読み込みが行われ、求められるワークフローの種類が理解され、適切なワークフロー・サーバーへのルーティングが行われる。
- それと同様に、それらのローカル・ワークフロー・サーバーからレスポンスが戻ったとき、対象となるプロキシーによる読み込みが行われ、リモート・クライアントへのレスポンスの書込みが完了する。
We made use of Netty’s event-driven model to accomplish all the above tasks asynchronously so that no thread waits on I/O.
それら全てのタスクを非同期化するために、Netty のイベント駆動型モデルを利用することで、I/O の待ち時間が排除された。
DISPATCHING BACK-END REQUESTS
Once the query arrives at a workflow pipeline, it passes through the sequence of service handlers as defined by the workflow. Each service handler constructs the appropriate back-end request for that query and issues it to the remote server. For example, the real-time service handler constructs a realtime search request and issues it to one or more realtime index servers asynchronously. We are using the twitter commons library (recently open-sourced!) to provide connection-pool management, load-balancing, and dead host detection.
ワークフロー・パイプラインに到着したクエリーは、対象となるワークフローで定義さたとおりに、サービス・ハンドラーのシーケンスを通過していく。 続いて、それぞれのサービス・ハンドラーが、対象となるクエリーに適したバックエンド・リクエストを構成し、リモート・サーバーへ向けて送り出す。 たとえば、リアルタイム・サービス・ハンドラーは、リアルタイム・サーチ・リクエストを構成し、複数のリアルタイム・インデックス・サーバーへ向けて、そのリクエストを非同期で発行する。私たちは、コネクション・プール管理および、ロード・バランシング、デッド・ホスト検出を提供するために、 Twitter コモン・ライブラリ(最近オープンソース化された!)を使用している。
The I/O thread that is processing the query is freed when all the back-end requests have been dispatched. A timer thread checks every few milliseconds to see if any of the back-end responses have returned from remote servers and sets a flag indicating if the request succeeded, timed out, or failed. We maintain one object over the lifetime of the search query to manage this type of data.
すべてのバックエンド・リクエストがディスパッチされると、そのクエリーを処理している I/O スレッドが解放される。 タイマー・スレッドは、数ミリ秒ごとにチェックを行い、リモート・サーバーから返されたバックエンド・レスポンスを確認し、トリガーとなったリクエストに対して、succeeded/timed out/failed といったフラグをセットしていく。 私たちのシステムでは、この種のデータを管理するために、サーチ・クエリーのライフタイムをカバーするよう、そのオブジェクトを保持している。
Successful responses are aggregated and passed to the next batch of service handlers in the workflow pipeline. When all responses from the first batch have arrived, the second batch of asynchronous requests are made. This process is repeated until we have completed the workflow or the workflow’s timeout has elapsed.
成功したレスポンスはアグリゲートされ、そのワークフロー・パイプライン内におけるサービス・ハンドラーの、次のバッチに受け渡される。 最初のバッチからの、すべてのレスポンスが到着したとき、非同時性のリクエストにおける 2番目のバッチが作成される。 そのワークフローが完了するまで、あるいは、ワークフローのタイムアウトが経過するまで、このプロセスは繰り返される。
As you can see, throughout the execution of a workflow, no thread busy-waits on I/O. This allows us to efficiently use the CPU on our Blender machines and handle a large number of concurrent requests. We also save on latency as we can execute most requests to back-end services in parallel.
ここまでに確認してきたように、ワークフローの実行を通じて、 I/O 上のスレッド・ビジー待ちは発生しない。つまり、Blender マシン上での CPU 利用および、大量のコンカレント・リクエスト処理において、効率化が実現される。 そして、並列化されたバックエンド・サービスで、大半のリクエストを処理するときには、レイテンシーを抑えることができる。
BLENDER DEPLOYMENT AND FUTURE WORK
To ensure a high quality of service while introducing Blender into our system, we are using the old Ruby on Rails front-end servers as proxies for routing thrift requests to our Blender cluster. Using the old front-end servers as proxies allows us to provide a consistent user experience while making significant changes to the underlying technology. In the next phase of our deploy, we will eliminate Ruby on Rails entirely from the search stack, connecting users directly to Blender and potentially reducing latencies even further.
このシステムに Blender を導入するのと並行して、高品質のサービスを保証するために、従来からの Ruby on Rails フロントエンド・サーバーをプロキシーとして利用し、Blender クラスタへ向けて Thtift リクエストを送っている。 フロントエンド・サーバーをプロキシーとして使用することで、基礎をなすテクノロジーに相当量の変更を施す間も、一貫したユーザー・エクスペリエンスの提供が実現される。 私たちの、次のディプロイ・フェーズでは、このサーチ・スタックから Ruby on Rails を完全に取り除き、ユーザーと Blender のダイレクトな接続を実現し、また、さらなるレイテンシーの低減を目指すだろう。
—@twittersearch
ACKNOWLEDGEMENTS
The following Twitter engineers worked on Blender: Abhi Khune, Aneesh Sharma, Brian Larson, Frost Li, Gilad Mishne, Krishna Gade, Michael Busch, Mike Hayes, Patrick Lok, Raghavendra Prabhu, Sam Luckenbill, Tian Wang, Yi Zhuang, Zhenghua Li.
ーーーーー
いやぁ~~~ 面白かったです。 このポストに関しては、いろいろな方から Twitter でコメントいただきました。 おかげさまで、とても多くの方が注目するアーキテクチャなのだと、実感することができました。 ーーー ![]()
ーーーーー
<関連>
Twitter サーチを 3倍速にする新アーキテクチャとは? _1
Twitter サーチを 3倍速にする新アーキテクチャとは? _2
Twitter サーチを 3倍速にする新アーキテクチャとは? _3
ーーーーー
Blenderに近いアーキテクチャになっているMessage Pack RPCのJava版の実装
Talk about Scala – SlideShare ( @yasushia さんより)
Twitter における、Ruby から Java への回帰とは?
ーーーーー
Twitter は 毎日、46万ユーザーを増やし、1億 4000万ツイートを発信する
TOPSY の Twitter 分析 API は、5 億クエリー/月 を処理する!
Twitter が、新しいデータセンターへの移行を完了
Happy Birthday Twitter – 5 歳になりました!
Twitter サーチを 3倍速にする新アーキテクチャとは? _2
Twitter Search is Now 3x Faster
Wednesday, April 6, 2011
http://engineering.twitter.com/2011/04/twitter-search-is-now-3x-faster_1656.html
ーーーーー
初めての方は、1 をお先に ど~ぞ。三部作になっています。
Twitter サーチを 3倍速にする新アーキテクチャとは? _1
Twitter サーチを 3倍速にする新アーキテクチャとは? _2
Twitter サーチを 3倍速にする新アーキテクチャとは? _3
ーーー ![]()
ーーーーー
BLENDER OVERVIEW
Blender is a Thrift and HTTP service built on Netty, a highly-scalable NIO client server library written in Java that enables the development of a variety of protocol servers and clients quickly and easily. We chose Netty over some of its other competitors, like Mina and Jetty, because it has a cleaner API, better documentation and, more importantly, because several other projects at Twitter are using this framework. To make Netty work with Thrift, we wrote a simple Thrift codec that decodes the incoming Thrift request from Netty’s channel buffer, when it is read from the socket and encodes the outgoing Thrift response, when it is written to the socket.
Blender とは、Netty 上に構築された Thrift と HTTP のサービスであり、Java で記述されたスケーラブルな NIO クライアント・サーバライブラリにより、多様なプロトコルを用いるサーバーとクライアントを、迅速かつ容易に開発していく。たとえば、Mina や Jetty なども提供されるコンペティションの中から Netty を選んだ理由としては、整理された API や、洗練されたドキュメントなどが挙げられるが、それらよりも重要なのは、Twitter ににおける他のプロジェクトが、このフレームワークを用いている点にある。 Netty と Thrift を組み合わせるために、Netty のチャネル・バッファからの incoming Thrift のリクエストをデコードする、シンプルな Thrift コーデックを記述した。それは、ソケットからの読み込みと、outgoing Thrift レスポンスをエンコードするとき、また、ソケットへの書き込みを行うときに機能する。
Netty defines a key abstraction, called a Channel, to encapsulate a connection to a network socket that provides an interface to do a set of I/O operations like read, write, connect, and bind. All channel I/O operations are asynchronous in nature. This means any I/O call returns immediately with a ChannelFuture instance that notifies whether the requested I/O operations succeed, fail, or are canceled.
Netty は、Channel と呼ばれる重要な抽象概念を定義する。それにより、read/write/connect/bind といった I/O オペレーションを設定する、インターフェイスのためのネットワーク・ソケットへの接続がカプセル化される。 すべての Channel I/O オペレーションは、本質的に非同期である。つまり、あらゆる I/O コールが、要求された I/O オペレーションが succeed/fail/canceled されたことを通知する、ChannelFuture インスタンスを直ちに返すことになる。
When a Netty server accepts a new connection, it creates a new channel pipeline to process it. A channel pipeline is nothing but a sequence of channel handlers that implements the business logic needed to process the request. In the next section, we show how Blender maps these pipelines to query processing workflows.
Netty サーバーが新しいコネクションを受け入れるとき、その処理のためお、新しいチャンネル・パイプラインが作成される。 このチャネル・パイプラインは、リクエストを処理するために必要なビジネス・ロジックを実装する、チャネル・ハンドラーのシーケンスに過ぎない。次のセクションでは、それらのパイプラインと、クエリー処理ワークフローを、Blender がマップする方式を説明する。
WORKFLOW FRAMEWORK
In Blender, a workflow is a set of back-end services with dependencies between them, which must be processed to serve an incoming request. Blender automatically resolves dependencies between services, for example, if service A depends on service B, A is queried first and its results are passed to B. It is convenient to represent workflows as directed acyclic graphs (see below).
Blender において、ワークフローとは総合に依存するバックエンド・サービスのセットのことであり、incoming リクエストを取り扱うために処理されるものとなる。 そして Blender は、それらのサービス間の依存性を自動的に解決する。 たとえば、Service A が Service B に依存している場合には、最初に A がクエリーされ、その結果が B に手渡される。このワークフローを、非環式の有向グラフを用いて表現すると解りやすい(以下を参照)。
Sample Blender Workflow with 6 Back-end Services
In the sample workflow above, we have 6 services {s1, s2, s3, s4, s5, s6} with dependencies between them. The directed edge from s3 to s1 means that s3 must be called before calling s1 because s1 needs the results from s3. Given such a workflow, the Blender framework performs a topological sort on the DAG to determine the total ordering of services, which is the order in which they must be called. The execution order of the above workflow would be {(s3, s4), (s1, s5, s6), (s2)}. This means s3 and s4 can be called in parallel in the first batch, and once their responses are returned, s1, s5, and s6 can be called in parallel in the next batch, before finally calling s2.
上記のサンプル・ワークフローには、相互に依存する 6つの Service {s1, s2, s3, s4, s5, s6} がある。s3 から s1 へ向けられた方向性を持つエッジは、s1 をコールする前に s3 をホールする必要性を示している。 その理由は、s1 が s3 の結果を要求する点にある。 このようなワークフローを前提として、Blender フレームワークは、それぞれの Service がコールされる順番を決定するために、DAG 上でのトポロジカル・ソートを行なう。 上記のワークフローにおける実行の順序は、{(s3, s4), (s1, s5, s6), (s2)} となるはずだ。つまり、最初のバッチにより、s3 と s4 をパラレルにコールできる。続いて、それらからのリターンの後に、s1 と s5 と s6 をパラレルにバッチ処理し、最後に s2 をコールする。
Once Blender determines the execution order of a workflow, it is mapped to a Netty pipeline. This pipeline is a sequence of handlers that the request needs to pass through for processing.
Blender がワークフローの実行順序を決定した後に、Netty パイプラインとのマップが行われる。 このパイプラインは、全体的な処理を通じて、受け渡しが必要なリクエストを、処理するためのシーケンスとなる。
ーーーーー
昨日の、okachimachiorz1 ジェイムズ・ブッカー先生によりますれば、『 Blenderすか。非同期+DAG+Scalaですか。まさにクラウド型のアーキテクチャです。 要チェックですな 』 とのことです。 なる! ーーー ![]()
ーーーーー
<関連>
Twitter サーチを 3倍速にする新アーキテクチャとは? _1
Twitter サーチを 3倍速にする新アーキテクチャとは? _2
Twitter サーチを 3倍速にする新アーキテクチャとは? _3
ーーーーー
Blenderに近いアーキテクチャになっているMessage Pack RPCのJava版の実装
Talk about Scala – SlideShare ( @yasushia さんより)
Twitter における、Ruby から Java への回帰とは?
ーーーーー
Twitter は 毎日、46万ユーザーを増やし、1億 4000万ツイートを発信する
TOPSY の Twitter 分析 API は、5 億クエリー/月 を処理する!
10億人のユーザーを目指す、Twitter の 6つの戦略とは?
日本の大震災で証明された Twitter と Facebook の SOS パワー
Twitter が、新しいデータセンターへの移行を完了
Happy Birthday Twitter – 5 歳になりました!
Twitter サーチを 3倍速にする新アーキテクチャとは? _1
Twitter Search is Now 3x Faster
Wednesday, April 6, 2011
http://engineering.twitter.com/2011/04/twitter-search-is-now-3x-faster_1656.html
ーーーーー
三部作になっています。続編も ど~ぞ。
Twitter サーチを 3倍速にする新アーキテクチャとは? _1
Twitter サーチを 3倍速にする新アーキテクチャとは? _2
Twitter サーチを 3倍速にする新アーキテクチャとは? _3
ーーー ![]()
ーーーーー
In the spring of 2010, the search team at Twitter started to rewrite our search engine in order to serve our ever-growing traffic, improve the end-user latency and availability of our service, and enable rapid development of new search features. As part of the effort, we launched a new real-time search engine, changing our back-end from MySQL to a real-time version of Lucene. Last week, we launched a replacement for our Ruby-on-Rails front-end: a Java server we call Blender. We are pleased to announce that this change has produced a 3x drop in search latencies and will enable us to rapidly iterate on search features in the coming months.
2010年の春のことだが、 Twitter におけるサーチ・チームは、そのサーチ・エンジンを書き直し始めた。 その理由は、永遠に増大していくトラフィックに対処し、エンドユーザーにおけるレイテンシーとサービスの可用性を改善し、新しいサーチ機能の迅速な開発を可能にする点にあった。 その作業の一部として、Twitter のバックエンドを、MySQL から Lucene のリアルタイム・バージョンに変更することで新しいリアルタイム・サーチ・エンジンを立ち上げている。 そして先週、私たちは Ruby-on-Rails のフロントエンドを、Blender という Java サーバーに置き換えた。 この変更により、サーチ・レイテンシーを 1/3 に低減し、今後の数ヶ月という短い期間において、いくつかのサーチ機能を改善していけるようになった。 このような発表ができて、とても嬉しく思う。
PERFORMANCE GAINS
Twitter search is one of the most heavily-trafficked search engines in the world, serving over one billion queries per day. The week before we deployed Blender, the #tsunami in Japan contributed to a significant increase in query load and a related spike in search latencies. Following the launch of Blender, our 95th percentile latencies were reduced by 3x from 800ms to 250ms and CPU load on our front-end servers was cut in half. We now have the capacity to serve 10x the number of requests per machine. This means we can support the same number of requests with fewer servers, reducing our front-end service costs.
Twitter サーチは、1日あたり 10億以上のクエリーをサポートするという、最も多くのトラフィックを発生させるサーチ・エンジンの 1つである。 この Blender をディプロイする前の週に、日本における #tsunami により、著しいクエリーが発生し、サーチ・レイテンシーに大きなピークが生じた。 そして、この Blender の立ち上げの後には、私たちの 95 パーセンタイル・レイテンシが、800ms から 250ms へと、約 1/3 に低減された。 さらに、フロントエンド・サーバー上の CPU 負荷は、半分にカットされた。 そして、今では、マシンごとのリクエストに関するキャパシティを、10 倍に引き上げる能力を持つに至った。 それにより、以前と同じだけのリクエスト量を、より少ないサーバー台数で処理することが可能となり、フロントエンド・サーバーに関するコストも低減できるようになった。
95th Percentile Search API Latencies Before and After Blender Launch
TWITTER’S IMPROVED SEARCH ARCHITECTURE
In order to understand the performance gains, you must first understand the inefficiencies of our former Ruby-on-Rails front-end servers. The front ends ran a fixed number of single-threaded rails worker processes, each of which did the following:
このパフォーマンス向上の理由を理解するには、以前の Ruby-on-Rails フロントエンド・サーバーの非効率について、最初に理解しなければならない。 このフロントエンドは、固定した数のシングル・スレッド Rails Worker プロセスを実行してており、個々のスレッドは以下の項目を処理していく:
- parsed queries
- queried index servers synchronously
- aggregated and rendered results
- パーズされたクエリー
- クエリーされたインデックスのサーバー間同期
- アグリゲーションとレンダリングの結果
We have long known that the model of synchronous request processing uses our CPUs inefficiently. Over time, we had also accrued significant technical debt in our Ruby code base, making it hard to add features and improve the reliability of our search engine. Blender addresses these issues by:
この同期プロセス処理のモデルが、CPU 非効率に消費していることを、私たちは以前から認識していた。 そして、長い時間を経ることで、この Ruby コードベース上にテクニカルな負債を大量に蓄積しており、サーチ・エンジンにおける信頼性の改善や、新しい機能の追加を難しくしていた。 そして、Blender により、以下の問題に取り組んでいる:
- Creating a fully asynchronous aggregation service. No thread waits on network I/O to complete.
- Aggregating results from back-end services, for example, the real-time, top tweet, and geo indices.
- Elegantly dealing with dependencies between services. Workflows automatically handle transitive dependencies between back-end services.
- 完全な、非同期アグリゲーション・サービスの構築。ネットワーク I/O の終了を、スレッドが待たない方式。
- バックエンド・サービスからの結果をアグリゲート。 たとえば、リアルタイムや、トップ・ツイート、地理インデックスなど。
- サービス間の依存性を、エレガントに取り扱う。 Workflows は、バックエンド・サービス間における、推移的な依存性を自動的に処理する。
The following diagram shows the architecture of Twitter’s search engine. Queries from the website, API, or internal clients at Twitter are issued to Blender via a hardware load balancer. Blender parses the query and then issues it to back-end services, using workflows to handle dependencies between the services. Finally, results from the services are merged and rendered in the appropriate language for the client.
以下のダイアグラムは、Twitter サーチ・エンジンのアーキテクチャを示す。 Twitter における Webサイト/API/内部クライアントからのクエリーは、ハードウェア・ロードバランサーを介して Blender に発行される。 Blender により解析されたクエリーは、サービス間に依存性を処理するワークフローを用いて、バックエンド・サービスへと発行される。最終的に、このサービスからの結果がマージされ、対象となるクライアントに適した言語でレンダリングされる。
Twitter Search Architecture with Blender
ーーーーー
大好評だった、昨日のポスト 『 Twitter における、Ruby から Java への回帰とは? 』の元ネタは、この Twitter Blog の記事です。 長いので、とりあえず Part_1 としてポストします。なお、Twitter で頂いたコメントは、Facebook Page に整理しています。 ーーー ![]()
ーーーーー
<関連>
Twitter サーチを 3倍速にする新アーキテクチャとは? _1
Twitter サーチを 3倍速にする新アーキテクチャとは? _2
Twitter サーチを 3倍速にする新アーキテクチャとは? _3
ーーーーー
Blenderに近いアーキテクチャになっているMessage Pack RPCのJava版の実装
Talk about Scala – SlideShare ( @yasushia さんより)
Twitter における、Ruby から Java への回帰とは?
ーーーーー
Twitter は 毎日、46万ユーザーを増やし、1億 4000万ツイートを発信する
TOPSY の Twitter 分析 API は、5 億クエリー/月 を処理する!
10億人のユーザーを目指す、Twitter の 6つの戦略とは?
日本の大震災で証明された Twitter と Facebook の SOS パワー
Twitter が、新しいデータセンターへの移行を完了
Happy Birthday Twitter – 5 歳になりました!
Twitter における、Ruby から Java への回帰とは?
Once Again, Twitter Drops Ruby for Java
By Alex Williams / April 11, 2011 4:00 PM
http://www.readwriteweb.com/cloud/2011/04/twitter-drops-ruby-for-java.php
ーーーーー
<元ネタです>
Twitter サーチを 3倍速にする新アーキテクチャとは? _1
Twitter サーチを 3倍速にする新アーキテクチャとは? _2
Twitter サーチを 3倍速にする新アーキテクチャとは? _3
ーーーーー
Twitter has now moved its entire search stack from Ruby-on-Rails to Java. That’s a big shift. Twitter moved its back end message que from Ruby to Scala, a Java platform in the 2008-2009 time frame. The move was attributed to issues with reliability on the back-end. This latest move makes the shift pretty much complete. At Twitter, Ruby is out of the picture.

Twitter のサーチ・スタック全体が、Ruby-on-Rails から Java に移行された。 まさに、大きな変更である。 具体的に言うと、Twitter のバックエンド・メッセージ・キューが Ruby から、2008-2009 タイムフレームにおける Java プラットフォームである、Scala に移行したことになる。 この変化は、バックエンドにおける信頼性の問題に起因すると思われる。 この、最近に実施された変更は、その大方を完了し、Twitter からは Ruby が消えることになる。
Twitter explains the change on its engineering blog:
Last week, we launched a replacement for our Ruby-on-Rails front-end: a Java server we call Blender. We are pleased to announce that this change has produced a 3x drop in search latencies and will enable us to rapidly iterate on search features in the coming months.
Twitter の engineering blog では、この変更について、以下のように説明されている:
Last week, we launched a replacement for our Ruby-on-Rails front-end: a Java server we call Blender. We are pleased to announce that this change has produced a 3x drop in search latencies and will enable us to rapidly iterate on search features in the coming months.
先週のことだが、Ruby-on-Rails によるフロントエンドを、Blender と呼ぶ Java サーバーに置き換えた。 この変更により、サーチのレイテンシーが 1/3 に抑えられたことを発表できて嬉しい。 そして、今後の数ヶ月のうちに、複数のサーチ機能について、迅速なイテレーションが可能となる。
Does this mean that Java is better than Ruby for services with heavy loads?
つまり、大きな負荷を伴うサービスに関しては、Ruby よりも Java の方が適しているのだろうか?
Ganeshji Marwaha, director at Triomatrix Webservices, says it all depends:
Wow, that is quite an achievement. Could this mean that Java is a better platform than Rails for high scalability needs? Even if that is the case, for simpler scenarios, the beauty of RoR out-weighs Java’s performance.
They say that this change will enable them to rapidly iterate on search features in the coming months. That along with the news that Twitter has hired 25 more employees kinda tells that Java’s code base is practically more maintainable than equivalent Ruby code – at least when the code base is huge and the team size is large. Or that could mean that this time they really put a lot of thought into designing a maintainable system than when they started out. But for smaller team size and code base, RoR is still an unbeaten champion.
Triomatrix Webservices のディレクターである Ganeshji Marwaha は、すべてが依存すると発言している:
Wow ! それは、なかなかの成果だ。 それにより、高度なスケーラビリティの要求において、Java が Rails よりも優れたプラットフォームであると、捉えられるのだろうか? たとえ、そのようなケースであるにしても、よりシンプルなシナリオにおいては、RoR の美しさが Java のパフォーマンスに勝る。
Twitter は、今後の数ヶ月のうちに、複数のサーチ機能について、迅速なイテレーションが可能になると言っている。 この、Twitter が 25人の技術者を採用したというニュースによると、Java と Ruby のコードを比較して、Java の方がメンテナンスしやすいと捉えられる。少なくとも、そのコードベースが巨大である、さらにチームの規模が大きいときには、そうなる。 また、今回の変更においては、Twitter がスタートしたときと比べて、さらにメンテナンスが容易になる、たくさんの新しいアイデアが投入されたのかもしれない。 しかし、小規模なコードベースとチームを前提にするなら、依然として RoR が無敵のチャンピオンである。
You can read the full account about the new search capabilities with Java on the Twitter blog post. It goes into detail about the changes and the benefits that it is seeing with the switch.
なお、Twitter のブログ・ポストで、Java を用いた新しいサーチ機能に関する、詳細な記述が読める。 そこでは、今回の切り替えにおける、変更とメリットに関する細部が述べられている。
ーーーーー
先日の 『 MySpace を殺したのは Microsoft ソフトウェア・スタックなのか? いや、それは違うだろう 』 では、Twitter においても RoR を、そのまま使っていることなどあり得ないと、Todd Hoff さんが説明していました。そして、今回の変更は、Java への回帰という、とても興味深いものになっています。 MySpace の失速も、開発のための環境やツールを、使いこなせる人材の確保の難しさが原因とのことであり、ハイ・スケーラビリティの難しさを感じさせてくれます。ーーー ![]()
ーーーーー
<関連>
Twitter は 毎日、46万ユーザーを増やし、1億 4000万ツイートを発信する
TOPSY の Twitter 分析 API は、5 億クエリー/月 を処理する!
10億人のユーザーを目指す、Twitter の 6つの戦略とは?
日本の大震災で証明された Twitter と Facebook の SOS パワー
Twitter が、新しいデータセンターへの移行を完了
Happy Birthday Twitter – 5 歳になりました!
Facebook は 20分間で、2.7M Photos/10.2M Comments/4.6M Messages を処理する!
Facebook in 20 Minutes: 2.7M Photos, 10.2M Comments, 4.6M Messages
Friday, December 31, 2010 at 7:37AM
http://highscalability.com/blog/2010/12/31/facebook-in-20-minutes-27m-photos-102m-comments-46m-messages.html
このポストは、以下のリンクにある 『 A Snapshot of Facebook in 2010 』 のデータを元にしているようです。 そちらを見ると 『 Most Liked Celebrities 』もあり、『 Lady Gaga : 24,712,169 people like 』 というデータなども参照できます。 ーーー A.C.
ーーーーー
To celebrate the new year Facebook has shared the results of a little end of the year introspection. It has been a fecund year for Facebook:
Facebook は新年を祝うために、その内部情報の一部を提供してくれた。 2010 年は、Facebook にとって、実り多き年だったことが分かる:
- 43,869,800 changed their status to single
- 3,025,791 changed their status to “it’s complicated”
- 28,460,516 changed their status to in a relationship
- 5,974,574 changed their status to engaged
- 36,774,801 changes their status to married
If these numbers are simply to large to grasp, it doesn’t get any better when you look at happens in a mere 20 minutes:
上記の数字が、あまりにも大きすぎて把握しにくい場合には、Facebook の 20分間に起こる、以下の事象に注目するほうが良いだろう:
- Shared links: 1,000,000
- Tagged photos: 1,323,000
- Event invites sent out: 1,484,000
- Wall Posts: 1,587,000
- Status updates: 1,851,000
- Friend requests accepted: 1,972,000
- Photos uploaded: 2,716,000
- Comments: 10,208,000
- Message: 4,632,000
If you want to see how Facebook supports these huge numbers take a look at a few posts.
このように膨大なスケールを、どのようにして Facebook が処理しているのか、その方式を知りたい場合には、これまでのポストを参照して欲しい。
One wonders what the new year will bring?
新しい年になり、いったい何が起こるのだろうか?
Related Articles
- What the World Eats from Time Magazine
- A Day in the Life of an Ancient Roman
- A Day in the Life of Donald Duck
- The Beatles- A Day in the Life
- A Day in the Life of Xena Warrior Princess
- Life in a Day on YouTube
ーーーーー
ほんとに、今年は何を見せてくれるのでしょうかと、誰もが期待していまう Facebook ですねぇ ~~~ ![]()
ーーーーー
ーーーーー
<関連>
2010 年の ビジター数(全米)で、Facebook が Google を追い抜く!
Facebook のスケール感覚に驚愕!
Facebook の HDFS クラスターは 21 PB !!!
Facebook 探検隊: どのようなソフトウェアでスケールを達成しているのか
Facebook の HBase は、毎月 1350億 メッセージを処理する!
Facebook における 1300万/秒 クエリーの秘密
Facebook の データセンター戦略に関する FAQ


































































































1 comment