Agile Cat — in the cloud

August 24, 2010

ARM サーバー DC の 一番手が Facebook になるというウワサ

Filed under: Facebook,Green IT — Agile Cat @ 8:53 pm
Tags: , , , , ,

Facebook is the first to jump into ARM servers
Tectonic change of our time
by Charlie Demerjian
August 23, 2010
http://semiaccurate.com/2010/08/23/facebook-first-jump-arm-servers/

9055c55b-cc5f-4bb0-8fe6-24c018f466eb

THERE HAVE LONG been rumors of a major player moving their data centers from x86 based PCs to the ARM architecture. It looks like the first big player to jump in to the market is going to be none other than Facebook.

メジャーなプライヤーたちが、そのデータセンターを x86 ベース PC から、 ARM アーキテクチャに移行していくというウワサが、長いこと囁かれていた。 そのマーケットに最初に飛び込んでいくのは、ほかでもない Facebook になるのかもしれない。

If the rumors are true, Facebook will be putting ARM based servers in their upcoming Oregon data center, dumping x86 in a nearby river. In an environmentally friendly fashion, it is Oregon after all. In any case, there won’t be any x86 parts needed at the privacy specialists.

image

このウワサが本当なら、Facebook は建設中の Oregon データセンターに ARM ベースのサーバーを押し込み、そこらの川に x86 は投げ捨ててしまうだろう。 環境に優しいスタイルは、結局のところ、Oregon 以降になる。 いずれにしても、プライバシー・スペシャリストの領域では、x86 パーツは必要とされないだろう。

What ARM chip are they going to be using? This is where the game of connect the dots begins, and all the rumors point to Smooth-Stone, an Austin, Tx chip design startup. A few more rumors link the boards to SuperMicro, but that link is a bit more tenuous. In any case, it won’t be long before all the details are revealed.

どの ARM チップが採用されるのだろうか? そこが、点から線へのゲームの始まりだ。そして、すべてのウワサは Smooth-Stone という Austin, Tx のスタートアップ企業を示している。 SuperMicro につながるウワサもあるが、その線は薄いだろう。 いずれにしても、詳細が明らかにされるのに、それほど時間はかからないだろう。

It looks like ARM has grown up enough in raw CPU power to hit the proverbial ‘fast enough’ point for a single Facebook thread. Now it becomes a question of wattage vs threads. An Intel/AMD x86 CPU runs more threads but consumes more watts. The wattage per thread appears to have come down on the side of ARM, at least for Facebooks PHP-ish code.

Facebook のシングル・スレッドについて言われる、充分な速度を満たすという基準にまで、ARM の CPU パワーが成長したように思える。 そしていま、最大の関心事は、消費電力 vs. スレッドに変化する。Intel / AMD の x86 CPU は、より多くのスレッドを同ライブするが、より多くの電力も消費する。Facebooks の PHP ライクなコードにより、 スレッドごとの Watt 数は、少なくとも ARM の側に傾いてきたのだろう。

The thought of this will scare Intel silly, not only did they lose a contract potentially for tens of thousands of Xeons a month because of power, but they didn’t win it with Atom. In fact, they lost it to the one rival that they don’t have a direct answer to, the ARM ISA.

Facebooks の PHP ライクなコードにより、 スレッドごとの Watt 数は、少なくとも ARM の側に傾いてきたのだろう。 こうした発想により、Intel は狼狽するだろう。なぜなら、何万もの Xeon を 1ヶ月に販売するという契約を失うだけではなく、Atom をもってしても、ARM には歯が立たないからだ。 実際のところ、ARM ISA への対案を持てないという点で、このライバルに対して、Intel は遅れをとっている。

If Facebook’s experiment pans out, it may change how things are done in the data center, and collapse prices. Actually, since Facebook is moving to ARM, it isn’t an experiment, so you can substitute all of the forward looking statements with more definitive ones. Things have changed in the data center, you just haven’t seen the results yet.

もし、この Facebook の実験が成功するなら、データセンターの方向性に変化を与え、価格を圧縮するかもしれない。 実際に、 Facebook が ARM に移行しているなら、それは既に実験ではなく、最も確実な方式により、すべての憶測を、前向きなものに置き換えることになる。 まだ、その結果を目にしてはいないが、データセンターにおける事象が変化していく。

