2012-04-26 よもやま話

28
よもやま話 KISAKA Toshihiro [email protected] 2012-04-26 KISAKA Toshihiro <[email protected]>

Transcript of 2012-04-26 よもやま話

Page 1: 2012-04-26 よもやま話

よもやま話KISAKA Toshihiro

[email protected]

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 2: 2012-04-26 よもやま話

お前、誰よ?

木坂寿宏 (KISAKA Toshihiro) @ktoshihiro_ http://gplus.to/ktoshihiro 太古: Fortran

大昔: 漢字 Talk

中昔: BeOS

最近: Android, Windows Phone

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 3: 2012-04-26 よもやま話

今日のお品書き

最近 (?) の Topic の Overview ● 細かいことは話しません

● Web まわり中心

● 踏み込んで聞きたいことある?

● もしあれば、別途「勉強会」しましょう

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 4: 2012-04-26 よもやま話

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 5: 2012-04-26 よもやま話

今日のお品書き

すべて話している時間はない

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 6: 2012-04-26 よもやま話

Server Side

● Cloud

○ インターネットを介して分散したコンピューティング環境

○ アプリケーション / サービスがどこでどのようにサーブさ

れているかは気にしない。

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 7: 2012-04-26 よもやま話

Server Side

● Cloud

○ 計算能力

○ ストレージ

○ ネットワーク

○ データベース

○ CMS

○ etc.

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 8: 2012-04-26 よもやま話

Server Side

● Cloud

○ SaaS

■ Software as a Service

○ PaaS

■ Platform as a Service

○ IaaS

■ Infrastructure as a Service

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 9: 2012-04-26 よもやま話

http://itpro.nikkeibp.co.jp/article/Keyword/20110216/357282/

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 10: 2012-04-26 よもやま話

Server Side

● Cloud

○ Amazon

○ Google App Engine

○ Windows Azure

○ DotCloud

○ Heroku

○ Salesforce

○ etc.

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 11: 2012-04-26 よもやま話

Amazon Web Services (AWS)

● Amazon Web Services○ Simple Storage Service (S3)

○ Elastic Compute Cloud (EC2)

○ Route 53

○ etc.

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 12: 2012-04-26 よもやま話

AWS Free Usage Tier (per month)

● 750 hours of Amazon EC2 Linux Micro Instance usage (613 MB of memory and 32-bit and 64-bit platform support) – enough hours to run continuously each month*

● 750 hours of Amazon EC2 Microsoft Windows Server Micro Instance usage (613 MB of memory and 32-bit and 64-bit platform support) – enough hours to run continuously each month*

● 750 hours of an Elastic Load Balancer plus 15 GB data processing*● 30 GB of Amazon Elastic Block Storage, plus 2 million I/Os and 1 GB of snapshot storage*● 5 GB of Amazon S3 standard storage, 20,000 Get Requests, and 2,000 Put Requests*● 100 MB of storage, 5 units of write capacity, and 10 units of read capacity for Amazon

DynamoDB.**● 25 Amazon SimpleDB Machine Hours and 1 GB of Storage**● 1,000 Amazon SWF workflow executions can be initiated for free. A total of 10,000 activity tasks,

signals, timers and markers, and 30,000 workflow-days can also be used for free**● 100,000 Requests of Amazon Simple Queue Service**● 100,000 Requests, 100,000 HTTP notifications and 1,000 email notifications for Amazon

Simple Notification Service**● 10 Amazon Cloudwatch metrics, 10 alarms, and 1,000,000 API requests**● 15 GB of bandwidth out aggregated across all AWS services*

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 13: 2012-04-26 よもやま話

Server Side

● Web Server○ Apache httpd

○ nginx (2012-04-23 ver. 1.2 release)

○ node.js

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 14: 2012-04-26 よもやま話

Server Side

● Frameworks○ Ruby on Rails

○ Django

○ Symfony2

○ Silex

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 15: 2012-04-26 よもやま話

Silex とは

● MicroFramework

● Symfony2 の component を利用

● ファイルはたった一つ (silex.phar)

○ phar = PHP archive

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 16: 2012-04-26 よもやま話

Silex で "Hello, World!"

require_once __DIR__.'/silex.phar';

$app = new Silex\Application();

$app->get('/hello/{name}', function ($name) use ($app) { return 'Hello '.$app->escape($name);});

$app->run();

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 17: 2012-04-26 よもやま話

Client Side

● Client Side○ Mobile

■ Android

■ Windows Phone / Windows 8 Slate

■ iOS

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 18: 2012-04-26 よもやま話

C10k 問題

● 同時接続 10,000

○ SNS および SNS 関連サービス

■ 動画や写真共有

○ スマートフォン

○ マルチメディア (動画 / 音声) ファイル

○ 接続時間の増大

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 19: 2012-04-26 よもやま話

C10k 問題

● 同時接続 10,000

○ hardware の問題ではない

■ いまどきのサーバー

● Memory 数G

● CPU GHz

● Gigabits Ethernet

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 20: 2012-04-26 よもやま話

C10k 問題

● Multi-Thread○ Blocking I/O

● Single-Thread○ Non-Blocking I/O

○ Event Loop

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 21: 2012-04-26 よもやま話

● JavaScript

● Non-Blocking I/O

● Single Thread

● Event Loop

● libev / libeio / libuv

node.js の特徴

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 22: 2012-04-26 よもやま話

node.js の周辺

● NPM (node package manager)

○ Express (Web App Framework)

○ Railway (MVC Framework)

○ Mongoose (MongDB への ORM-like な機能)

○ Socket.IO (WebSocket)

● Cloud9IED

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 23: 2012-04-26 よもやま話

node.js で "Hello, World!"

var http = require('http');http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n');}).listen(1337, '127.0.0.1');

console.log('Server running at http://127.0.0.1:1337/');

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 24: 2012-04-26 よもやま話

node.js で "Hello, World!" #2

var express = require('express');var app = express.createServer();

app.get('/', function(req, res){ res.send('Hello World');});

app.listen(3000);

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 25: 2012-04-26 よもやま話

node.js を hosting

● Windows Azure

● Heroku

● DotCloud

● etc.

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 26: 2012-04-26 よもやま話

node.js

● Frontend の技術 (JavaScript) で Backend も

● PaaS を使えば、安価に簡単に

● IDE も WebApplication

ぜひ、やってみましょう!!

Google Web Toolkit (Java) というのもあるけど

2012-04-26 KISAKA Toshihiro <[email protected]>

Page 27: 2012-04-26 よもやま話

おまけ

 

2012-04-26 KISAKA Toshihiro <[email protected]>