gae 簡介

28
報告人:莊嘉峻 2012.02.17

Upload: catonchuang

Post on 13-Jul-2015

255 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Gae 簡介

報告人:莊嘉峻2012.02.17

Page 2: Gae 簡介

Overview儲存資料服務設定 Eclipse 開發環境備註

Page 3: Gae 簡介

Google App Engine 是 google 提供的一個開發環境平台,開發者可以利用開發套件將程式上傳到 Google 的伺服器上執行

計費方式提供免費額度的網路流量及空間儲存

開發語言目前支援 Python, JAVA,GO等語言以下範例以 java 為主

Page 4: Gae 簡介

開發平台使用 SDK, python, java Eclipse 外掛 for JAVA

以下以這說明

Page 5: Gae 簡介

Source: http://www.cellopoint.com.tw/tw/media_resources/blogs/2010/CelloCloud_I

軟體即服務

平台即服務

架構即服務

Page 6: Gae 簡介
Page 7: Gae 簡介

支援 Java Data Objects (JDO) 與 Java Persistence API (JPA)

基本上是屬於 NOSQL的一種資料結構的定義使用 JAVA的 Class使用心得

存取大量資料的時候很慢,不適合關聯度高的資料結構

Page 8: Gae 簡介
Page 9: Gae 簡介
Page 10: Gae 簡介

Memcache 設定快取

URL Fetch Java API 取得其他網站服務 EX. 取得 Yahoo weaher api 的 XML ,包在自己定義的 servlet 或 java 檔中

Mail Java API 傳送郵件

影像 Java API 基本的影像工具,放大、縮小、裁剪

Google Accounts Java API 可以使用 Google 帳號達成網站的帳號管理

Page 11: Gae 簡介

Channel API  提供一個服務達成線上聊天室或網路對戰平台

The Conversion 轉換文件格式,如 html,pdf… 等

OAuth for Java Oauth 服務

The XMPP Java API Gtalk 的通訊協定

Page 12: Gae 簡介
Page 13: Gae 簡介

部署描述元: web.xml Java 應用程式設定 Java Backends Configuration Java 資料存放區索引設定 在 Java 使用 Cron 排程工作 Task Queue Java API DoS Protection Service for Java

Page 14: Gae 簡介

DD一般 servlet 的對應網址 Jsp的對應網址 security-constraint Filter Error handlers

Page 15: Gae 簡介

App Engine 的設定( appengine-web.xml ) Configuring Secure URLs (SSL) Enabling Sessions Inbound Services

像 mail 及 XMPP 等服務要在這裡設定開啟 Warmup Requests

當啟動時就把服務叫起來 Using Concurrent Requests

threadsafe15/2

Page 16: Gae 簡介

常駐的服務一般服務都有時間,時間到就會結束每次重新叫起服務需要一段時間

Backends收費標準

16/2

Class configuration

Memory l imit

CPU l imit Cost per hour*

B1 128MB 600MHz $0.08

B2 (default) 256MB 1200MHz $0.16

B4 512MB 2400MHz $0.32

B8 1024MB 4800MHz $0.64

Page 17: Gae 簡介

若有存資料到 JDO 時,需設定 datastore-indexes.xml 來建立索引,才能使用查詢欄位的功能

最多 100 組

17/2

Page 18: Gae 簡介

藉由 Cron.xml來設定排程,發出一個 http get 的需求處理想要做的背後服務

格式設定範例

18/2

every 12 hours every 5 minutes from 10:00 to 14:00 2nd,third mon,wed,thu of march 17:00 every monday 09:00 1st monday of sep,oct,nov 17:00 every day 00:00

Page 19: Gae 簡介

進階的服務排程設定

19/2

Page 20: Gae 簡介

Denial of Service (DoS) Protection設定在 dos.xml最多設定 100組

20/2

Page 21: Gae 簡介

除了用 XML來定義之外,也可以使用 YAML定義

YAML(Yet Another Markup Language)

21/2

Page 22: Gae 簡介
Page 23: Gae 簡介

SDK的使用方式這裡就不介紹,這裡介紹以Eclipse 介面的環境

環境設定安裝 JAVA下載 Eclipse下載 Google Plugin for Eclipse步驟可參考

http://code.google.com/intl/en/appengine/docs/java/tools/eclipse.html

23/2

Page 24: Gae 簡介
Page 25: Gae 簡介
Page 26: Gae 簡介

https://appengine.google.com/可查看專案的相關流量查看專案相關的 Log專案成本設定專案開發人員設定

26/2

Page 27: Gae 簡介

[1] Google App Engine DOC [2] Google App Engine Wiki

補充,也可以看看在雲端上啜飲爪哇

27

Page 28: Gae 簡介