ーーーーー

Facebook  の Oregon データセンターは、環境保護団体 GreenPeace のターゲットにされているので、こうした対応が急がれるのかもしれません。 それにしても、Facebook のような超大規模なサービスともなると、バックエンドでユックリと処理すればよいことが多々あるはずで、そこに x86 を用いるのは愚の骨頂だと、誰もが認めるように成りつつありますね。 ーーー A.C.

ーーーーー

<関連>
Facebook の幹部が、ARM サーバーのウワサを否定
Smooth-Stone はホンモノか? – ARM チップで Intel とは別次元のデータセンターを目指す
ARM チップで 省電力データセンターを – Smooth-Stone が巨額の資金を調達
ARM サーバーについて – 日本語記事のマトメ・ページです
ARM – データセンターから Intel を たたき出せ!
Facebook と Greenpeace : Oregon のデータセンターをめぐって対峙
環境保護団体グリーンピースから、クラウド・コンピューティング業界へ提言

Dryad が DAG をつかう理由 – Dryad & DryadLINQ Team Blog

Filed under: Hadoop,MS-MapReduce — Agile Cat @ 7:42 pm
Tags: , , , , , , , , , ,

Why does Dryad use a DAG? – Dryad & DryadLINQ Team Blog
http://blogs.msdn.com/b/dryad/archive/2010/07/23/why-does-dryad-use-a-dag.aspx

image

The basic computational model we decided to adopt for Dryad is the directed-acyclic graph (DAG). Each node in the graph is a computation, and each edge in the graph is a stream of data traveling in the direction of the edge. The amount of data on any given edge is assumed to be finite, the computations are assumed to be deterministic, and the inputs are assumed to be immutable. This isn’t by any means a new way of structuring a distributed computation (for example Condor had DAGMan long before Dryad came along), but it seemed like a sweet spot in the design space given our other constraints.

私たちが Dryad に適用することに決めた基本的な計算モデルは、DAG(directed-acyclic graph:有向非巡回グラフ)である。 このグラフにおける個々のノードで計算が行われ、また、グラフにおける個々のエッジが、その方向をデータを送り出すストリームとなる。 あらゆるエッジ上のデータ量は有限と想定され、また、その計算は決定論的なものと想定され、入力は不変であると想定されるべきである。 それは、分散された計算を構成するための新しい方法ではないが(たとえば Dryad が登場するずっと以前に、CondorDAGMan を有している)、他の制約を持つデザイン・スペースにおけるスイート・スポットだと想定される。

So, why is this a sweet spot? A DAG is very convenient because it induces an ordering on the nodes in the graph. That makes it easy to design scheduling policies, since you can define a node to be ready when its inputs are available, and at any time you can choose to schedule as many ready nodes as you like in whatever order you like, and as long as you always have at least one scheduled you will continue to make progress and never deadlock. It also makes fault-tolerance easy, since given our determinism and immutability assumptions you can backtrack as far as you want in the DAG and re-execute as many nodes as you like to regenerate intermediate data that has been lost or is unavailable due to cluster failures.

それは、なぜ、スイート・スポットになるのだろうか? DAG の利便性の高さは、グラフ内にノードの順序を取り込んでいる点にある。 そのため、入力に際してノードが行うべきことを定義できるようになるため、スケジューリング・ポリシーのデザインが容易になる。そして、準備が済んでいる大量のノードを、どんな時にでも希望する順序のとおりに選択して、スケジューリングすることが可能となる。さらに、少なくとも 1つのスケジュールされたノードがある限り、その処理は継続され、また、デッドロックが起こることはないだろう。また、私たちの決定性と普遍性の仮説を前提として、DAG  内の任意の場所をバックトラックできるため、フォールト・トレランスも容易になる。なお、クラスタの失敗などにより、消失あるいは利用不能になってしまった中間データを再生したいする場合には、それに見合うだけのノードを再実行できる。

image

クリックで拡大 ⇒
https://nosqleast.com/2009/slides/yu-dryad.pdf より

The obvious way to generalize the DAG model would be to allow cycles in the graph, but that makes both scheduling and fault-tolerance more complicated. They are still possible, but we decided to go with the simpler approach and see what we ended up being able to do with it; and leave as a research question the extent to which adding cycles would be useful.

