Tags: google
BigTable(next generation database led by Google) 1
By MD on Jun 13, 2008 | In Database | 1 feedback »
BigTable. It could be pretty big as it sounds. According to Jeffry Dean, who is a fellow at Google, the biggest one today is up to 4000TB, spanning over thousands of servers..., only a table!!!
Have you ever heard about BigTable? Unless you're a database vendor or a Google infrastructure freak, I'm afraid you haven't.
According to the paper titled Bigtable: A Distributed Storage System for Structured Data, it is like:
Bigtable is a distributed storage system for managing structured data that is designed to scale to a very large size: petabytes of data across thousands of commodity servers. Many projects at Google store data in Bigtable, including web indexing, Google Earth, and Google Finance. These applications place very different demands on Bigtable, both in terms of data size (from URLs to web pages to satellite imagery) and latency requirements (from backend bulk processing to real-time data serving).
Two points.
- scale to a very large size: petabytes of data across thousands of commodity servers
- both in terms of data size and latency requirements
How?
Performance matters
To reduce HDD seek time is a keen point to general performance of computer since I/O costs million times more than CPU's. So, it's wise to fetch as big chunk as possible at once.
Today, most of user files are getting larger and larger, ever larger. But still, a unit of HDD stays smaller, 512KB usually, and 512KB-4KB of filesystem on Linux.
Google File System, Google's underlying distributed filesystem, makes use of a huge chunk, 64MB in size.
The next thing to consider is layout. How data should be laid on a block? Contiguous data can be read/written from/to disk at once.
A database usually put one row on a contiguous space. So as long as you put all the data you require on a single record, you can get the best performance. Some databases provide another approach, column oriented.
BigTable is not a conventional table
It's more like a spreadsheet. And a map under the hood.
BigTable offers a new way both in performance and functionality. Next time, I will show you details.
Visualize Your Data with Google Visualization API
By MD on May 30, 2008 | In Ease Of Use | 1 feedback »
Today, here at Google I/O 2nd day, a new Google Visualization API was announced.
What's new?
1. events
2. gadget.draw()
Google Visualization Gadget supports selection events so that a developer can respond to end users.
With draw() method, a gadget can draw any tables only if a table supports pre-defined DataTable APIs.
Let's try the new draw() method with the JSON example.
Instead of writing tables with HTML tags, simply pass DataTable object to Table gadget.
Here's the code.
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<script type="text/javascript" src="http://www.google.com/jsapi"></script> | |
<script type="text/javascript"> | |
| |
google.load("visualization", "1", {packages:["table"]}); | |
| |
var xhr; | |
try { xhr = new ActiveXObject('Msxml2.XMLHTTP'); } | |
catch (e) | |
{ | |
try { xhr = new ActiveXObject('Microsoft.XMLHTTP'); } | |
catch (e2) | |
{ | |
try { xhr = new XMLHttpRequest(); } | |
catch (e3) { xhr = false; } | |
} | |
} | |
| |
xhr.open("GET", DATASOURCE_URL, true); | |
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); | |
xhr.send(null); | |
| |
xhr.onreadystatechange = function() | |
{ | |
if(xhr.readyState == 4) | |
{ | |
if(xhr.status == 200){ | |
the_object = eval( "(" + xhr.responseText + ")" ); | |
handleQueryResponse(the_object.table); | |
}else{ | |
| |
} | |
} | |
}; | |
| |
// Query response handler function. | |
function handleQueryResponse(table) { | |
var data = new google.visualization.DataTable(); | |
| |
// convert to Google.DataTable | |
// column | |
for (var col = 0; col < table.cols.length; col++) { | |
data.addColumn('string', table.cols[col].label); | |
} | |
// row | |
for (var row = 0; row < table.rows.length; row++) { | |
data.addRow(); | |
for (var col = 0; col < table.cols.length; col++) { | |
data.setCell(row, col, table.rows[row][col].v); | |
} | |
} | |
| |
var vis_table = new google.visualization.Table(document.getElementById('table_div')); | |
vis_table.draw(data, {showRowNumber: false}); | |
| |
} | |
| |
</script> | |
</head> | |
| |
<body> | |
<div id="table_div">Loading...</div> | |
</body> | |
</html> |
Thanks a lot, Google Visualization Team! Now that our own data can be easily integrated with Gadget!
Googleが世界の電力を食いつぶす日
By MD on Apr 22, 2008 | In Database, 日本語 | Send feedback »
今日4月22日はアースデー。ということで、このままの勢いでインターネット上にデータがあふれるとしたら、一体いつGoogleは世界の電力を食べつくしてしまうのだろう?、というあり得なさそうで、でもひょっとしたらあるかも、という計算をしてみました。
まずは、世界の総発電量を確認。
電気事業連合会発行の、世界の電気・日本の電気によると、世界の電力消費量は、2003年に15兆kwh(キロワットアワー)だそうです。
さらに今後の予測はこんな感じ。
さて、それでは一体Googleはどれだけの電力を年間に消費しているのでしょうか?これは少し計算をしてみなければならないので、Googleを支える技術からデータと計算を拝借してみます。
2004年の上場時に5万台前後、2007年時点では50万台前後という、う・わ・さ、があるそうです。どちらも梅田氏の情報らしく、公開資料からかいま見えるGoogleのコンピュータシステムと同氏のブログエントリー、Googleの「情報発電所」はいま何台?、から推測できます。
そして、1台のサーバーが消費する電力を120w、24時間稼動、さらに冷房等で約半分の追加電力消費があるとすると、1台のサーバーが年間に消費する電力量は以下のようになります。
120w * 24 * 1.5 * 365 = 約1500kwh
それでは50万台では?
1500kwh * 500,000 = 788,400,000kwh
約8000億kwh!!!
2003年に15兆kwh、2010年の電力消費量予測が20兆kwhだと考えると、2007年は17兆kwhぐらいだと思われる。だとすると、2007年における世界の電力消費量に占めるGoogleのシステム消費量の割合は、
800 / 17,000 * 100 = 4.7%
5%!?
計算間違いなのを祈る・・・。さて、それではデータの増加量から今後のサーバーの増加量を予測し、既存のテクノロジのままではいつGoogleが世界の電力を食いつぶしてしまうのか計算してみる。
So much data, relatively little spaceによると、世界のデータ量は、2003年に5エクサバイト(exaは10億ギガ)、同様の測定法でIDCのデータを修正すると2006年には40エクサバイトだったそうだ。線形(比例して)で増加していないので単純に比較はできないが、サーバーが3年間で10倍に増えたのに対して、データは同じく3年間で8倍。実際には集計に含まれていないデータのことなどを考えると、Googleサーバーの伸びとデータの伸びはほぼ同じようだと言っていいだろう。
IDCによると、これは少し集計法が異なるのだが、2007年の161エクサバイトから、2010年には988エクサバイトになるというので、次の3年間で6倍になる予測だ。となると、Googleのサーバーは300万台、電力消費量は約5兆kwh!!!となる。2010年の世界の電力量見通しは、約20兆kwh。ということで、25%がGoogleに食われることになる。
いつ食いつぶすか?これ以上の予測は根拠が薄いので難しいが、少なくとも既に相当の割合を消費していて、消費量が供給量の伸びより大幅に大きいことを考えると、2015年から2020年には、電力クライシス、またはGoogle電力なるものが登場していても、不思議はない。
*でも普通に考えておかしい。電力会社の総売上の5%をGoogleが払っているとはとても思えない。サーバーは常に最大電力を消費しないし、平均10%ぐらいだとしたら、0.5%とかになるのかも。