[Android] JavaWorl DAY 2008 参加

今日、社会の基盤インフラの地位を確立したIT(情報技術)。そこで起きる革新は、そのまま社会に大きな変化をもたらします。例えばWeb 2.0、例えばモバイル、例えばクラウド・コンピューティング――これらの動きは、今後の社会のあり方を変えていくことでしょう。

Javaの話題よりも、クラウド関連の話題のほうが多い気がした。「SunがAndroidJavaと思っているのか?」という疑問がふとよぎった。かなり長いですが、聞きながらとったメモです。誤字脱字はごめんなさい。

丸山先生の講演
Androidの真価を問う
グーグルが推進する新Javaプラットフォームは、クラウド・コンピューティングのフロントか!? 今後、ケータイ&Javaの世界はどう変わるのか!?

最後にしっかりと9月12日の日本Andoridの会の結成集会の宣伝をしていただきました。また、Adamrockerさんのアプリの紹介や、ビデオでのストリートビューの紹介など、なかなかおもしろかったです。また、普段あまり聞けない(メールでは出ていますが…)、世界の携帯電話事情は、自分自身の視点を見直してみる必要があるかもと感じました。

Androidについて
  • 現在の関心は二つ。AndroidとCloud二つは関連がある。
  • フルブラウザとGoogleMap
  • 実機で動かすことができる。いろいろな形で実機を動かすことができるのは新しいこと。
  • データーベースエンジンも積んである。10年前のエンタープライズ系のプログラムをほうふつさせる。Javaの知識、データベース、エンタプライズの知識が有効に活用できる。- 携帯電話の世界で、初めて、オープンソースのビジネスが可能になることを期待している。
    • オープン。すべてのアプリケーションを平等に作ることができる。アプリケーションの境界を取り払うことができる。いろいろな可能性がでてきた。例えば、104にかけると、番号をアドレス帳に自動的に送ってくる。今は、簡単にできそうで、誰が考えても便利になることができていない。」
  • 20世紀の終わりMAD(Mass Acxcess Consumre Devices)とコンピュータの数が反転した。また、同時期に、ネットワークスピードと進化スピードは相関がある。
世界規模でみた携帯
  • 日本の携帯市場は飽和しているが、グローバルな市場を見ると少し違う。
  • デジタルデバイドは、携帯電話によって急速に終焉しようとしている。アフリカが世界でも最も急速に成長している。年率6割程度で増えている。
  • インドで携帯電話の基地局をおいたら、船から電話が使えるようになり、情報交換ができるようになったために、その地域の年収が急激に上がった。
  • コミュニケーション手段の重要性を、国連のミレニアムレポートは過小評価している。コミュニケーションをベースにして経済活動が活性化するという考えは正しいと思う。
  • 世界には22億台の携帯がある(日本には一億台)。10年後には五十億台になる。GoogleAppleは、これを狙っている。
  • 世界市場での携帯の出荷台数。自動車は世界シェアの上位にいる。Nokiaは年間四億台の形態を作っている。日本は合わせても一割いかない。これは、キャリア主導のの進め方の結果だと考えられる。
CloudとMobile Deive
  • Coludのデータを受け取るための端末
  • ネットワークが日常生活の一部になっている。今は、PCだが、携帯になってきている。現在の若い人はすでに、携帯になっている。
  • 我々はいつもクラウドにつながっている。Googleが一通りのクラウドサービスを一社でもっている。これは、驚異かもしれない。
  • 携帯だけでは何にも出来ない。クラウドがなければ意味がない。
  • クラウドは5つに寡占化している。Google,MS,Amazon,e-Bay,IBMなど。
  • クラウドには実態がある。Googleのデータセンターは急成長している。200万台、三百万台といわれていうる。マイクロもS+S(Soft+Service)として、データーセンターを急速に
  • 日本はスケールアウトが遅れている。アメリカの証券会社と一桁以上違う

パーソナルな新メディア

  • A phone is GPS, a camera, a computer, and a brower.
  • Intentによって、抽象化されたスタイルでプログラミング可能

そのほかの視点

  • 組込みの標準的なプラットフォームとしてアンドロイドが注目されている。
  • adhocでダイナミックなP2Pネットワークのプラットフォーム
  • ゲームや、コンテンツもグローバルに展開できる可能性がある。

プラットフォームとしてのインターネット(クラウドのプログラミング)
米国Google ソフトウェアアーキテクト グレゴー・ホーペ 氏

インターネットは、ハイパーリンクで結ばれたドキュメントの集合体から、成熟したプログラミング プラットフォームへと発展していきました。
 今や、WebサービスAPIやデータ フィード、そして、オンライン コンピューティング リソースを用いることで、ローカル マシンに何もインストールすることなく、アプリケーションを設計し、開発し、テストし、稼働することが可能となっています。また、これらのアプリケーションは、クラウドの中で機能し、シンプルなURLを通じて、どこからも利用することができます。とは言え、クラウドという「世界規模のワンダーランド」は、いくつかの問題や懸念も生じさせます。

  • Enterprise Integration Patternsの著者
  • 毎日コーディングしている。
  • コンピューティングパワー(Storage)がやすくなっている。
  • Connecttivity
  • Democratized tools of production