DAG モデルを普及させるには、そのグラフでの巡回を許す方式が明らかに有効だろうが、ケジューリングとフォールト・トレランスがさらに複雑になってしまう。それを実現する可能性も残されているが、私たちの決定においては、より単純なアプローチを選択し、その結果を見届けることになった。つまり、巡回を追加する有用性については、研究課題として残すことに決定した。

On the other hand, there’s no obvious way to restrict the DAG model that makes the underlying system any simpler. Although MapReduce is I think a simpler programming model than Dryad, arguably the system itself is, at least conceptually, more complicated, since the Map nodes and the Reduce nodes have different scheduling and fault-tolerance properties and implementations. In addition when the system wants to optimize some data transfer, e.g. building an aggregation tree or sampling a dataset to find a balanced range partition, the optimization can usually be expressed as a subgraph of a DAG, and doesn’t need to be “hand-rolled” the way it would if you wanted to add it to a system like Hadoop. So the big advantage of adopting a general DAG as the low-level computational abstraction is that there’s just one state machine that handles all computation nodes. Of course, any real implementation of MapReduce or a DAG-driven system like Dryad can get complicated, but the topology of the data flow is not in itself a source of complexity in Dryad.

その一方で、基本的なシステムをシンプルにするために、DAG モデルを制約していく明白な方法は存在しない。 おそらく、MapReduce は Dryad よりも単純なプログラミング・モデルだと思われるが異なるスケジューリングとフォールト・トレランスのプロパティおよび実装を、Map ノードと Reduce ノードが有するため、少なくともシステム自身は、概念的に複雑なものとなる。 それに加えて、たとえば、アグリゲーション・ツリーの構築や、バランスのとれたレンジのパーティションを見つけるためのデータセットのサンプリングといった、データ転送に関する最適化をシステムが要求することがある、そのときに、この最適化は DAG のサブ・グラフとして表現できるが、たとえば Hadoop のようなシステムに加えようとするなら、そこで望まれる “hand-rolled”  の方式を取り入れる必要がなくなってしまう。したがって、一般的な DAG を低レベルの計算抽象概念として採用する大きいアドバンテージは、すべての計算ノードを取り扱う 1つのステート・マシンが、そこに存在するという点に集約される。 もちろん、 現実に実装するとき、MapReduce や、Dryad などの DAG 駆動システムは、複雑なものになり得る。 しかし、データフロー・トポロジーが、Dryad の複雑さ自身の根本に含まれることはない。

One thing we learned fairly early in the Dryad project was that people don’t want to build DAGs by hand: it’s too low-level, and people don’t want to have to learn to think about how to think about their algorithms in terms of dataflow graphs. So this seems like it might be a disadvantage of something like Dryad compared with MapReduce, whose simple programming model is often touted as its big advantage. But with a couple of years of experience, and having talked to a lot of people in academia and industry who have been using Hadoop, I’m not sure that’s really true. In practice, once you get beyond a coursework assignment, most interesting computations cannot be expressed purely as a single Map followed by a single Reduce. Instead, it turns out, you typically need to take the output of the first Reduce and do another round of Map and another round of Reduce, and so on. Often you are trying to write an iterative algorithm (e.g. something like k-means) or very commonly you need to do something like a Join that combines information from two input sets. Join is the basic construct that is used for most graph traversal algorithms (you are combining data at the nodes with an edge map), and it is also used all over the place when there are common subexpressions in a computation: the common result is computed once and then “joined” with other data several times as necessary.

