2014年WEBの世界で起こっていること(2) : The current state of the web

2014年WEBの世界で起こっていること : The current state of the web

※本稿は弊社のCTO、Slavi Pantaleevによる記事です。

〜2014年WEBの世界で起こっていること(1)はこちら〜

The new web

What the web looks like now is much more different than what it used to be a few years ago.

We are seeing these heavier websites that people no longer wish to simply call “websites” or “web pages”. They are getting so complicated that they’re not just a static web page document anymore. They “have a mind of their own” (that is to say: a lot of Javascript code creating interactivity), so that this (previously static) web document can suddenly do so much more for you.

Traditionally, web server software was doing all the hard work in preparing the “web page document” that was sent to users. Users just needed a simple web browser, which could read the document.
Lately, we’re seeing something else – the web server software creating the document is getting simpler (we can also call it “dumber”), while the document itself is becoming more complicated.

All the complexity and computation still has to happen somewhere – it’s just that some responsibilities are moving from one place (the server) to another (the client’s web browser).

If we are to make a slight history detour: there seems to be this perpetual back and forth movement in the IT industry – moving from a “thin client” (like your “old web browser from a few years ago”) to a “fat client” (your “new complicated and powerful web browser”).

It has already happened in the past, when computer users merely had a “terminal” (basic thin client computer), which connected them to the “real computer” (mainframe). Then we saw the shift to personal computers and workstations, allowing people to work locally (in a disconnected way), no longer needing to connect to a central computer. Thin clients (basic computers connecting to the “real computer”) are now getting some popularity (again!) in some companies, as a way to save money. The cost savings happen, because they allow IT administrators to hook these basic computers to a single more powerful one and have people work on it, instead of buying a dedicated workstation computer for each employee.

You can think of something similar happening to the web. In the “old web”, you had to communicate with a server to get anything done for you. Now, the server’s role is decreasing and your own web browser can do so much more by itself.

新しいWEB

現在のWEBの見た目は、数年前とはかなり違ってきています。

私たちが目にするのは、もはや「WEBサイト」「WEBページ」とは呼ぶ気になれないような盛りだくさんサイトです。非常に複雑で静止したWEBドキュメントではありません。「それ自体が意思を持っている」(つまり:たくさんのJavaScriptコードが相互作用してできている)ので、この(昔は静止したものであった)WEBドキュメントは突然いろんなことができるようになりました。

その昔はサーバーのソフトウェアが、ユーザーあての「WEBドキュメント」を準備するため全てのハードワークをこなしていました。ユーザー側はドキュメントを読むことができるシンプルなブラウザさえあればよかったのです。
ですが最近の私たちは、もっと別のものを見ています – サーバーのソフトウェアが作成するドキュメントは簡素化し(「ばか」になったと言い換えてもいいでしょう)、一方でドキュメントそのものが複雑になりました。

全ての難解な事柄や計算はまだどこかで処理される必要があります – 単にある責任分担がひとつの場所(サーバー)から別の場所(クライアントのブラウザ)に移動したというだけのことです。

もし歴史からちょっと道を逸れてみたらどうでしょうか:IT業界にはこの永久的な行きつ戻りつの動向がどうもあるようですから – 「頼りないクライアント」(例えば「数年前の古いブラウザ」)から「でんと構えたクライアント」(「新しい複雑でパワフルなブラウザ」)に乗り換える、といったような。

実際過去に起きていることです。コンピューターユーザーはただ「端末」(やせっぽちクライアントとも言うべきベーシックなコンピューター)しか持っておらず、それを「本当のコンピューター」(メインフレーム)につないでいました。その後、中央コンピューターにつなぐことなく(切断状態で)ローカル作業ができるパーソナルコンピューターとワークステーションへのシフトが起きました。(そして今再び!)経費節約のために、やせっぽちクライアント(「本当のコンピューター」につなげるベーシックなやつ)を好む企業が出てきています。コスト削減になるというのは、IT担当者は自分のベーシックなコンピューターを強力な一台のコンピューターにつなげばよいので、従業員一人一人にワークステーションコンピューターをあてがう必要がないからです。

似たような事例がWEBについても言えるでしょう。「古いWEB」で何かするためにはサーバーとの交信が必要不可欠でした。しかし現在サーバーの役割は減少し、ブラウザ自身がとても多くをこなせるようになりました。

Why do more of the hard work on the client?

More of the hard work happens on the client (in the user’s web browser), because it’s infeasible to communicate with a remote server for every minor interaction that needs to happen.
Modern “web applications” need to do a lot of interactions all the time, amplifying the problem.

It’s one of the reasons why companies pushing the new “everything is online” web pursue making your web browser faster and more capable.

