Más contenido relacionado Similar a 使用GoogleAppEngine建立个人信息中心 (20) 使用GoogleAppEngine建立个人信息中心2. Agenda
1 )云计算那些事儿
2 ) Google AppEngine
3 ) GAE 个人信息中心
4 ) Resources
5. • IaaS (Infrastructure as a Service)
o Amazon EC2 , Microsoft Azure
• PaaS (Platform as a Service)
o GoogleAppEngine ,新浪 AppEngine , HeroKu
• SaaS (Software as a Service)
o Zoho , Google Apps ,易度
9.
新浪微博 @_ 浪潮之巅 _ :
中国很多大公司 ( 主要是央企 ) ,对云计算理解就是 IDC
和设备。
美国的 case 都是应用。美国这点认识比较一致:
IDC 和最基础的东西让 Google , Facebook 和 Amazon 去
做。
http://weibo.com/2142166543/xtKu40qgP
13. Google AppEngine
Go language, Python, Java (JRuby, Lua, Rails
etc.)
优点:
o UrlFetch,Memcache,TaskSchedule
o XMPP,Mail,Cron
o MapReduce,Channel
o 支持 OAuth 认证或 Google 账号
o Image 处理
o 域名绑定
o 易使用,易管理
o 免费限额大方
缺点 :
o 无全文搜索
o 调整后的付费方案
o 需要熟悉新 SQL 操作方式
14. 适用于:
Wiki,CMS, 博客 , 微博 , 手机游戏后台 ,
应用服务器 , 问答网站 , 电子书发
布 ,SNS, 网店 , 工作流
不适合:
音频视频服务 , 大文件 , 密集计算
15. Web Framework
Django
WebApp2
Tornado
https://github.com/facebook/tornado/tree/master/demos/appengine
17. Java on AppEngine
Play! Framework
http://www.slideshare.net/gasolin/play-framework-on-google-app-engine
https://github.com/guillaumebort/play-gae
Scala Lift Framework
http://lift-example.appspot.com/
http://www.scala-lang.org/node/1826
JavaScript
http://www.appenginejs.org/
20. 企业使用 ?
• 比较容易扩展
• 管理方便
• 用于特定任务
• 更推荐 EC2
http://code.google.com/appengine/business/
http://code.google.com/appengine/docs/premier/index.html
22. GAE SDK 1.5.5
• Python2.7
• 支持多线程,可使用 threading
• 支持并发请求
• 可以访问 bytecode
• 支持更多 Python lib ( PIL v1.1.7 )。
• 前台请求的时间 30 秒增加到 60 秒, URLFetch 请求时
间从 10 秒增加到 60 秒。
• URLFetches 的 POST 参数大小从 1MB 增加到 5MB 。
From Keakon's blog
23. GAE 编程心得
• 尽量使用 memcache
• 组合 Appengine & VPS
• 通过 service 访问 VPS 数据库, GAE 进行缓存
• 使用 google 或 VPS 搜索
• Nginx 反向代理 AppEngine (必须的)
VPS seller and coupon
http://www.lowendbox.com/
Install Debian, Nginx in VPS
http://www.howtoforge.com/
26. 个人常用的信息服务
• TwitterWeb 客户端,可以同步到新浪腾讯网
易搜狐
• RSS 聚合阅读
• 获取网页 (urlfetch) ,解析短网址
• Cron Jobs
• 在线个人笔记,在线个人博客
• 网络小说阅读
• 推送文章到 Kindle
• 发送天气短信给自己
• 生日提醒(邮件,聊天工具,短信等多种手段
)
• 监控 iphone 购买网页的变化
• 相册
• proxy
29. 新浪微博 腾讯微博
import mechanize
br = mechanize.Browser()
br.open("http://abcd.com/openqqsdk/qqweibopost.php")
br.select_form(nr=0)
strform = status.encode('utf-8')
br.form['text'] = str
br.submit()
VPS 上搭建微博 PHP SDK 作中转
30. BeautifulSoap 使用
from BeautifulSoup import BeautifulSoup
VALID_TAGS = ['strong', 'em', 'p', 'ul', 'li',
'br', 'img', 'ol', 'blockquote']
def sanitize_html(value):
soup = BeautifulSoup(value)
for tag in soup.findAll(True):
if tag.name not in VALID_TAGS:
tag.hidden = True
return soup.renderContents()
31.
https://gist.github.com/1298152
53.
Kindlereader
一个定时将 Google reader 发送至 kindle 的工具
master 分支为单用户版 ( 基于 python), 运行于 Linux, Mac OSX,
Windows
gae 分支为运行于 Google app engine 的多用户版 , demo:
http://reader.dogear.mobi
https://github.com/jiedan/kindlereader/tree/gae