Dryad プロジェクトの早期において、私たちが正しく学んだ 1つに、人々が手作業で DAG を構築したがらないという事があった。 つまり、あまりにも低レベル過ぎるという事であり、データフロー・グラフの観点で、そのアルゴリズムについて学習しようと望まないことであった。 その単純なプログラミング・モデルが、大半のケースでアドバンテージとして推奨される MapReduce との比較において、そのことが Dryad のようなテクノロジーの、ディスアドバンテージになっているのかも知れない。 ただし、この 2年間のエクスペリエンスにおいて、そして Hadoop を使用している学界と業界とのディスカッションにおいて、それが本当に本当であるとは確信していない。 実際のところ、教科書的なレベルを超えると、大半の興味深い処理が、単一の Map と Reduce の組み合わせでは、表現できなくなるだろう。 それに換えて、最初の Reduce の出力を取得し、別の Map と Reduce へと展開していく必要性が導かれる。 大半のケースにおいて、反復性のアルゴリズム(たとえば k-means など)の記述や、きわめて一般的な Join  のようなものを用いた、2つの入力セットに基づく情報の結合などが必要となる。 Join は、大半のグラフ横断型アルゴリズム(データ・ノードにおいてデータとエッジ・マップを結合)において用いられる、基本的な概念である。 そして、計算における共通の副次式が存在する場合にも、園周辺で使用される。つまり、共通の結果は一度だけ計算された後に、必要に応じて何度でも、他のデータと " Join " される。

In other words, MapReduce is really too low level for most programming tasks as well; programmers don’t want to have to break up a complicated algorithm into a set of Maps and Reductions, and manually manage all the types and manually write a script to sequentially execute a series of MapReduce jobs. Good evidence for this comes from the proliferation of higher-level language layers that have been built on MapReduce and Hadoop, including Sawzall, PigLatin, HIVE, Cloudbase, and Yahoo!’s Hadoop SQL.

言い換えれば、大半のプログラミング・タスクに対して、MapReduce はあまりにも低レベルすぎる。つまり、プログラマー Map と Reduuce のセットの中に、複雑なアルゴリズムを分解し、また、それらすべての手作業で管理し、一連の MapReduce ジョブを連続して実行するスクリプトを、手作業を書こうとは思わない。その良い証拠が、MapReduce と Hadoop の上に構築された Sawzall/PigLatin/HIVE/Cloudbase/Yahoo! Hadoop SQL などを含む、高レベルい言語レイヤへの拡散である。

So: if programmers aren’t actually directly writing Map and Reduce functions but instead using a higher-level language; and the MapReduce system isn’t easier to implement than a general DAG model (especially once you have added optimizations for things like sorting and hierarchical aggregation and distribution); and the high-level language you write can generate better-performing execution plans when it has access to a general DAG rather than a limited set of constructs such as Map and Reduce, then why would you choose to implement MapReduce over something like Dryad? We don’t think you would, but then we are biased :)

そうだとすると、もしもプログラマーがMapReduce を書きたがらず代わりに高レベルの言語を使うのであれば、また、MapReduceがDAGモデルよりも簡単に書けるのではなければ(とくにひとたびソートや階層的な集約・分散に関しての最適化を加えてしまったりしたときに)、さらには汎用のDAGにアクセスできる高レベルの言語がMapReduceのような限定された構造よりよい性能の実行プランを作れるのであれば、Dryadのようなものの上にMapReduceを実装しようとするだろうか?そうは思えないが考え方が偏っているのかもしれない。 :)

Michael Isard

ーーーーー

コメント欄にあるように、最後の段落ですが、上田さんに校正していただきました訳文に、差し替えました。 おかげさまで、とても読みやすくなりました。 有難うございます。 ーーー A.C.

ーーーーー

これがウワサの、DAG(directed-acyclic graph)ですね。 日本語にすると、有向非巡回グラフ となるのでしょうか? たしかに、たとえば Hadoop などを活用していくと、その Map/Reduce が多段化してくることになり、そのフローを簡潔かつ確実に制御するための仕組みが必要になると思われます。

そのため、Apache は Zookeeper などに取り組むという構図になっているのでしょうが、あくまでも Hadoop の利用を前提としています。 その点、この記事でいうノードの中身なのですが、そこが、どのように考えられているのか、とても興味がありますね。

それと、訳に自身のないところが多々ありで、なにか変なところなど見つかりましたら、ぜひ、お知らせくださ~~~い!ーーー A.C.

ーーーーー

<関連>
MapReduce in DryadLINQ
Windows Azure MapReduce Demo
Hadoop が Microsoft の教材に?
教育機関への Dryad 提供が始まる
Apache ZooKeeper による分散並列キューの構築
Observers と ZooKeeper
Hadoop による Web 広告システムの構築と運用 :ヨーロッパでの事例
Gridmix3 : Apache Hadoop の実運用負荷をエミュレート
Microsoft readying Hadoop for Windows Azure の対訳