Having more of the work happen in your browser is also a blessing from an engineering perspective.
Think of how many less servers you would need to power an equivalent web application when the server is doing 100% of the work (“old web”), compared to the “new web”, where your web browser takes much of that load off.
Since a lot of the heavy work happens in each user’s browser, the server doesn’t get loaded so much. It merely has to perform simpler (and fewer) operations. Some of the hard work is spread across the world – each user’s computer is doing its fair share.

クライアント側で高負荷な処理が増えている理由

クライアント側(ユーザーが使うブラウザ)で負荷が高い処理が増えた理由は、必要とされるありとあらゆるささいな相互作用(訳注:例えば、一部のメニューを広げたり隠したりすること。このような動きを一々サーバーに送って処理をしていたら、通信が余りにも膨大になります。)を離れた場所にあるサーバーとやりとりするのは不可能だからです。
現代の「WEBアプリケーション」は常にたくさんの相互作用を必要とするので、問題は膨れ上がります。

「全てオンライン」なWEBを追求する企業の後押しによって、ブラウザがもっと早く、もっと高能力なものになる理由はそこにもあると言えるでしょう。

ブラウザ内でより多くの仕事ができるようになったのはまた、エンジニアリングのお陰でもあります。
考えてみてください。あるアプリケ―ションを動かすのに「古いWEB」ではサーバーが100%の仕事をしていたとしたら、ブラウザがその大方を請け負ってくれる「新しいWEB」ではサーバーの負荷がどれほど少なくて済むことでしょう。
各ユーザーのブラウザが重たい仕事をしてくれるので、サーバーにはさほど負荷がかかりません。シンプル(そのうえ数も減る)オペレーションを実行するだけでよいのです。きつい仕事の一部は世界中に拡散され – 各ユーザーのコンピューターがそれを担っています。

Where is it all going?

The web still keeps improving. Web browsers are becoming more and more complicated. They are taking away and integrating so much “operating system” capabilities, that they are starting to look like operating systems themselves.

Programming-wise, these web applications (also referred to as SPA, standing for “Single Page Applications”) are often developed using some new and fancy Javascript framework that didn’t even exist a few years ago.
Examples of such frameworks are: Google’s AngularJS, Facebook’s React, EmberJS, KnockoutJS and hundreds of others.

There are so many different Javascript frameworks and libraries and so many newly-developed “applications” now.
A famous programmer/blogger (Jeff Atwood) even went on to post a funny quote on his blog that nicely summarizes what’s happening:

Atwood’s Law: any application that can be written in JavaScript, will eventually be written in JavaScript.

It goes to say that, whatever you currently use (or have used in the past) that is not currently on the web and being powered by the Javascript programming language, will eventually be. You just have to be patient enough.

It’s already happening. A few years ago, there wasn’t anything like these feature-loaded email solutions we have on the web now (things like Google’s Gmail). There wasn’t anything like these word-processing applications like Google Docs (now called Google Drive) and Microsoft’s Office 365. These are all products of this new trend of “we need it all accessible online“.

どこへ向かっているのでしょうか?

WEBはこれからも進化し続けます。ブラウザはもっともっと複雑になるでしょう。「オペレーティングシステム」の能力を切り離したりくっつけたりして、それ自体がオペレーティングシステムのようなものに近づいていきます(訳注:chrome OSはその1つでしょう)。

プログラミングという面で言うならば、こういったWEBアプリケーション(「単一ページアプリケーション」を略してSPAとも呼ばれます)は、数年前には存在すらしなかったような、新しくて洗練されたJavaScriptのフレームワークを用いて進化していきます。
フレームワークというのは例えば:GoogleのAngularJS、FacebookのReact、EmberJS、KnockoutJS、などですが他にも何百とあります。

今や様々なJavaScriptのフレームワークやライブラリ、新規開発された「アプリケーション」というのが本当にたくさんあるのです。
有名なプログラマー兼ブロガーの「Jeff Atwood」が、彼のブログで面白いことを言っていましたが、何が起きているかがうまく要約されているものでした:

Atwoodの法則:JavaScriptで書くことができるアプリケーションは、最終的にJavaScriptで書かれることになる。

つまり彼が言いたいのはこういうことです。現在あなたが何を使っているにしろ(あるいは過去に何を使ってきたかにしろ)、今はWEB上になくてJavaScript言語で動いていないものでも、いずれはJavaScriptになります。時間はかかるかもしれませんが、いつかはそうなります。

それは実際に起こりつつあることです。数年前、今のように機能満載のメール手段などどこにもありませんでした(例えばGoogleのGmail)。Google Docs(Google Driveに名称変更)やMicrosoft Office 365といったワードプロセスのアプリケーションみたいなものも、どこにもありませんでした。これらはいずれも「オンラインで全てにアクセスできなければ」という傾向から生まれたものです。

〜2014年WEBの世界で起こっていること(3)に続く〜