SlideShare une entreprise Scribd logo
1  sur  54
使用 GoogleAppEngine
 建立个人信息中心


              weibo.com/sagasw
                       2011-11
Agenda

  1 )云计算那些事儿
   
  2 ) Google AppEngine
   
  3 ) GAE 个人信息中心

  4 ) Resources
调查

1 ) Python 语言?
 
2 ) Google AppEngine ?
 
3 )云计算平台?
1 )云计算那些事儿

     
• 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 ,易度 
云平台比较




http://www.eecs.berkeley.edu/Pubs/TechRpts/2009/EECS-2009-28.pdf
调查 - 虚拟化软件
调查 - 公有云计算平台
 

     新浪微博 @_ 浪潮之巅 _ :

     中国很多大公司 ( 主要是央企 ) ,对云计算理解就是 IDC
    和设备。
     美国的 case 都是应用。美国这点认识比较一致:
    IDC 和最基础的东西让 Google , Facebook 和 Amazon 去
    做。 



    http://weibo.com/2142166543/xtKu40qgP
http://addons.heroku.com/
2 ) Google AppEngine

          
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 操作方式
适用于:
Wiki,CMS, 博客 , 微博 , 手机游戏后台 ,
应用服务器 , 问答网站 , 电子书发
布 ,SNS, 网店 , 工作流

不适合:
音频视频服务 , 大文件 , 密集计算
Web Framework

  Django
  WebApp2
  Tornado
   
   


https://github.com/facebook/tornado/tree/master/demos/appengine
Python library

 BeautifulSoup, PythonTwitter, Readability
 PIL, PyCrypto, lxml 等等


 可直接用于 AppEngine?

  • 不依赖 C 扩展
  • 不使用数据库
  • 不访问本地资源
 http://pypi.python.org/pypi
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/
JRuby on 
Google App Engine

code.google.com/p/appengine-jruby/
github.com/jruby/jruby-rack



                    
Lua in Appengine




http://code.google.com/p/aelua/
http://code.google.com/p/jillcode/
http://code.google.com/p/kahlua/
https://github.com/krka/kahlua2
http://sourceforge.net/projects/luaj/
企业使用 ?

 • 比较容易扩展
 • 管理方便
 • 用于特定任务 
 • 更推荐 EC2
 
    http://code.google.com/appengine/business/
    http://code.google.com/appengine/docs/premier/index.html
 
  
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
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/ 
3 )使用 GAE 建立个人信息中心


         
个人常用的信息服务
 • TwitterWeb 客户端,可以同步到新浪腾讯网
   易搜狐
 • RSS 聚合阅读
 • 获取网页 (urlfetch) ,解析短网址
 • Cron Jobs
 • 在线个人笔记,在线个人博客
 • 网络小说阅读
 • 推送文章到 Kindle
 • 发送天气短信给自己
 • 生日提醒(邮件,聊天工具,短信等多种手段
   )
 • 监控 iphone 购买网页的变化
 • 相册
 • proxy
个人信息平台已经实现的功能

1 )选择现成代码进行修改( V2EX,Micolog,
GaeBBS )
2 )同步发推 , 新浪微博功能 ,t.co 扩展
3 )定期采集 RSS 功能
4 )支持 Google Reader share
5 ) HN 文章全文阅读, RSS Feed 输出
6 )网页内容变化,通过短信提醒
7 )支持 XMPP 协议( gtalk )客户端自动聊天
新浪微博 腾讯微博
    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 作中转


 
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()
 




    https://gist.github.com/1298152
https://gist.github.com/1312657
资源使用情况(优化前)
资源使用情况(优化后)
Mobile01 洁净版
阅读功能设计全过程

 • 分析网页内容
 • 设计抓取方式
 • HTML readability
   – viewtext.org, www.instapaper.com/m?u=

 • 下载图片
 • 添加文章
4 ) Resources
其它云平台
Amazon EC2
Heroku (免费 + 付费)
Microsoft Azure
Sina AppEngine
Node AppEngine (内测中)
Yo2Lua Lua AppEngine (内测中)
Useful links
http://googleappengine.blogspot.com/
http://www.v2ex.com/go/gae
http://www.neopythonic.blogspot.com/
http://blog.notdot.net/
http://www.billkatz.com/
http://www.franciscosouza.com/tag/google-app-engine/
http://highscalability.com/google-architecture
https://groups.google.com/forum/#!forum/google-appengine
http://www.reddit.com/r/AppEngine/
可用于微创新的项目
http://code.google.com/p/appscale/
http://code.google.com/p/app-engine-site-creator/
http://code.google.com/p/google-app-engine-samples/
http://code.google.com/p/fantasm/
https://github.com/metachris/feedmailer
http://code.google.com/p/jaikuengine/
http://code.google.com/p/appengine-mapreduce/
http://code.google.com/p/rietveld/
https://github.com/xuming/micolog
https://github.com/livid/v2ex
http://code.google.com/p/gae-bbs/
 
    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