HP が Dell の 3割増をオファー – エスカレートする 3PAR 争奪戦

Filed under: Data Warehousing — Agile Cat @ 12:06 am
Tags: , ,

It’s HP vs. Dell in Bidding War for 3PAR
August 23rd, 2010 : Rich Miller
http://www.datacenterknowledge.com/archives/2010/08/23/its-hp-vs-dell-in-bidding-war-for-3par/

DC Knowledge

In the Battle for the Data Center, shareholders of storage provider 3PAR are looming as some of the biggest winners. HP today made a stunning $1.6 billion offer for 3PAR, trumping a $1.1 billion offer from Dell that already represented an 86 percent premium to 3PAR’s share price. The huge premium led some analysts to speculate that there were rival bidders for 3PAR, and Dell was hoping for an over-the-top bid that would be hard to match.

Data Center バトルにおける最大の勝者として、ストレージ・プロバイダーである 3PAR のステークホルダーたちが、その存在感を徐々に現してきている。 今日(8/23)のことであるが、すでに $1.1 billion(この時点で 86% のプレミアム付き)を申し出ている Dell に対抗して、HP が $1.6 billion という、衝撃的なオファーを差し出した。何人かのアナリストは、3PAR を取り合うライバルがいたはずで、その競り合いにDell が勝ったと推測していた。この膨大なプレミアムが、その証拠というわけだ。e727713c-da3c-4a3f-bea7-b01111368148

Not for HP, which has now come off the top rope with a bid that tops Dell by 33 percent. HP’s offer underscores the intensity of the competition between the largest technology companies as they seek to assemble portfolios of integrated offerings for the data center.

images_6

しかし、そのような憶測も、HP には当てはまらない。 Dell に対して、33 % 増しという、最高値を繰り出してきたのだ。 HP のオファーにより際立つのは、最大級のテクノロジー企業間における競合の熾烈さであり、それは、データセンターのために統合化される、ポートフォリオを組み上げていくときに生じる。

“HP’s proposal offers superior value to 3PAR’s shareholders. Our global reach, strong routes to market and commitment to innovation uniquely position HP as the ideal fit for 3PAR,” said Dave Donatelli, executive vice president and general manager, Enterprise Servers, Storage and Networking, HP. “We’ve seen great momentum with our Converged Infrastructure strategy, and 3PAR accelerates that strategy, particularly in cloud and scale-out markets.”

『 HP からの提案は、3PAR のステークホルダーたちに、最大の価値を提供するものだ。 私たちのグローバルな守備範囲および、マーケットにつながる強力な販路、そして、革新を約束する HP のユニークはポジションは、3PAR にとって理想的だ。 私たちの Converged Infrastructure 戦略による、大きな勢いを確認している。そして、とりわけクラウドとスケールアウトの戦略を、3PAR が加速することになる 』と、HP における  Enterprise Servers, Storage and Networking 部門の役員である、Dave Donatelli は発言している。

The HP offer also comes just weeks after the messy departure of CEO Mark Hurd, and will surely prompt additional analysis of the company’s strategy during its leadership transition.

さらに、この HP のオファーは、CEO であった Mark Hurd の不名誉な引退の、わずか数週の間に行われている。したがって、権力の移行期における同社の戦略についても、さまざまな分析をもたらすだろう。

Wall Street traders are anticipating a response from Dell. In pre-market action, shares of 3PAR shares are trading above $25, above HP’s $24 a share offer price. 3PAR shares closed at $9.65 a share on August 13, prior to Dell’ s bid.

Wall Street のトレーダたちは、Dell が反撃すると予想している。 NY の証券市場が開く前の反応としては、3PAR の株価は $ 25以上であり、HP の株価である $24 を上回っている。Dell からのオファーがある前の、8月 13日時点の 3PAR の株価は、$ 9.65 前後だった。

ーーーーー

ヒェ~~~ っという感じの争奪戦が始まったのですね。 Dell の $1.1 billion はキャッシュだという話もあったので、てっきり決まりかと思っていましたが、そうならなかったようですね。 それにしても、1000 億円以上の企業買収が、競り合いになっているという、すざまじい状況ですね。 ーーー A.C.

