網路應用程式開發. 使用 Google App Engine. Introduction. What is the could computing? 是透過網路將龐大 的運算處理程式 自動 分拆成無數個較小的 子程式 ,再由多部伺 服器所組成的龐大系 統搜尋、運算分析之 後將處理結果回傳給使用者。. Google : App Engine. 網路平台,讓開發者可自行建立網路應用程式於 google 平台中。 提供: 500MB of storage up to 5 million page views a month
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation
Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement.Téléchargez la présentation en cliquant sur ce lien.Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.
Introduction • What is the could computing? • 是透過網路將龐大 的運算處理程式自動 分拆成無數個較小的 子程式,再由多部伺 服器所組成的龐大系 統搜尋、運算分析之 後將處理結果回傳給使用者。
Google : App Engine • 網路平台,讓開發者可自行建立網路應用程式於google平台中。 • 提供: • 500MB of storage • up to 5 million page views a month • 10 applications per developer account • Limit: • Language: Python、Java • web applications
The Sandbox Environment • App Engine applications cannot: • write to the filesystem. Applications must use the App Engine datastore for storing persistent data. Reading from the filesystem is allowed, and all application files uploaded with the application are available. (Files uploaded as "static" files are not kept on the filesystem.) • open a socket or access another host directly. An application can use the App Engine URL fetch service to make HTTP and HTTPS requests to other hosts on ports 80 and 443, respectively. • spawn a sub-process or thread. A web request to an application must be handled in a single process within a few seconds. Processes that take a very long time to respond are terminated to avoid overloading the web server. • make other kinds of system calls, such as signals.
WebApp Framework • The WebApp Framework is the built in framework for handling requests • WSGI compatible framework • Uses Request Handlers classes to serve pages • Receives a WebOb request object • Response writes buffers to memory, returns output when handler exits
Bigtable • Google File System(GFS):為google自行開發的分散式文件系統,多欄位的設計,不大需要特別的正規化。 • MapReduce:平行資料處理模型,將要計算檔案分解為Map 和Reduce。
安裝googleappengine • Download the SDK • You must have Python 2.5 installed on your computer to use the App Engine SDK • http://code.google.com/p/googleappengine • Windows Installer • Mac App Engine Launcher • Zip Archive
Querying for Data • Google provides two methods for queryingdata • GQL, a SQL-like query language • We also have a query interface,which you can read more about at: • http://code.google.com/appengine/docs
#coding=utf-8 • from django.shortcuts import render_to_response • def index(request): • ans=fib(100) • return render_to_response('show.html' • , {'num1':ans • }) • def fib(n): # write Fibonacci series up to n • "Print a Fibonacci series up to n" • msg="" • a, b = 0, 1 • while b < n: • msg+=(str(b)+",") • a, b = b, a+b • return msg
Google appengine基礎指令介紹 • Datastore Model Class語法 • ratingproperty使用者提供的內容評等,介於 0 和 100 之間的整數。 • Call put() on the object to add it to thedatastore
交易(transaction) • A transaction is a datastore operation or a set of datastore operations that either succeed completely, or fail completely. If the transaction succeeds, then all of its intended effects are applied to the datastore. If the transaction fails, then none of the effects are applied. • 全部執行成功 • 全部執行失敗 • 使用時機,有相關性連續性的檔案結構