Internet as a Platform

Architect's Dream

Loosely coupled
extensible
standartds-based
fault toleratnt
unlimited computing power

Developer's Nightmare

No call stack
No Transaciton
No Promises
No Certainty
No Ordering constaints

Distributed transactions Are For

  • Require cooedinator
  • Enen 2 Phase Commit has wondows of uncertainty
  • Not practrical for log running interracionts
    • Locks not practival/eeconomical
    • Isolation not possible/practival
  • Usually not supportted
  • Don't scale

Still An issue with HTTP

  • BUYボタンを押しても帰ってこない場合がある。
    • Hardware failure
    • Neteotk failure
    • Time outs

New Game Rules

ACID(brefore) Predictive Accurate
  • Atomic
  • Consistent
  • Isolated
  • Durable
ACID(today) => Flecible Redundant
  • Associative 結合の法則 A+B+C or (A+B)+C A+(B+C)でもよい。順番はどちらでもよい。
  • Commutative 交換可能
  • Idempotent 2回目にボタンを押し時の処理
  • Distributed

最も大きなアドバンテージは、現実の世界は混沌としている。観察することが必要

Starbucks Does not Use 2-Phase commmit Either

  • Start marking coffee before customer pays
  • resuce Latency
  • What happens if
    • Costomer rejects dring => remake dring (Retry)
    • Coffee maker breaks => Refund money (Compensation)
    • Costomer cannot pay => Discard beverage (Write-off) E-Bayの例:50項目を見ていて、次のページを見たら、一項目ミスするかも知れない。でもOK.

実際の世界は、それほど厳密でなくもOKの場合も多い

Programming the Cloud - The Google Way

  • Fault tolerant distributed disk storage: Google File System
  • Distributed Shared Momery: Bigtable
  • New Programming absraction: MapRedule

GFSの説明

  • Data replocated 3 times, Upon faiure, software re-replicates
  • Master: Maneges file metadata, Cunk size 64MB
  • Optimized for high-bandwidth squaential read/writes
  • Clusters > 5 PB of disk

http://research.google.com/archive/gfs-sosp2003.pdf

Distributed Shared Momery: Bigtable

  • Spares, distributed, persistent, multidimensional, sorted
  • Not a relational database (RDBMS): no shcema, no joins, no foreing key constrains, no multi-row transaction
  • Each row can hava nay number of columns, similar to a dictionaly data structure for each row.
  • Basic data tpes: string, countger, byte array
  • Accessed by row key, column name, byte array
  • Accessed by row key, column name, timestamp
  • Data split into tables for replication
  • Largest call are > 700TB

http://research.google.com/archvie/bigtable-osdi

Programming Abstracion: MapReduce

  • Represent problems as Map and Reduce step (inspired by functional programinng)
  • Distribute data among many machines, execute same computation at each machine on its dataset
  • Infrastructure manages parallel execution
  • Open source implementation: Hadoop

map(in_key, data) -> list(ley, value)
reduce(key, list(values)) -> list(out_data)
一つのCPUが遅かったらどうするのか?

http://research.google.com/archvie/mapreduce.html

Languate for Paralles Log Processing: Sawzall ゾーザル

  • Commutative and associative operations allow parallel execution and aggregation
  • Languatge avoids specifying order bgy replacing loops with quantifiers (constraints)

Input => Filter Transform Aggregate Output
(3, 5, 7, 12, 34, 5, 7, 8) (count = 5, Total=35 Sum_sq = 221)

count: table sum of int;
tatal: table sum of float;

x: float = input
emit count <- 1;
emit total <- x;

http://labs.google.com/papers/sawzall.html

Google, the Cloud, and You!

  • Make the colud more accessible.
  • Make the client more powerful => Android
  • Keep connectivity pervasive => Mobile, WiFi

Google Data API's

  • Standard protocol for reading and wrintng data on the web
  • Based on Atom 1.0 and RSS 2.0 syndication formants, Foogfle data extensions
  • Atom Publishing Protocol
  • Optimistic concurrent base of version numbers: no locks => スターバックと一緒
  • AuthSub authentication schemae: no stored passwords.

JavaScriptGUIなどもある。

http://code.google.com/apis

Calender Feed

カレンダーの例の説明。Googleカレンダーから、XMLで表示。ATOMフィードXML

Google App Engine - Easy to Start, Easy to Scale

  • Your code on Google infrasturucre
  • Python source code and run-time
  • Develop locally, deploy to coloud
  • Write once, scale automatically
  • Free quota of 5M pageview/month and 500MB storage

Programming & Run-time Model

  • Responds to HTTP requests
  • A programming platform, not "raw iron"
  • API support for
    • User login and identity
    • Parsistent state (on top of Bigtable, not RDBMS)
    • memcache
    • Mail, Image, URL Fetch
    • Python libraries (not vative code)
    • Django Templates
  • Automatic scaling

Google App Engine Success Stories

new "Pix Chat" OpenSocial app running in App Engine

http://gregortavel.appsopt.com/

Programming the colud

  • Programming the could is excuting, but uses diffrent promming and run-time models
  • Prralle execution, constrains-based programinng instead of liner loops
  • Highly distri