ーーーーー

<関連>
Dell による 3PAR の買収を分析する
iPhone 4 と iPad で Flash 、、、Mark Hurd 事件など
Intel が McAfee を $7.68 billion で買収! – その理由は?
EMC の Greenplum 買収に関する、今朝の報道
EMC も、ついにクラウドへ本格参入?

August 23, 2010

Facebook を 1.8 倍速に、WordPress を 2.7 倍速にする、HipHop とは ?

Filed under: Facebook — Agile Cat @ 10:18 pm
Tags: , , , , , , , ,

HipHop for PHP: six months later
by
Scott MacVicar on Saturday, August 14, 2010 at 12:42am
http://www.facebook.com/note.php?note_id=416880943919

8d84663f-1669-4a2f-89b1-f954e342c8ec

It’s been six months since we released HipHop and I wanted to share an update on its progress. In February we released 693,613 lines of source code which on average reduced our CPU usage here at Facebook by about 50%. Since February, the team has made HipHop another 1.8 times faster and all of that code is open source. We’ve also seen improvements to PHP itself with the additions to PHP’s trunk in April being about 10% faster than 5.3.

私たちが HipHop をリリースしてから 6ヶ月が経過したが、その進歩におけるアップデートを共有したいと思う。 この 2月には 693,613 行のソースコードをリリースしたが、それにより、Facebook における CPU の使用量が、平均で 50% ほど低減した。 その後、このチームは、HipHop を 1.8 倍ほど高速化することに成功し、また、それらのコードは、すべてオープンソース課されている。 さらに、4 月に PHP のトランクに付け加えたときには、PHP 自身が 5.3 と比べて 約 10% ほど高速化されているのも確認した。

Over the past few months we’ve worked with the Drupal, MediaWiki, phpBB and WordPress teams to get their software running under HipHop. This really means helping them remove some dynamic code and fixing bugs found by the compiler. Today Drupal.org and WikiPedia are all testing versions of their sites under HipHop, with others having plans to do so soon. While this statistic isn’t final, we found WordPress has become 2.7x faster when running under HipHop.

この数ヶ月の間に、HipHop 上でソフトウェアを実行するために、Drupal や、MediaWikiphpBB、そして WordPress のチームと共同で作業してきた。 いくつかの動的なコードを削除し、コンパイラにより発見されたバグを修正しながら、彼等をサポートすることは、ほんとうに意味のあることだった。 ちょうどいま、Drupal.org と WikiPedia は、彼等のサイトにおける、すべての HipHop バージョンをテストしてる。 そして、他の仲間たちも、すぐにテストに入る予定だ。HipHop 上の WordPress が、2.7 倍ほど速くなったと認識しているが、その数値は最終的なものではない。

From a community perspective, there have been about fifteen external patches submitted that went straight into trunk and about another five that focused on the open source build system. The speed of these patches have started to increase in the past month. As ocProducts started using HipHop in production, they reported a small number of crash bugs which we hadn’t yet encountered in production but likely would have in the future. Chris Graham ran RoadSend and phpc test suites against HipHop which resulting in it our passing 98% of tests and forty language oriented bug reports.

コミュニティという視点から見ると、外部から提供され、そのままトランク入りした 15 のパッチがあり、その他にも、オープンソースの構築システムにフォーカスした 5本のパッチがあった。 これらのパッチにより、この 1ヶ月間の開発が加速した。 ocProducts が実運用環境で HipHop を使い始めたときには、私たちが遭遇することになる深刻なバグに関して、いくつかのレポートが提供された。 Chris Graham が RoadSend と phpc テスト・スイートを HipHop に適用したときには、98% のテストをパスするという結果がもたらされたが、言語に関連する 40種類のバグ・レーポートも提供された。

Hui Chen, a Summer of Code student, has worked to add support for FreeBSD and 32-bit environments. We’ve also added preliminary support for OS X. While we’re not planning to use these platforms at Facebook, they’ll go a long way to getting even more community involvement around the project. For example, there are a number of developers who want to test and develop with HipHop on their 32-bit laptops.