Q & A

   

Contenu connexe

En vedette (20)

淘宝移动端Web开发最佳实践
淘宝移动端Web开发最佳实践淘宝移动端Web开发最佳实践
淘宝移动端Web开发最佳实践
 
Driegeleding
DriegeledingDriegeleding
Driegeleding
 
Chapter1
Chapter1Chapter1
Chapter1
 
Basic stat review
Basic stat reviewBasic stat review
Basic stat review
 
The super scientist
The super scientistThe super scientist
The super scientist
 
การจัดอาหารให้ลูกก่อนวัยเรียน
การจัดอาหารให้ลูกก่อนวัยเรียนการจัดอาหารให้ลูกก่อนวัยเรียน
การจัดอาหารให้ลูกก่อนวัยเรียน
 
Comm 201 Presentation
Comm 201 PresentationComm 201 Presentation
Comm 201 Presentation
 
Smartech
SmartechSmartech
Smartech
 
My favorite tv show is
My favorite tv show  isMy favorite tv show  is
My favorite tv show is
 
UN VIAJE EN EL TIEMPO
UN VIAJE EN EL TIEMPOUN VIAJE EN EL TIEMPO
UN VIAJE EN EL TIEMPO
 
Obesity powerpoint
Obesity powerpointObesity powerpoint
Obesity powerpoint
 
ท้องถิ่นไทย
ท้องถิ่นไทยท้องถิ่นไทย
ท้องถิ่นไทย
 
UCLA OR12
UCLA OR12UCLA OR12
UCLA OR12
 
Finalpowerpoint
FinalpowerpointFinalpowerpoint
Finalpowerpoint
 
20141229 majalah detik_161
20141229 majalah detik_16120141229 majalah detik_161
20141229 majalah detik_161
 
Langdurig problematische gezinssituaties
Langdurig problematische gezinssituatiesLangdurig problematische gezinssituaties
Langdurig problematische gezinssituaties
 
Viergeleding
ViergeledingViergeleding
Viergeleding
 
Broadcast news archive OR12
Broadcast news archive OR12Broadcast news archive OR12
Broadcast news archive OR12
 
The Historical Development of Country Music
The Historical Development of Country MusicThe Historical Development of Country Music
The Historical Development of Country Music
 
ระบบเครือข่ายคอมพิวเตอร์
ระบบเครือข่ายคอมพิวเตอร์ระบบเครือข่ายคอมพิวเตอร์
ระบบเครือข่ายคอมพิวเตอร์
 

Similaire à 使用GoogleAppEngine建立个人信息中心

Using google appengine_final
Using google appengine_finalUsing google appengine_final
Using google appengine_finalWei Sun
 
Using google appengine (2)
Using google appengine (2)Using google appengine (2)
Using google appengine (2)Wei Sun
 
Using google appengine_1027
Using google appengine_1027Using google appengine_1027
Using google appengine_1027Wei Sun
 
Appcan平台介绍
Appcan平台介绍Appcan平台介绍
Appcan平台介绍36Kr.com
 
introduction of web 2.0
introduction of web 2.0introduction of web 2.0
introduction of web 2.0soboring
 
Appcan介绍自己的应用开发平台
Appcan介绍自己的应用开发平台Appcan介绍自己的应用开发平台
Appcan介绍自己的应用开发平台MOBINODE
 
美团前端架构简介
美团前端架构简介美团前端架构简介
美团前端架构简介pan weizeng
 
Appcan移动应用开发平台介绍120409
Appcan移动应用开发平台介绍120409Appcan移动应用开发平台介绍120409
Appcan移动应用开发平台介绍120409zhengyiwuxian
 
HTML5 生态系统和应用架构模型
HTML5 生态系统和应用架构模型HTML5 生态系统和应用架构模型
HTML5 生态系统和应用架构模型Tom Fan
 
构建网络工具箱
构建网络工具箱构建网络工具箱
构建网络工具箱Lv Jian
 
GMIC 2012 - Baidu, Presentation by Mr Wang Jin, 百度副总裁王劲
GMIC 2012 - Baidu, Presentation by Mr Wang Jin, 百度副总裁王劲GMIC 2012 - Baidu, Presentation by Mr Wang Jin, 百度副总裁王劲
GMIC 2012 - Baidu, Presentation by Mr Wang Jin, 百度副总裁王劲Great Wall Club
 
6 rexsee:会html就会android
6 rexsee:会html就会android6 rexsee:会html就会android
6 rexsee:会html就会android36Kr.com
 
千万级并发在线推送系统架构解析 | 个信互动 叶新江
千万级并发在线推送系统架构解析 | 个信互动 叶新江千万级并发在线推送系统架构解析 | 个信互动 叶新江
千万级并发在线推送系统架构解析 | 个信互动 叶新江imShining @DevCamp
 
