cloud service and gae for java(gae:j)

Post on 16-Apr-2017

70 Views

Category:

Engineering

3 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Cloud Service andGAE for Java(GAE/J)

Speaker: Roy Chen

outline

• 1. What’s Cloud Service?• 2. PaaS features (GAE)• 3. IaaS features (EC2)• 4. Comparison: PaaS and IaaS• 5. implement and deme a tiny Project

( 目標 : • gae/j 開發環境設置• 、基本 jave web(servlet, jsp)• 、將專案 deploy 到 google gae)

•What’s Cloud Service?

Cloud Service

Because a lot of demand for cloud computing, and technologies of cloud is getting better, many companies have released some services that basic on Cloud, we called it “Cloud Service”.

• Web service (Amazon EC2, GAE…)• Storage (Amazon s3, hicloud s3, Google Cloud

Storage…)• Music, movie (itunes)

3-layer in Cloud ServiceWeb browser, mobile app…

SaaS (Software as a Service)

PaaS (Platform as a Service)

IaaS (Infrastructure as a Service)

•PaaS features (GAE)

Explore features!PaaS - GAE

1. Api 2. Auth3. Monitoring – Logs4. Storage5. …

1. Support some useful APIs

Based on PaaS, GAE support many useful APIsFor developers

Such as mail, map, youtube, and most powerful is auth!

2. OAuth2.0Think about this Scenario:

Your app(third party) wants to access user’s photo

placed in Google Storage,

The safest way is by Oauth, but how the Oauth do it?

If you Use a non-OAuth app…

WHAT CONSEQUENCES YOU WILL ENCOUNTER???

3. Monitoring – Logs

You don’t need to implement a log record system, GAE provides you a log control panel which has a pretty UI, and useful filter.

4. Storage

Store and manage data using a fully-managed, relational MySQL database

Cloud Datastore provides a managed, NoSQL, schemaless database for storing non-relational data.

provides developers and IT teams with secure, durable, highly-scalable object storage. with a simple web services interface to store and retrieve any amount of data from anywhere on the web.

Common Architecture

HTTP GET

IaaS example – Amazon EC2

IaaS example – Amazon EC2

Instagram

Comparison: PaaS and IaaSPaaS

IaaS

Google App Engine (GAE)

Microsoft Azure

Amazon EC2

Good Part of PaaS: machine and software configurations has been set, moreover, the vendor may provide many good api for you.

Bad Part: you need to allow the vender’s rules of environments settings, programming languages, db. And PaaS project has bad portability and hard to rework.

Good stuff… GCEI prefer to use IaaS

production, but I hate AWS, I want to use Google

production!

Let me show you

something good!

Project: 真男人簡介 :從前端的 radio button 選一個你想要的男人, 按下送出,你選的人名會送到後端 servlet ,經過篩選之後,會將頁面導到該男人的頁面。( 將前端資料 post 到 servlet , servlet 計算之後得到新的結果,在把新的結果由 servlet 傳回 jsp ,並使用 jsp tag 取得資料 )

2 ways to set ur dev environment

• 1. use MAVEN• 2. use eclipse

The Google App Engine SDK and Maven

• When you use Maven, you don't need to download the Google App Engine SDK. Maven does that for you. You'll also use Maven to test your app locally and upload (deploy) it to production App Engine.

Getting Eclipse

Installing the Google Plugin for Eclipse

環境設置完成

Creating a project

Click Web Application Project

測試一下

成功

新增 html

設定 router

Front-end

在主 servlet 產生一個 doPost 方法

把預設的 servlet 改成這樣

需要一個 jsp 去接 servlet 丟過來的東西

Apply gae service

• 接下來要上傳到 GAE SERVER ,但在這之前你需要去 google 開發者網站一下。• https://console.developers.google.com/projec

t• 直接使用您原本的 gmail 帳號即可,將 gae的服務打開。

Projectid 將會是你 domain name其中一部分

• 去 appengine-web.xml• 把 application tag 中間加上你的 id• <application>oh20141030</application>

Finally…

http://oh20141030.appspot.com/

top related