Summer of Code の研究者である Hui Chen は、FreeBSD と32 bit 環境のサポートを、その作業に加えた。 私たちも同様に、OS Xに対する予備的なサポートを加えた。 それらのプラットフォームを Facebook で使う計画は無かったが、このプロジェクトを取り巻きながら、私たちとは遠い距離にあるコミュニティを、彼等は引き連れてきた。 たとえば、32 bit のラップトップ上で、HipHop の開発とテストを望む、数多くのデベロッパーがいる。

Thanks again from the entire team for helping make HipHop better and thus the web faster!

HipHop を高速化して、さらには Web まで速くしてしまった、このチームにおける全ての人々に Thanks Again!

Scott, an engineer, likes moving fast

ーーーーー

いやぁ~~~ 痛快ですね、ここまでキメてくれると! これが、超大規模システムで具現化されていること、そして、コミュニティがドライブしていることに注目したいですね。 我が WordPress の名前も入っていて、とても気分がよろしいです! ーーー A.C.

ーーーーー

<関連>
Facebook 探検隊: どのようなソフトウェアでスケールを達成しているのか
Facebook、Twitter、Digg などでの Cassandra の状況について
わずか四半期の間に、サーバー数が倍増した Facebook の事情
Facebook の HDFS クラスターは 21 PB !!!
Facebook のスケール感覚に驚愕!

SQL Azure をホリゾンタルにパーティショニングする

Filed under: Microsoft,Parallel — Agile Cat @ 9:28 am
Tags: , ,

SQL Azure Horizontal Partitioning: Part 2
http://blogs.msdn.com/b/sqlazure/archive/2010/06/24/10029719.aspx#

image

Wayne Walter Berry
24 Jun 2010 9:57 AM

 

image

SQL Azure currently supports 1 GB and 10 GB databases, and on June 28th, 2010 there will be 50 GB support. If you want to store larger amounts of data in SQL Azure you can divide your tables across multiple SQL Azure databases. This article will discuss how to use a data access layer to join two tables on different SQL Azure databases using LINQ. This technique horizontal partitions your data in SQL Azure.

現時点において、SQL Azure がサポートするのは 1GB と 10GB データベースであるが、2010年6月28日からは 50GB もサポートされる。そのため、大量のデータを SQL Azure にストアする場合には、多数の SQL Azure データベースに、テーブルを分割することが可能になる。 この記事では、異なる SQL Azure データベース上で、LINQ を用いて 2つのテーブルを join させる、データアクセス・レイヤの使い方について説明していく。このテクニックは、SQL Azure 内のデータを、ホリゾンタルにパーティショニングするものとなる。

In our version of horizontal partitioning, every table exists in all the databases in the partition set. We are using a hash base partitioning schema in this example – hashing on the primary key of the row. The middle layer determines which database to write each row based on the primary key of the data being written. This allows us to evenly divide the data across all the databases, regardless of individual table growth. The data access knows how to find the data based on the primary key, and combines the results to return one result set to the caller.

私たちのホリゾンタル・パーティショニング・バージョンでは、対象となるパーティション・セットにおける全データベース内に、すべてのテーブルが存在することになる。 そして、このサンプルでは、ハッシュ・ベースのパーティショニング・スキーマを用いて、対象となる Row の主キーをハッシュしていく。 ミドル・レイヤは、書き込み中のデータにおける主キーに基づき、個々の Row を write するデータベースを決定する。 それにより、個別のテーブルの増大にかかわらず、すべてのデータベースの至るところに、データを均等に分類することが可能となる。 このデータ・アクセス形式であれば、主キーに基づくデータを探し出す方式が認識され、また、対象となる caller に 1つの result set を return するために、その結果が結合される。

This is considered hash based partitioning. There is another style of horizontal portioning that is range based. If you are using integers as primary keys you can implement your middle layer to fill databases in consecutive order, as the primary key grows. You can read more about the different types of partitioning here.

それを、ハッシュ・ベースのパーティショニングと考えることができる。 ホリゾンタル・パーティショニングにおける別のスタイルは、レンジ・ベースのものとなる。 もし、整数を主要キーとして使用するなら、その主キーが増大するににつれて、連続したオーダーでデータベースを埋めていくように、ミドル・レイヤを実装できる。 それ以外のパーティショニング・タイプについては、ココで参照できる。

Performance Gain