Chapter7-2 信息技术与学习科学
Chapter7-2 信息技术与学习科学Chapter7-2 信息技术与学习科学
Chapter7-2 信息技术与学习科学Lester,Gaofeng Ruan
 
[DCTPE2010] Drupal 遇上行動網路服務
[DCTPE2010] Drupal 遇上行動網路服務[DCTPE2010] Drupal 遇上行動網路服務
[DCTPE2010] Drupal 遇上行動網路服務Drupal Taiwan
 
4. Go 工程化实践-0124-v2.pdf
4. Go 工程化实践-0124-v2.pdf4. Go 工程化实践-0124-v2.pdf
4. Go 工程化实践-0124-v2.pdfssuserd6c7621
 
Nodejs & NAE
Nodejs & NAENodejs & NAE
Nodejs & NAEq3boy
 
雲端技術的新趨勢
雲端技術的新趨勢雲端技術的新趨勢
雲端技術的新趨勢Ben Huang
 
災難演練 @ AWS 實戰分享 (Using AWS for Disaster Recovery)
災難演練 @ AWS 實戰分享 (Using AWS for Disaster Recovery)災難演練 @ AWS 實戰分享 (Using AWS for Disaster Recovery)
災難演練 @ AWS 實戰分享 (Using AWS for Disaster Recovery)Rick Hwang
 

Similaire à 使用GoogleAppEngine建立个人信息中心 (20)

Using google appengine_final
Using google appengine_finalUsing google appengine_final
Using google appengine_final
 
Using google appengine (2)
Using google appengine (2)Using google appengine (2)
Using google appengine (2)
 
Using google appengine_1027
Using google appengine_1027Using google appengine_1027
Using google appengine_1027
 
Appcan平台介绍
Appcan平台介绍Appcan平台介绍
Appcan平台介绍
 
introduction of web 2.0
introduction of web 2.0introduction of web 2.0
introduction of web 2.0
 
Appcan介绍自己的应用开发平台
Appcan介绍自己的应用开发平台Appcan介绍自己的应用开发平台
Appcan介绍自己的应用开发平台
 
美团前端架构简介
美团前端架构简介美团前端架构简介
美团前端架构简介
 
Appcan移动应用开发平台介绍120409
Appcan移动应用开发平台介绍120409Appcan移动应用开发平台介绍120409
Appcan移动应用开发平台介绍120409
 
HTML5 生态系统和应用架构模型
HTML5 生态系统和应用架构模型HTML5 生态系统和应用架构模型
HTML5 生态系统和应用架构模型
 
构建网络工具箱
构建网络工具箱构建网络工具箱
构建网络工具箱
 
GMIC 2012 - Baidu, Presentation by Mr Wang Jin, 百度副总裁王劲
GMIC 2012 - Baidu, Presentation by Mr Wang Jin, 百度副总裁王劲GMIC 2012 - Baidu, Presentation by Mr Wang Jin, 百度副总裁王劲
GMIC 2012 - Baidu, Presentation by Mr Wang Jin, 百度副总裁王劲
 
6 rexsee:会html就会android
6 rexsee:会html就会android6 rexsee:会html就会android
6 rexsee:会html就会android
 
雲端技術的新趨勢
雲端技術的新趨勢雲端技術的新趨勢
雲端技術的新趨勢
 
千万级并发在线推送系统架构解析 | 个信互动 叶新江
千万级并发在线推送系统架构解析 | 个信互动 叶新江千万级并发在线推送系统架构解析 | 个信互动 叶新江
千万级并发在线推送系统架构解析 | 个信互动 叶新江
 
Chapter7-2 信息技术与学习科学
Chapter7-2 信息技术与学习科学Chapter7-2 信息技术与学习科学
Chapter7-2 信息技术与学习科学
 
[DCTPE2010] Drupal 遇上行動網路服務
[DCTPE2010] Drupal 遇上行動網路服務[DCTPE2010] Drupal 遇上行動網路服務
[DCTPE2010] Drupal 遇上行動網路服務
 
4. Go 工程化实践-0124-v2.pdf
4. Go 工程化实践-0124-v2.pdf4. Go 工程化实践-0124-v2.pdf
4. Go 工程化实践-0124-v2.pdf
 
Nodejs & NAE
Nodejs & NAENodejs & NAE
Nodejs & NAE
 
雲端技術的新趨勢
雲端技術的新趨勢雲端技術的新趨勢
雲端技術的新趨勢
 
災難演練 @ AWS 實戰分享 (Using AWS for Disaster Recovery)
災難演練 @ AWS 實戰分享 (Using AWS for Disaster Recovery)災難演練 @ AWS 實戰分享 (Using AWS for Disaster Recovery)
災難演練 @ AWS 實戰分享 (Using AWS for Disaster Recovery)
 

使用GoogleAppEngine建立个人信息中心