4. Cloud
• Cloud 三兄弟
– IaaS (Infrastructure as a Service)
– PaaS (Platform as a Service)
– SaaS (Software as a Service)
5. Cloud 三兄弟
• IaaS (Infrastructure as a Service)
直接給你虛擬主機用
優:很彈性,你想安裝任何軟體、採用任何架構
都很容易
缺:要管理主機、處理一大堆問題
(ex: 駭客攻擊、版本升級等等)
• amazon AT&T HP
• hinet 台灣大 遠傳
6. Cloud 三兄弟
• PaaS (Platform as a Service)
規定你APP要怎麼寫,簡化你管理主機的步驟
有些工具的賣點是自動幫你處理擴充問題
優:管理方便,只需要focus在app開發
缺:寫法、使用工具、環境受到限制
• Google app engine
• Microsoft Azure
7. Cloud 三兄弟
• SaaS (Software as a Service)
善用別人寫好的web app
• Gmail, Google calendar, Facebook, …
9. Google Cloud
• Google cloud包含了四大部份,分別解決不同問題
– Google App Engine
• Build your apps and websites on Google’s infrastructure with
Google App Engine.
– Google Compute Engine
• Run Linux Virtual Machines in the cloud using Google Compute
Engine (Limited Preview).
– Google Cloud Storage
• Store, access and manage your data on Google’s storage
infrastructure.
– Google BigQuery
• Analyze Big Data in the cloud using SQL and get real-time business
insights in seconds using Google BigQuery.
10. GAE
It’s PaaS
• Features
– Focus on Web service
– 規模自動擴張
– 安全性
– 效能
– 支援Python and Java (and Go)
– 完整的SDK
12. Some useful features
• DataStore – NoSQL schemaless object datastore
• BlobStore – Let you store "Binary large object" (blob)
• Memcache – Fast Caching server
• URL Fetch – Get data from HTTP/HTTPS
• Mail – Just a Mail sender
• Images – Image Processing, like resize, rotate
• User – Supply Google account login
• Task Queue – Send heavy load job to queue
• Cronjob – Schedule a job
…. and more
13. Storage
• GAE provide two major Storage engine, for
difference usage.
– App Engine Datastore
• NoSQL schemaless object datastore
– App Engine Blobstore
• to store blob data
14. Not only SQL
• Relational DB focus on relation
– User
• id, username, password, email, …
– Comment
• id, user_id, title, content, …
15. Not only SQL
• NoSQL focus on scalability, speed, or
something else.
– document-oriented
沒有任何的schema, 適合存document
• MongoDB
– key-value database
只有key-value的形式, focus on speed, scalability
• Redis, memcached
16. Not only SQL
– Distributed database
focus on distribution on servers
• HBase, cassandra, …
20. Types - GAE Datastore
Property in Python
StringProperty str
unicode
BooleanProperty bool
IntegerProperty int
FloatProperty float
DateTimeProperty datetime.datetime
ListProperty list
BlobProperty db.Blob
TextProperty db.Text
21. Using Datastore
• Create a model
– 定義了該 datastore 的屬性有哪些
• Use it like a ORM
資料皆為物件,對物件操作就是對資料操作
– Insert:新增一個物件,最後呼叫.put()方法儲存
– Update:先query出你想要修改的物件,直接修改該物
件,最後呼叫.put()方法儲存
– Delete:先query出你想要刪除的物件,直接呼
叫.delete()方法刪除之