There is also a performance gain to be obtained from partitioning your database. Since SQL Azure spreads your databases across different physical machines, you can get more CPU and RAM resources by partitioning your workload. For example, if you partition your database across 10 – 1 GB SQL Azure databases you get 10X the CPU and memory resources. There is a case study (found here) by TicketDirect, who partitioning their workload across hundreds of SQL Azure databases during peak load.

さらに、データベースのパーティションからは、パフォーマンスのゲインが得られる。 SQL Azure では、物理的に異なる複数のマシン上にデータベースが拡散れれるため、そのワークロードが分割され、さらに潤沢な CPUと RAM のリソースが得られる。 たとえば、全体で 10GB の SQL Azure データベースを、1GBずつにパーティショニングすれば、10 倍の CPUとメモリのリソースが手に入る。TicketDirect のケーススタディでは、ピーク時には数100 の SQL Azure データベースに、そのワークロードが分割される。

Considerations

When horizontal partitioning your database you lose some of the features of having all the data in a single database. Some considerations when using this technique include:

ホリゾンタル・パーティショニングにおいては、シングル・データベース内に全データを持つときと比べて、いくつかの機能が失われることになる。そのため、このテクニックを用いる時には、たとえば以下のようん項目について、検討しなければならない:

  • Foreign keys across databases are not supported. In other words, a primary key in a lookup table in one database cannot be referenced by a foreign key in a table on another database. This is a similar restriction to SQL Server’s cross database support for foreign keys.
  • データベース全体にまたがる外部キーが、サポートされない。 言い換えれば、データベースにおける lookup table 内の主キーは、別のデータベースのテーブル内の外部キーから参照できない。 それは、外部キーをサポートする SQL Server クロス・データベースに対する、制約に類似したものとなる。
  • You cannot have transactions that span two databases, even if you are using Microsoft Distributed Transaction Manager on the client side. This means that you cannot rollback an insert on one database, if an insert on another database fails. This restriction can be mitigated through client side coding – you need to catch exceptions and execute “undo” scripts against the successfully completed statements.
  • たとえクライアント側で、Microsoft Distributed Transaction Manager を用いるにしても、2つのデータベースにまたがるトランザクションは不可能である。 つまり、片方のデータベースで insert が失敗しても、もう片方でのロールバックが効かなくなる。 ただし、クライアント・サイドのコーディングを介して、この制約を緩和することもできる。それは、例外をキャッチして、完了したステートメントに対して ”undo” スクリプトを実行すことである。
  • All the primary keys need to be uniqueidentifier. This allows us to guarantee the uniqueness of the primary key in the middle layer.
  • すべての主キーは、uniqueidentifier となる必要がある。 それにより、ミドル・レイヤにおける主キーのユニークさが保証される。
  • The example code shown below doesn’t allow you to dynamically change the number of databases that are in the partition set. The number of databases is hard coded in the SqlAzureHelper class in the ConnectionStringNames property.
  • 以下のサンプル・コードはは、パーティション・セット内のデータベース数を総的に変更することができない。 ここでのデータベース数は、ConnectionStringNames のプロパティの SqlAzureHelper クラスで、ハード・コーディングされている。
  • Importing data from SQL Server to a horizontally partitioned database requires that you move each row one at a time emulating the hashing of the primary keys like the code below.
  • SQL Server からホリゾンタル・パーティション・データベースへ向けたデータのインポートでは、それぞれの Row を 1回に 1つずつ移動して、以下のコードにあるように、主キーのハッシュをエミュレートする必要がある。

ーーーーー

この後ですが、原文のサイトでは、以下の項目が説明されています。

http://blogs.msdn.com/b/sqlazure/archive/2010/06/24/10029719.aspx#

ーーーーー

The Code
Accounts Table
Partitioning by Primary Key
Fetching A Single Row
Inserting a Single Row
Summary

ーーーーー

<関連>

Eventual Consistency と CAP Theorem – by Michael Stonebraker _1
Eventual Consistency と CAP Theorem – by Michael Stonebraker _2
Stonebraker と CAP Theorem と Databases – by James Hamilton
Database Sharding _1
Database Sharding _2
Database Sharding _3
Database Sharding _4
Database Sharding _5

« Previous PageNext Page »

Theme: Rubric. Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

Join 3,239 other followers