??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲福利在线视频,亚洲变态另类一区二区三区 ,亚洲Av无码国产一区二区http://www.tkk7.com/hengheng123456789/zh-cnSat, 10 May 2025 11:21:55 GMTSat, 10 May 2025 11:21:55 GMT60AndroidManifest.xml中定义的application name作用Q{Q?/title><link>http://www.tkk7.com/hengheng123456789/archive/2011/05/23/350848.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Mon, 23 May 2011 08:59:00 GMT</pubDate><guid>http://www.tkk7.com/hengheng123456789/archive/2011/05/23/350848.html</guid><wfw:comment>http://www.tkk7.com/hengheng123456789/comments/350848.html</wfw:comment><comments>http://www.tkk7.com/hengheng123456789/archive/2011/05/23/350848.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hengheng123456789/comments/commentRss/350848.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hengheng123456789/services/trackbacks/350848.html</trackback:ping><description><![CDATA[转自Q?a >http://www.devdiv.com/thread-45479-1-1.html</a><br /><br />q个name属性是来设|你所有activity所属于哪个application的,默认是android.app.ApplicationQ你也可以自己定义一个类<br />例如<br />public class MyApplication extends Application {<br />}<br />然后<br /><application android:icon="@drawable/icon" android:label="@string/app_name" android:name=".MyApplication">  是q儿Q将我们以前一直用的默认Applicationl他讄成我们自己做的MyApplication<br /><span style="color: red">MyApplicationcȝ作用是ؓ(f)了放一些全局的和一些上下文都要用到变量和方法之cȝ?/span><br /><img src ="http://www.tkk7.com/hengheng123456789/aggbug/350848.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hengheng123456789/" target="_blank">哼哼</a> 2011-05-23 16:59 <a href="http://www.tkk7.com/hengheng123456789/archive/2011/05/23/350848.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Amazon AWS使用体验Q{Q?/title><link>http://www.tkk7.com/hengheng123456789/archive/2011/04/29/349292.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Fri, 29 Apr 2011 09:26:00 GMT</pubDate><guid>http://www.tkk7.com/hengheng123456789/archive/2011/04/29/349292.html</guid><wfw:comment>http://www.tkk7.com/hengheng123456789/comments/349292.html</wfw:comment><comments>http://www.tkk7.com/hengheng123456789/archive/2011/04/29/349292.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.tkk7.com/hengheng123456789/comments/commentRss/349292.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hengheng123456789/services/trackbacks/349292.html</trackback:ping><description><![CDATA[转自Q?a >http://huandu.me/2010/06/19/619/</a> <div><br /> </div> <div> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">q几个月来简单体验了Amazon AWS大部分服务,现在分n一下用感受?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; "><strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Amazon EC2</strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">从各斚w来看QEC2应该是Amazon的王牌品。EC2功能全面Q它可以在数分钟内launch一个实例,可以Q理ZQ自动提?降低机器性能配置Q可以绑定EBS成ؓ(f)h高可用性特质的计算核心Q可以摇w一变成为ELB成ؓ(f)一个load balancer。这些功能非常实用,特别适合针对国外市场且快速增长的网站,可以在前期完全不受机器约束?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">EC2机器的内核在甌时指定,有很多选择Q如果有闲心Q还可以<a style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: underline; outline-style: none; outline-width: initial; outline-color: initial; color: #575757; ">做一个自׃用的</a>Q我们没用这个功能,实在太繁琐了。EC2提供了完全的root权限Q可以随意安装YӞ׃EC2一般带有够的盘I间QLarge Instancep?50GB盘I间Q,装个mysql当数据库机器也完全没有问题?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">EC2最大优势是灉|Q最大劣势则是性能。EC2的IO性能Ơ佳Q当EC2机器作ؓ(f)mysql数据库时Q系l吞吐量只能?~10 MB/sQ相比而言Q在同样数据同样E序条g下,使用真实机器则能L辑ֈ30MB/s。EC2的CPU是多个实例共享的Q一般stolen的CPU都在10%左右Q对于nginx+php-cgiq样的组合,EC2高端配置也不太能撑住压力QLCPU吃紧?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">虽说EC2劣势明显Q但׃互联|应用一般都很容易做到水qx展,它的灉|性可以很大程度缓解这个劣势,不会(x)有太大问题。不q最l我们还是放弃了EC2Q主要因Zq?月Amazon云计服务出了大量的事故Q仅5月头两周Q在同一个机房就Z5起大事故Q我们在3起事故中受媄响,每次都很不幸的都是单点EC2出问题,最长的一ơ在高峰期中断了6个小时服务,损失巨大。最郁闷的是Q到?月下旬,有一台跑数据库的EC2机器莫名奇妙盘损坏Q还有一台莫名其妙的无法sshQ让我们感觉来不靠谱Q于是决定逃离。云计算的可用性始l值得担心?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">EC2的h(hun)格相对传lIDC要贵不少Q按高端机器High-Memory Double Extra Large每小?.2US$来算Q每月就要花864US$Q再加上量费,很容易达到每台服务器1000US$的水q?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; "><strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Amazon RDS</strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">RDS是一U数据库托管服务Q通过RDS toolkit可以很方便的创徏RDS实例q立即用。据Amazon帮助文档_(d)RDS的数据库软gl护、升U、优化的工作全部由Amazon负责Q用户只需要用功能即可?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">可惜QRDSUa(b)是一个看h很美的东ѝ首先是RDSZ同时支持异构的数据库Q牺牲了很多灉|性,例如Q因为无法访问RDS的物理机器或存储I间Q得跑着mysql的RDS实例q记录slow log都成了难事,更别说什么err logQ出了问题只能一抹瞎。如果要获取bi/boq样的数据需要用专用的RDS toolkit完成Q很N成到现成的监控工具里厅R其ơ,RDS底层使用的是cM于EBS的网l存储,其IO性能差到一个o(h)人发指的地步。一个很感性的数据是:(x)使用RDS Double Extra Large DB Instance跑mysql时慢查询?%Q同h据{到EC2 High-Memory Double Extra Large实例后慢查询降ؓ(f)0.01%。最让h无语的是RDSh高于同等配置的EC2+EBShQ每时都贵过0.3US$Q相当于?5%Q省下来的钱用来雇专业运lh员Ԓl有余,而且RDS功能和灵zL还q弱于后者,不怕折腾但怕花qZ选择RDS?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">如果执意要用RDSQ那么一定要注意RDS没有固定IPQ每ơ重启实例(或过一D|_(d)都会(x)变,E序q接的时候最好写域名Q当Ӟq会(x)损失性能。此外,RDS可用性也没宣传的那么高,我们5月最先挂的就是RDS实例Q一挂就是好几个时?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; "><strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Amazon S3</strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">S3是少有的看上ȝh(hun)廉的东西Q只需要花几美元就可以拿到几十GBI间Q对一般的互联|应用来说Ԓl有余?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">S3提供丰富的API和工具上传文件。对firefox用户来说Q有一个专门的S3扩展可用Q可直接上传本地文g。还有一个s3curl.pl工具Q可以用命o(h)行传L文gQ可以方便的做到自动化?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">S3存储的文件可以直接通过域名从外|访问,不过比较郁闷的是文gN不能?#8220;?“Q一切基于文件名后面加随Z的避免缓存的做法都会(x)失效?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; "><strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Amazon CloudFront</strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">CloudFront是一UCDNQ它的访问速度据称不错Q我们ƈ没有实际使用q?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">我们不用CloudFront主要是因为很难控制文件在CloudFront中失效。根据我们的E序l构Q我们需要在静态文件后面加version信息强制用户在必要时更新到最新版Q现在由于CloudFront既不能手动invalidate某个文gQ也不能保证CloudFront上缓存的文g?qing)时更新Q可能更C(x)?4时Q,我们需要修改现在的{略才能使用到它?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">CloudFront是根据用h在网l来收费的,对于国内QCloudFront使用的是香港hQ贵于美z和Ƨ洲Q不太划。对于欧市场,我也不清楚欧CDN的h(hun)格究竟如何,无法比较。CloudFront在欧的量费用与EC2相同Q不q由于没有按时计的U费QMh?x)比EC2提供静态文件服务便宜很多?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; "><strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Amazon CloudWatch</strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">CloudWatch是一个性能数据监视器,对于q个东西我只能说太小儿科了,没看出来有什么实际的用处。一旦开启CloudWatchQAmazon׃(x)帮忙攉开启了q个服务的instance数据Q包括CPU和IO信息{。可惜,数据_ֺ不高Q大概是几分钟一ơ统计)Q数字也只是个大概|能看的数据也很少Q无论对入门者还是高手来_(d)都不能带来太多h(hun)倹{?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">CloudWatch看上L较好的是可以配合EC2/EBS/Load Balancer toolkit做一些auto scale的事情,自动提升/降低EC2/EBS参数Q还可以Q理ZQ自动launch新实例。这些东西我们都没尝试过Q有兴趣的同学可以试试?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">CloudWatchh不贵Q一台机器就只用0.1US$而已Q不q一般还是不开Q装一个其他监控Y件更靠谱?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; "><strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Amazon Premiun Support</strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">Premiun Support包括x的电(sh)话支持和一个专有的提案pȝ。从服务质量上来_(d)Amazon的客服L很热心,响应速度也很快,专业素质也不错,很不错?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">Premium Support非常贵,直是抢钱。它是按照每月总花Ҏ(gu)h(hun)格的Q最多增加总花费的16%Q最ؓ(f)无限接近?0%Q代价十分明显?/p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; "><strong style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">l语</strong></p> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 18px; padding-left: 0px; color: #575757; font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 18px; ">Amazon AWS提供丰富功能Q还有不toolkit和APIQ适合应用用。对于要求较高性能或较低成本的应用来说则不太适合Q折腾一下IDC应该辑ֈ更好效果?/p> </div> <img src ="http://www.tkk7.com/hengheng123456789/aggbug/349292.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hengheng123456789/" target="_blank">哼哼</a> 2011-04-29 17:26 <a href="http://www.tkk7.com/hengheng123456789/archive/2011/04/29/349292.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Google App EngineQ{Q?/title><link>http://www.tkk7.com/hengheng123456789/archive/2011/04/29/349279.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Fri, 29 Apr 2011 07:05:00 GMT</pubDate><guid>http://www.tkk7.com/hengheng123456789/archive/2011/04/29/349279.html</guid><wfw:comment>http://www.tkk7.com/hengheng123456789/comments/349279.html</wfw:comment><comments>http://www.tkk7.com/hengheng123456789/archive/2011/04/29/349279.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hengheng123456789/comments/commentRss/349279.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hengheng123456789/services/trackbacks/349279.html</trackback:ping><description><![CDATA[转自Q?a >http://baike.baidu.com/view/1524918.htm</a> <div> <div id="ytwyvid" class="mod-top" style="margin-bottom: 30px; font-family: arial, 宋体, sans-serif; font-size: 14px; line-height: 24px; "> <div id="rbgihqw" class="card-summary nslog-area" data-nslog-type="72" style="line-height: 25px; font-size: 14px; margin-bottom: 25px; "> <div style="float: left; width: 469px; "> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Google App Engine 是一U让(zhn)可以在 Google 的基架构上运行?zhn)的网l?a target="_blank" style="text-decoration: underline; color: #136ec2; ">应用E序</a>。Google App Engine 应用E序易于构徏和维护,q可Ҏ(gu)(zhn)的讉K量和数据存储需要的增长L扩展。?Google App EngineQ将不再需要维护服务器Q?zhn)只需上传(zhn)的应用E序Q它便可立即为?zhn)的用h供服务?/p> </div> <div id="jrpcbaa" class="clear" style="clear: both; font-size: 0px; line-height: 0; height: 0px; visibility: visible; "><br /> </div> </div> </div> <div id="spsvtmm" class="lemma-main-content" id="lemmaContent-0" style="letter-spacing: 0.5px; width: 690px; overflow-x: hidden; overflow-y: hidden; float: left; font-family: arial, 宋体, sans-serif; font-size: 14px; line-height: 24px; "> <h2 class="headline-1 first bk-sidecatalog-title" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 6px; padding-left: 0px; font-size: 18px; font-weight: bold; line-height: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #dedfe1; clear: none; "><a name="1" style="text-decoration: underline; color: #136ec2; width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=image&file=anchor.gif); background-repeat: no-repeat no-repeat; "></a><span id="extwvgk" class="headline-content">?/span></h2> (zhn)可以?Google提供的免费域名(见扩展阅读)为?zhn)?a target="_blank" style="text-decoration: underline; color: #136ec2; ">应用E序</a>提供服务Q也可以使用 Google Apps 从?zhn)自己的域为它提供服务。?zhn)可以与全世界的h׃n(zhn)的应用E序Q也可以限制为只有?zhn)l织内的成员可以讉K? <div id="yjiahzk" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> (zhn)可以免费开始?App Engine。注册一个免费帐户即可开发和发布(zhn)的应用E序以供全世界的人共享,而且不需要承担Q何费用和责Q。每个免费帐户都可用多?500MB 的持久存储空_(d)以及(qing)可支持每月约 500 万页面浏览量的?CPU 和宽?sup style="margin-left: 2px; color: #3366cc; cursor: pointer; ">[1]</sup><a name="ref_[1]" style="text-decoration: underline; color: #136ec2; width: 20px; height: 20px; text-indent: 20px; background-image: url(http://www.tkk7.com/CuteSoft_Client/CuteEditor/Load.ashx?type=image&file=anchor.gif); background-repeat: no-repeat no-repeat; "></a>? <div id="sxaayyu" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 使用 Google App Engine 的试用版本期_(d)只可以用免费帐戗?zhn)很快p够购买其他的计算资源?App Engine提供了一个web应用q行的框ӞApp Engine 应用E序易于q行、部属和扩展。App Engine不同于其他方案:(x)App Engine不是|格计算—它不能q行L的作业。它不提供物理主Z提供了打包代码上传的方式。用户在只需要在代码中指定了response和requestQ剩下的q行和部|的d׃l了App Engine。用户不需要预留资源,例如RAM、CPU或者诸如此cR? <div id="oorjmme" class="bpctrl" style="height: 30px; line-height: 30px; overflow-x: hidden; overflow-y: hidden; "></div> <h2 class="headline-1 bk-sidecatalog-title" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 6px; padding-left: 0px; font-size: 18px; font-weight: bold; line-height: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #dedfe1; clear: both; "><span id="cyqpokz" class="headline-content"><br /> 应用E序环境</span></h2> 通过 Google App EngineQ即使在重蝲和数据量极大的情况下Q也可以L构徏能安全运行的应用E序。该环境包括以下Ҏ(gu):(x) <div id="czcdnyc" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 动态网l服务,提供对常用网l技术的完全支持 <div id="jrbiooo" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 持久存储有查询、分cd事务 <div id="imponnn" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 自动扩展和蝲荷^? <div id="spsdvrg" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 用于对用戯行n份验证和使用 Google 帐户发送电(sh)子邮件的 API <div id="oskyqmm" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 一U功能完整的本地开发环境,可以在?zhn)的计机上模?Google App Engine <div id="ihzumbi" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> Google App Engine 应用E序是?Python ~程语言实现的。该q行时环境包括完?Python 语言和多?Python 标准库? <div id="iiakcuj" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 目前QGoogle App Engine 支持 Python 语言?JAVA 语言Q但是我们希望将来它可以支持更多语言? <div id="vhgfiex" class="bpctrl" style="height: 30px; line-height: 30px; overflow-x: hidden; overflow-y: hidden; "></div> <h2 class="headline-1 bk-sidecatalog-title" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 6px; padding-left: 0px; font-size: 18px; font-weight: bold; line-height: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #dedfe1; clear: both; "><span id="ynmtwaa" class="headline-content">Sandbo</span></h2> 在安全环境中q行的应用程序,仅提供对基础<a target="_blank" style="text-decoration: underline; color: #136ec2; ">操作pȝ</a>的有限访问权限。这些限制让 App Engine 可以在多个服务器之间分发应用E序的网l请求,q可以启动和停止服务器以满讉K量需求。Sandbox ?zhn)的应用程序隔d它自q安全可靠环境中,该环境与<a target="_blank" style="text-decoration: underline; color: #136ec2; ">|络服务?/a>的硬件、操作系l和物理位置无关? <div id="tmpszzk" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 安全 Sandbox 环境的限制实例包括:(x) <div id="fuisgvr" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 应用E序只能通过提供的网址获取?a target="_blank" style="text-decoration: underline; color: #136ec2; ">?sh)子邮g服务</a>?API 讉K互联|中的其他计机。其他计机只能通过在标准端口上q行 HTTPQ或 HTTPSQ请求来q接臌应用E序? <div id="ibedzvn" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 应用E序无法向文件系l写入。应用程序只能读取通过应用E序代码上传的文件。该应用E序必须使用 App Engine 数据库存储所有在h之间持箋存在的数据? <div id="rzumate" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 应用E序代码仅在响应|络h时运行,且必d几秒钟内q回响应数据。请求处理程序不能在响应发送后产生子进E或执行代码? <div id="ocehvrg" class="bpctrl" style="height: 30px; line-height: 30px; overflow-x: hidden; overflow-y: hidden; "></div> <h2 class="headline-1 bk-sidecatalog-title" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 6px; padding-left: 0px; font-size: 18px; font-weight: bold; line-height: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #dedfe1; clear: both; "><span id="cgnqepa" class="headline-content"><br /> Python q行时环?/span></h2> App Engine 提供了一个?Python ~程语言的运行时环境。将来的版本考虑使用其他~程语言和运行时环境配置? <div id="waogsfy" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> Python q行时环境?Python 2.5.2 版? <div id="cknfbff" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 该环境包?Python 标准库。当Ӟ(zhn)无法调用违反了 Sandbox 限制的库Ҏ(gu)Q例如尝试打开套接字或向文件写入。方便v见,其主要功能不受该q行时环境支持的标准库中的多个模块已被禁用,而导入这些模块的代码发生错误? <div id="swdummb" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 应用E序代码只能?Python ~写。具有用 C ~写的扩展的代码不受支持? <div id="xmassla" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> Python 环境为数据库、Google 帐户、网址获取和电(sh)子邮件服务提供了丰富?Python API。App Engine q提供了一个称?webapp 的简?Python |络应用E序框架Q从而可以轻村ּ始构建应用程序? <div id="crbehsh" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 方便赯QApp Engine q包?Django |络应用E序框架 0.96.1 版。请注意QApp Engine 数据库不是某?Django lg所需的关pL据库。某些组Ӟ例如 Django 模板引擎Q按照文档化的程序工作,而其他组件则需要做更多工作。有兛_ Django ?App Engine 一起用的提示Q请参阅文章部分? <div id="vgyubfx" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 只要q些库是完全使用 Python 实现q且不需要Q何不受支持的标准库模块,(zhn)就可以使用(zhn)的应用E序上传其他W三方库? <div id="ampzjuq" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 有关 Python q行时环境的详细信息Q请参阅 Python q行时环境? <div id="korumju" class="bpctrl" style="height: 30px; line-height: 30px; overflow-x: hidden; overflow-y: hidden; "></div> <h2 class="headline-1 bk-sidecatalog-title" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 6px; padding-left: 0px; font-size: 18px; font-weight: bold; line-height: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #dedfe1; clear: both; "><span id="piahdsh" class="headline-content"><br /> 数据?/span></h2> App Engine 提供了一个强大的分布式数据存储服务,其中包含查询引擎和事务功能。就?a target="_blank" style="text-decoration: underline; color: #136ec2; ">分布式网l?/a>服务器随讉K量增加一P?a target="_blank" style="text-decoration: underline; color: #136ec2; ">分布式数据库</a>也会(x)随数据而增加? <div id="mihkuuu" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> ?App Engine 数据库与传统关系数据库不同。数据对象(?#8220;实体”Q有一cd一l属性。查询可以检索按属性D滤和分类的给定种cȝ实体。属性值可以是受支持的属性值类型中的Q何一U? <div id="atwznyy" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 数据库的 Python API 包括一个可以定义数据库实体l构?a target="_blank" style="text-decoration: underline; color: #136ec2; ">数据建模</a>界面。数据模型可以指C属性值必M于给定范围内Q如果未l定M范围Q还可以提供默认倹{?zhn)的应用程序可以根据需要向数据提供或多或少的结构? <div id="txwdggg" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 数据库用乐观锁定进行ƈ发控制。如果有其他q程试更新某实体,而同时该实体位于以固定次数进行重新尝试的事务中,此时该实体将更新。应用程序可以在一个事务中执行多项数据库操作(全部成功或者全部失败)Q从而确保数据的完整性? <div id="vonqels" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 数据库通过其分布式|络使用“实体l?#8221;实现事务。一个事务操作一个组内的实体。同一l的实体存储在一P以高效执行事务。应用程序可以在实体创徏时将实体分配到组? <div id="wsvjqbu" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 有关数据库的详细信息Q请参阅数据?API 参考? <div id="uythzso" class="bpctrl" style="height: 30px; line-height: 30px; overflow-x: hidden; overflow-y: hidden; "></div> <h2 class="headline-1 bk-sidecatalog-title" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 6px; padding-left: 0px; font-size: 18px; font-weight: bold; line-height: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #dedfe1; clear: both; "><span id="gonbttt" class="headline-content"><br /> Google 帐户</span></h2> App Engine 包括用于?Google 帐户集成的服?API。应用程序用户可以通过 Google 帐户dQƈ可以讉K与该帐户兌?a target="_blank" style="text-decoration: underline; color: #136ec2; ">?sh)子邮g地址</a>和可昄的名U。?Google 帐户使用户可以更快地开始用?zhn)的应用程序,因?f)用户可以不需要创建新帐户了。Google 帐户q省d为?zhn)的应用程序执行用户帐L(fng)l的ȝ? <div id="bjmpasw" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 如果(zhn)的应用E序正在 Google Apps 下运行,则它可以与?zhn)l织的成员和 Google Apps 帐户成员使用相同的功能? <div id="fbilkoz" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 用户 API q可告知应用E序当前用户是否是应用程序的注册<a target="_blank" style="text-decoration: underline; color: #136ec2; ">理?/a>。这样便可以L实现(zhn)站点上仅用于管理的区域? <div id="yfvfxtt" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 有关?Google 帐户集成的详l信息,请参阅用?API 参考? <div id="ggcqtie" class="bpctrl" style="height: 30px; line-height: 30px; overflow-x: hidden; overflow-y: hidden; "></div> <h2 class="headline-1 bk-sidecatalog-title" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 6px; padding-left: 0px; font-size: 18px; font-weight: bold; line-height: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #dedfe1; clear: both; "><span id="ggqxaal" class="headline-content"><br /> App Engine 服务</span></h2> App Engine 提供了多U服务,从而(zhn)可以在理应用E序的同时执行常规操作。提供了以下 API 以访问这些服务:(x) <div id="ethvjfb" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> |址获取 <div id="ppsvycv" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 应用E序可以使用 App Engine 的网址获取服务讉K互联|上的资源,例如|络服务或其他数据。网址获取服务使用用于多其?Google 产品索网늚高?Google 基础架构来检?a target="_blank" style="text-decoration: underline; color: #136ec2; ">|络资源</a>。有关网址获取服务的详l信息,请参阅网址获取 API 参考? <div id="bbnldhz" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 邮g <div id="szguxei" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 应用E序可以使用 App Engine 的邮件服务发送电(sh)子邮件。邮件服务?Google 基础架构发送电(sh)子邮件。有关邮件服务的详细信息Q请参阅邮g API 参考? <div id="nvnuiit" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> Memcache <div id="iieogvv" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> Memcache 服务为?zhn)的应用程序提供了高性能的内存键值缓存,(zhn)可通过应用E序的多个实例访问该~存。Memcache 对于那些不需要数据库的永久性功能和事务功能的数据很有用Q例如(f)时数据或从数据库复制到缓存以q行高速访问的数据。有?Memcache 服务的详l信息,请参?Memcache API 参考? <div id="xuxlsdd" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 囄操作 <div id="ptznqxx" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 囄服务使?zhn)的应用程序可以对囄q行操作。用该 APIQ?zhn)可以?JPEG ?PNG 格式的图片进行大调整、剪切、旋转和{。有兛_片操作服务的详细信息Q请参阅囄 API 参考? <div id="jmahozr" class="bpctrl" style="height: 30px; line-height: 30px; overflow-x: hidden; overflow-y: hidden; "></div> <h2 class="headline-1 bk-sidecatalog-title" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 6px; padding-left: 0px; font-size: 18px; font-weight: bold; line-height: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #dedfe1; clear: both; "><span id="ddvrjuy" class="headline-content"><br /> 开发工作流E?/span></h2> App Engine 软g开发套?(SDK) 包括可以在?zhn)的本地计机上模拟所?App Engine 服务的网l服务器应用E序。该 SDK 包括 App Engine 中的所?API 和库。该|络服务器还可以模拟安全 Sandbox 环境Q包括检查是否存在禁用模块的导入以及(qing)对不允许讉K?a target="_blank" style="text-decoration: underline; color: #136ec2; ">pȝ资源</a>的尝试访问? <div id="gdrfixx" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> Python SDK 完全使用 Python 实现Q可以在装有 Python 2.5 的Q何^Cq行Q包?Windows、Mac OS X ?Linux。?zhn)可以?Python |站上获得适用于?zhn)的系l的 Python。该 SDK ?Zip 文g提供Q安装程序可用于 Windows ?Mac OS X? <div id="splqgkk" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> (zhn)可以在此处下蝲?SDK? <div id="rrubeta" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> ?SDK q包括可?zhn)的应用程序上传?App Engine 的工兗创Z(zhn)应用程序的代码、静态文件和配置文g后,卛_q行该工具上传数据。该工具?x)提C?zhn)提?Google 帐户?sh)子邮g地址和密码? <div id="gkyymqq" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 构徏已在 App Engine 上运行的应用E序的新主要发行版时Q可以将新发行版作ؓ(f)新版本上传。在(zhn)改Z用新版本之前Q旧版本可以l箋为用h供服务。可以在仍运行旧版本的同时在 App Engine 上测试新版本? <div id="dwozvkd" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 理控制台是Z|络的界面,用于理?App Engine 上运行的应用E序。?zhn)可以使用它创建新应用E序、配|域名、更Ҏ(gu)的应用程序当前的版本、检查访问权限和错误日志以及(qing)览应用E序数据库? <div id="khznbib" class="bpctrl" style="height: 30px; line-height: 30px; overflow-x: hidden; overflow-y: hidden; "></div> <h2 class="headline-1 bk-sidecatalog-title" style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 6px; padding-left: 0px; font-size: 18px; font-weight: bold; line-height: 24px; border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: #dedfe1; clear: both; "><span id="lpahkod" class="headline-content"><br /> 限额和限?/span></h2> 创徏 App Engine 应用E序不仅单,而且是免费的Q?zhn)可以创徏帐户Q然后发布一个应用程序,用户无需承担M费用和责d可立即用该应用E序。通过免费帐户获得的应用程序可使用多达 500MB 的存储空间和多达每月 500 万的面览量? <div id="sadkyux" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 此试用时间内Q仅提供免费帐户。?zhn)很快p够以有竞争力的市Zh(hun)D买其他的计算资源。试用期q后Q免费帐户可l箋使用? <div id="ovcmxxp" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 此试用期_(d)最多可注册 3 个应用程序? <div id="zsrbete" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 应用E序资源限制Q?#8220;限额”Q会(x)不断h。如果?zhn)的应用程序达到基于时间的限额Q例如宽带)Q则该限额将以给定限制的比率立即开始刷新。固定限额(例如存储使用量)仅在降低使用量时才会(x)减小? <div id="ncbisdv" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 有些功能?x)施加与限额无关的限Ӟ以保护系l的E_性。例如,当调用某应用E序以ؓ(f)|络h提供服务Ӟ该应用程序必d几秒钟内发出响应。如果该应用E序p的时间过长,则进E将被终止ƈ且服务器向用户q回错误代码。响应超时是动态的Q如果请求处理程序经常达到其时Q则可以~短h时以节省资源? <div id="wtekvgk" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 服务限制的另一实例是查询返回的l果数。一个查询最多可q回 1,000 条结果。要q回更多l果的查询只能返回该最大倹{在q种情况下,执行q种查询的请求不可能在超时前q回hQ但限制仍存在以节省数据库上的资源? <div id="ygybllw" class="spctrl" style="height: 14px; line-height: 14px; font-size: 12px; overflow-x: hidden; overflow-y: hidden; "></div> 试图破坏或滥用限额(例如同时在多个帐户上操作应用E序Q违反服务条ƾ,q可能导致应用程序被用或帐户关闭? <div id="ltalvvg" class="bpctrl" style="height: 30px; line-height: 30px; overflow-x: hidden; overflow-y: hidden; clear: both; "></div> <div id="mqmpovo" class="clear" style="clear: both; font-size: 0px; line-height: 0; height: 0px; visibility: visible; "></div> </div> <div id="iuitlee" class="clear" style="clear: both; font-size: 0px; line-height: 0; height: 0px; visibility: visible; font-family: arial, 宋体, sans-serif; "></div> <div id="ucubwlh" class="reinforce" id="lemmaExtend" style="font-size: 12px; font-family: arial, 宋体, sans-serif; line-height: 24px; "><dl class="nslog-area" data-nslog-type="2" id="viewRefer" style="margin-top: 0px; margin-right: 0px; margin-bottom: 30px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><dt style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: #cccccc; font-weight: bold; line-height: 1; font-size: 14px; ">参考资?/dt><dd class="reference" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; word-wrap: break-word; word-break: break-all; "> <ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "> <li id="empsvds" class="layout" style="margin-top: 12px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; zoom: 1; width: 690px; font-size: 12px; "><span id="fgjbsso" class="ref-index" style="float: left; "><span id="eieiiit" class="r-index" style="float: left; font-size: 10px; font-weight: bold; height: 16px; line-height: 16px; text-align: right; padding-left: 4px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eeeeee; color: #999999; background-position: initial initial; background-repeat: initial initial; ">1</span></span> <div id="iilszkr" class="ref-bd line-1" style="margin-left: 26px; "> <p style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">hƲ借云计算应用软gGoogle Apps打进企业挑战Office<a class="ref-top" id="refIndex_1" name="refIndex_1" title="向上跌{" style="text-decoration: none; color: #136ec2; width: 12px; height: 12px; overflow-x: hidden; overflow-y: hidden; padding-top: 0px; padding-right: 10px; padding-bottom: 0px; padding-left: 10px; margin-left: 4px; background-image: url(http://img.baidu.com/img/baike/s/up_down.gif); background-attachment: initial; background-origin: initial; background-clip: initial; background-color: initial; background-position: -1px -78px; background-repeat: no-repeat no-repeat; ">  </a></p> <p class="refUrl" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a target="_blank" style="text-decoration: underline; color: #136ec2; ">http://www.cloudcomputing-china.cn/Article/cloudcomputing/200807/142.html</a></p> </div> </li> </ul> </dd></dl><dl class="nslog-area" data-nslog-type="1" id="viewExtRead" style="margin-top: 0px; margin-right: 0px; margin-bottom: 30px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><dt style="margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; padding-top: 2px; padding-right: 0px; padding-bottom: 5px; padding-left: 0px; border-bottom-width: 1px; border-bottom-style: dashed; border-bottom-color: #cccccc; font-weight: bold; line-height: 1; font-size: 14px; ">扩展阅读Q?/dt><dd class="reference" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; color: #333333; word-wrap: break-word; word-break: break-all; "> <ul style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; list-style-type: none; list-style-position: initial; list-style-image: initial; "> <li id="bqxtawa" class="layout" style="margin-top: 12px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; zoom: 1; width: 690px; font-size: 12px; "><span id="hplvujy" class="ref-index" style="float: left; "><span id="poryuqi" class="r-index" style="float: left; font-size: 10px; font-weight: bold; height: 16px; line-height: 16px; text-align: right; padding-left: 4px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eeeeee; color: #999999; background-position: initial initial; background-repeat: initial initial; ">1</span></span> <p class="ref-bd line-1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 26px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a target="_blank" style="text-decoration: underline; color: #136ec2; ">http://code.google.com/intl/zh-CN/appengine/docs/whatisgoogleappengine.html</a></p> </li> <li id="fxalhap" class="layout" style="margin-top: 12px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; zoom: 1; width: 690px; font-size: 12px; "><span id="xmxtata" class="ref-index" style="float: left; "><span id="ujmpook" class="r-index" style="float: left; font-size: 10px; font-weight: bold; height: 16px; line-height: 16px; text-align: right; padding-left: 4px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eeeeee; color: #999999; background-position: initial initial; background-repeat: initial initial; ">2</span></span> <p class="ref-bd line-1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 26px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a target="_blank" style="text-decoration: underline; color: #136ec2; ">http://www.cloudcomputing-china.cn</a></p> </li> <li id="ggumtew" class="layout" style="margin-top: 12px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; zoom: 1; width: 690px; font-size: 12px; "><span id="swwdksl" class="ref-index" style="float: left; "><span id="wsrcubb" class="r-index" style="float: left; font-size: 10px; font-weight: bold; height: 16px; line-height: 16px; text-align: right; padding-left: 4px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eeeeee; color: #999999; background-position: initial initial; background-repeat: initial initial; ">3</span></span> <p class="ref-bd line-1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 26px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><a target="_blank" style="text-decoration: underline; color: #136ec2; ">http://china-app-blog.appspot.com</a></p> </li> <li id="cjxallh" class="layout" style="margin-top: 12px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; zoom: 1; width: 690px; font-size: 12px; "><span id="ryqpdoz" class="ref-index" style="float: left; "><span id="fcnqimt" class="r-index" style="float: left; font-size: 10px; font-weight: bold; height: 16px; line-height: 16px; text-align: right; padding-left: 4px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #eeeeee; color: #999999; background-position: initial initial; background-repeat: initial initial; ">4</span></span> <p class="ref-bd line-1" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 26px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">Google提供的免费域名:(x)appspot.com</p> </li> </ul> </dd></dl></div> </div> <img src ="http://www.tkk7.com/hengheng123456789/aggbug/349279.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hengheng123456789/" target="_blank">哼哼</a> 2011-04-29 15:05 <a href="http://www.tkk7.com/hengheng123456789/archive/2011/04/29/349279.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Google App Engine和Amazon EC2谁更强(转)http://www.tkk7.com/hengheng123456789/archive/2011/04/29/349278.html哼哼哼哼Fri, 29 Apr 2011 07:00:00 GMThttp://www.tkk7.com/hengheng123456789/archive/2011/04/29/349278.htmlhttp://www.tkk7.com/hengheng123456789/comments/349278.htmlhttp://www.tkk7.com/hengheng123456789/archive/2011/04/29/349278.html#Feedback0http://www.tkk7.com/hengheng123456789/comments/commentRss/349278.htmlhttp://www.tkk7.com/hengheng123456789/services/trackbacks/349278.htmlhttp://tech.163.com/digi/10/1111/06/6L6IS5NO001618J7.html

最q一个潜在客戯求我们比较一下Amazon EC2和Google App EngineQ正好我们刚刚在EC2和Google App Engine上完成了两个相对来说规模较大的项目,因此有必要做一下ȝQ我打算从三个角度来Ҏ(gu)q两大云计算q_Q技术,业务和未来发展趋势,本文是技术方面的Ҏ(gu)QokQ准备好咖啡Q我们开始吧!

如果按^台类型来分,大家可能已经知道Google App Engine属于PaaS(q_x?Q而Amazon EC2属于IaaS(基础设施x?QAmazon EC2l你一个安装了操作pȝ?#8220;盒子”Q你可以自己安装应用E序Q也可以使用AMI(Amazon Machine Image)Q如果你xZ个高度复杂的定制应用QAmazon EC2是不二之选,它允怽控制环境参数Q底层操作系l,存储和网l需求,从技术上Ԍ它属于很底层的服务,你可以调整你需要的大部分东ѝ?/p>

Google App Enginel你一个完整的q_Q包括完整的SDK(以及(qing)Eclipse插g)和服务,你可以构建和部v你自q应用E序Q但你不能很好地控制操作pȝQ硬件和存储Q诸如写文gpȝQ用线E等操作都有限制Q这栯计的目的是ؓ(f)了确保^C?x)被某个应用E序l架?/p>

单v来就是:(x)

IaaSQ原始硬?处理器,|络和存?

PaaSQ操作系l,pȝ软gQ开发框架和虚拟机?/p>

下面从技术角度来比较一下这两个q_?/strong>

1、提供的服务

Google App Engine凭借丰富的服务击|Amazon EC2QGoogle App Engine提供的服务可以让开发h员快速进入开发状态。如BlobstoreQImagesQMailQMemcacheQMultitenancyQOauthQTask QueuesQURL FetchQUsersQXMPPq些服务在Amazon EC2上是需要自己安装的Qؓ(f)了便于比较,假设你已lؓ(f)MemcacheQMail和多U户搭徏好了基础设施Q看看在EC2上你用了多长旉安装Q我敢打赌你?x)超q一个小Ӟ使用Google App EngineӞq些服务都是现成的,p果盘中插好牙{水果一P你可以随时n用?/p>

2、管?/strong>

Google App Engine再次胜出Q因Z旦你的应用程序部|成功后Q它几乎不需要管理,当你的应用程序负载变大时Q你不需要向服务注入新的实例QGoogle App Engine可以自由扩大负蝲能力Q新实例是实时剥ȝ。用Amazon EC2Ӟ你必L刻跟t通信量(现在可以通过脚本自动跟踪?Q新实例是在你的配置基础上剥ȝQ因此,如果我的峰D载是2x+yQ那么需要剥?个以上的应用E序服务器?/p>

此外Q用Google App Engine升应用E序服务器实例,安装新的负蝲均衡器时Q没有管理开销Q这一切都是自动执行的?/p>

3、抽象水q?/strong>

和上一条联pȝ密的是抽象水qIGoogle App Engine抽象得比较好Q你只需要关心你的应用程序和业务逻辑Q不用担心底层基设施的管理,正如Nick Johnson所说的那样Q抽象水q_作ؓ(f)挑选云计算q_的一个基本原则,你需要做的是NQ不需要研I引擎盖以下的东ѝ在我看来,如果你的核心业务是货物运输,那么你应该买一辆卡车,它能高效地把你的货物从A地运输到B圎ͼ相反Q你不应该考虑如何购买雉件自q装一辆卡车?/p>

在Y件开发领域,我们看到有GrailsQRoR{框Ӟ它们大受Ƣ迎Q是因ؓ(f)它们提供了高水^的抽象,如果你是一名惔瓦匠Q它们就象是脚手Ӟ你可以踩在它们上面干你的工作?/p>

4、可靠?/strong>

从我个h的认识来Ԍ两者都很可靠,q一点从它们的用h量就可以知道一二,用户可以时刻查看Google App Engine的状态,它是透明的,但从历史数据来看QAmazon EC2的正常运行时间比Google App Engine要好?/p>

5、可UL?/strong>

从用的底层操作pȝ和开发框架来看,Amazon EC2h更好的可UL性,但也不要担心你会(x)被Google App Enginel锁住,Google已经l出了迁UL南,指导你如何从转移出Google App Engineq_Q当然包含你所有的数据在内。还有AppScaleq样的程序可以帮助你Google App Engine上的E序转移到Amazom EC2或其它云q_上,AppScale已经可以支持EC2QEucalyptusQXen和KVM?/p>

6、存?/strong>

Google App Engine目前严重依赖于BigTableQ开发h员需要从一个完全不同的角度来认识和学习(fn)它,特别是对于那些特熟?zhn)关系数据库,被关pL据库理论束缚(x)的h更需要洗z脑Q它提供了一个JPA&JDO讉K接口Q但它不支持所有的JPA&JDO功能Q特别是关系部分QGoogle最q也高调宣布要让Google App Engine支持传统的SQL数据库。Amazon EC2已经支持SQL数据库,你可以用OracleQMySQL{你所熟?zhn)的关pL据库?/p>

7、应用程序维护和升

对Google App Engine来说Q应用程序维护和升是g轻而易丄事,它ؓ(f)各种应用E序提供了一个详l的理面板Q包括日志查看器和数据查看器Q一个程序可以有多个版本Q当新版本经q测试,可以用于生环境Ӟ你可以将其设为默认的版本Q而Amazon EC2麻烦多了,因ؓ(f)它属于IaaScdQ所有维护和升相关的事情你必须亲力亲ؓ(f)?/p>

8、开发限?/strong>

使用Google App EngineӞ你必d到^台的限制Q如果你的查询处于僵ȝ态,很难其杀掉,此外QGoogle App Engine没有U程Q提供的SDK也是受限的,有些cd功能被列入黑名单Q因此不能被使用Q也不能写文件系l等{?/p>

从表面上看这些限制是不可理喻的,但如果有朝一日你也要提供PaaScd的^台时Q你p理解Z么Google要做q些限制了,q样才能保q行在^C的应用程序不?x)违反^台的规则Q否则^台就可能被应用程序绑Ӟ从而变得不可用,q_上的其它应用E序׃(x)收到牵连?/p>

即便有这些限Ӟ90%的商业应用程序仍然可以在Google App Engine上正常运行,但对于那些要使用U程Q或写文件系l的应用Q最好还是选择Amazon EC2Q因为它提供了所有底层访问和控制权?/p>

9、语a支持

截至目前QGoogle App Engine支持Java和PythonQ但M可以转换成字节码Q可在JVM上执行的M~程语言都可以在Google App Engine上运行,如果你喜Ƣ其它编E语aQ最好选择Amazon EC2Q因Z可以在它的操作系l上面安装语aq行时环境,你拥有几乎完整的g和操作系l控制权Q还有什么不能做的呢?在Amazon EC2上也托管了许多有的C#Q?NETQASP.NET MVC/Visual Studio目Q具有讽刺意味着的是Q尽还有Microsoft AzureQ但许多以MS技术开发的目却托在Amazon EC2上?/p>

概括地说QAmazon EC2是进入云计算的早期尝试者,它利用互联网标准和开攑^台创Z一个非常灵zȝ云计^収ͼGoogle则利用了它在大型数据库方面的研究成果和它内部实现的一些技术创Z一个强大,但有更多限制的云计算环境。从核心技术来ԌAmazon EC2允许你扩展Q何计机实例到多个实例,因此你拥有每个虚拟盒子的完全控制权,Google App Engine从操作系l抽象而来Q没有计机实例的概念,如果你的Web应用E序不需要操作系l相关的功能Q那么Google App Engine无疑是最好的选择Q如果需要更好地控制你的pȝ环境Q特别是操作pȝ相关的控Ӟ那么最好选择Amazon EC2?/p>



哼哼 2011-04-29 15:00 发表评论
]]>
Android开发环境搭建全E演C(转)http://www.tkk7.com/hengheng123456789/archive/2011/04/20/348623.html哼哼哼哼Wed, 20 Apr 2011 06:15:00 GMThttp://www.tkk7.com/hengheng123456789/archive/2011/04/20/348623.htmlhttp://www.tkk7.com/hengheng123456789/comments/348623.htmlhttp://www.tkk7.com/hengheng123456789/archive/2011/04/20/348623.html#Feedback0http://www.tkk7.com/hengheng123456789/comments/commentRss/348623.htmlhttp://www.tkk7.com/hengheng123456789/services/trackbacks/348623.html

一 相关下蝲

(1) java JDK下蝲:

q入该网? http://java.sun.com/javase/downloads/index.jsp (或者直?a target="_blank">点击下蝲)如下?
选择 Download JDK 只下载JDKQ无需下蝲jre.

(2)eclipse下蝲

   q入该网? http://www.eclipse.org/downloads/ (或者直接点M?BT下蝲    HTTP下蝲) 如下?


我们选择W一?即eclipse IDE for java EE Developers)

(3)下蝲Android SDK

   说明: Android SDK两种下蝲版本Q一U是包含具体版本的SDK的,一U是只有升工具Q而不包含具体的SDK版本Q后一U大?0多MQ前一U?0多M?/span>

    完全版下?/a> (android sdk 2.1 r01)     升版下?/a> (使用q个Q本例子是使用q个q里面不包含具体版本Q想要什么版本在Eclipse里面升񔞮p)

?软g安装

   (1)安装jdk 6u19   安装完成卛_Q无需配置环境变量

   (2)解压eclipse       eclipse无需安装Q解压后Q直接打开p

   (3)解压android sdk     q个也无需安装Q解压后供后面?/span>

   (4)最l有三个文g夹,如下?

   

?Eclipse配置

   1 安装android 开发插?/span>

     (1)打开Eclipse, 在菜单栏上选择 help->Install New SoftWare 出现如下界面:


    点击 Add按钮,出现如下界面


     输入|址: https://dl-ssl.google.com/android/eclipse/    (如果出错Q请httpsҎ(gu)http)

     名称: Android (q里可以自定?

   点击OKQ将出现如下界面


点击 Next按钮 Q出现如下界?


  

点击Next按钮Q出现如下界?


选择 I accept the terms of the license agreements   点击Next,q入安装插g界面

安装完成后,出现如下界面


点击Yes按钮Q重启Eclipse

2 配置a(chn)ndroid sdk

     (1)点击菜单window->preferences,q入如下界面


   选择你的android SDK解压后的目录Q选错了就?x)报错,q个是升U工P目前q没有一个版本的SDK

Q?Q升USDK版本,选择菜单 window->Android sdk and avd manager 出现如下界面

      

   选择update all按钮Q出现如下界?/span>


选择左边的某一,点击accept表示安装Q点击reject表示不安装,我这里只选了SDK 2.1 和samples for api 7 , 自己可以L自定义,定后,选择install按钮Q进入安装界面如?

安装完成如下:

(3)新徏AVD(android vitural device)    和上面一Pq入android sdk and avd manager,选中Vitural Devices 在点击New按钮

点击New按钮后,q入如下界面:

名称可以随便取,target选择你需要的SDK版本QSD卡大自定义,点击 Create AVD,得到如下l果

如上昄创徏AVD完毕





3 新徏Android目

(1)选择菜单file->new->other q入如下界面:

选择新徏Android Project目Q点击Next按钮Q进入如下界?/span>


名称自定义,应用E序名自定义Q报名必d含一个点以上Qmin SDK version里面必须输入整数

点击Next出现如下界面:


? 若有错误? Project ... is missing required source folder: 'gen' ,则将gen->Android.Test->R.javaq个文g删掉QEclipse?x)?f)我们重新生成q个文gQƈ且不?x)报错?/span>

(3)配置q行

   右键目->Run as -> Run Configuration q入如下界面:
该界面,点击Browse 按钮Q选择你要q行的项?/span>

选择Target切换C下界?/span>


该界面选择q行的AVDQ将AVD前面的方框设|ؓ(f)选择状态?/span>

(4)试目q行

   右键目名称->run as ->Android Application 卛_启动q行该AndroidE序Q如下所C?


正在q入


试E序q行l果

 

?l束?/span>

       xQandroid开发环境搭建完毕,有问题请留言。在q里要注意,我这里只是下载了android sdk r4升工具Q没有下载具体的SDKQ而是通过在Eclipse里面的Android Sdk理工具升的,你也可以直接下蝲具体的SDK版本Q如: Android sdk 2.1 r1 上面有这个的下蝲链接Q但我Q务用升工具更好?/span>



哼哼 2011-04-20 14:15 发表评论
]]>
Amazon的WEB服务Q{Q?/title><link>http://www.tkk7.com/hengheng123456789/archive/2011/02/17/344548.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Thu, 17 Feb 2011 06:21:00 GMT</pubDate><guid>http://www.tkk7.com/hengheng123456789/archive/2011/02/17/344548.html</guid><wfw:comment>http://www.tkk7.com/hengheng123456789/comments/344548.html</wfw:comment><comments>http://www.tkk7.com/hengheng123456789/archive/2011/02/17/344548.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hengheng123456789/comments/commentRss/344548.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hengheng123456789/services/trackbacks/344548.html</trackback:ping><description><![CDATA[转自Qhttp://www.cww.net.cn/zhuanti/html/2009/4/12/20095211347521767.htm <div> <div>    作ؓ(f)一家网上书店和U上零售商,Amazon已经qؓ(f)人知Q但现在QAmazon的全C务是云计。两q多以前Q云计算q块市场开始兴PAmazon是当时ؓ(f)C多的云计提供商之一Q在今天Q全球有不少用户在计划接?#8220;?#8221;旉?x)考虑Amazon的服务?/div> <div><br /> </div> <div>    Amazon的云计算服务ȝ为AmazonWebServices(AWSQAmazon WEB服务)Q迄今它包括四种主要的服务:(x)Simple Storage Service (S3Q一U简单的存储服务)QElastic Compute Cloud (EC2Q弹性可扩展的云计算服务?QSimple Queuing Service(一U简单的消息队列)Q以?qing)仍处在试阶段的SimpleDB(单的数据库管?。换句话_(d)Amazon现在通过互联|提供存储、计处理、消息队?message queuing)、数据库理pȝ{?#8220;x即用”型的服务?/div> <div><br /> </div> <div>    q些服务所需要的巨大的后台IT基础架构是Amazon的数据中心。不q,用户只需要对自己消费了的服务q行付费QS3存储是每月每GB?5分Q根据配|不同,EC2服务器容量是每小?0-80分?/div> <div><br /> </div> <div>    目前来看QAWS已经具备了云计算的三个基本特征:(x)用户所需要的IT资源不在公司自己的数据中心里面,q些资源可以通过互联|获得,没有固定的投资成本?/div> <div><br /> </div> <div>    Amazon所提供的第一U云服务是S3Q它可以提供无限制的存储I间Q让用户存放文档、照片、视频和其他数据。其后是EC2Q用户可以选择不同的服务器配置Qƈ对实际用到的计算处理量进行付贏V?/div> <div><br /> </div> <div>    那么QAmazonZ么会(x)如此大张旗鼓地进入WEB服务领域呢?其实Q在它多q运作电(sh)子商务的q程中,Amazonq累了非常强的技术经验,而且也对其数据中心进行了极大规模的投资徏设。现在,它只是把其中一些资产开攑և来,让其他企业去使用Q同Ӟ许多CIO也不惛_自己的IT基础架构上花Ҏ(gu)多的钱,希望能找CU替代品Q所以,双方一拍即合。负责AWS产品理和开发者关pȝ副总裁AdamSelipskypQ?#8220;很多人可能不理解的是QAmazon从根本上来说q不是一家书店或零售商,而是一家技术型公司?#8221;</div> <div><br /> </div> <div>    因ؓ(f)不再需要事先部|Y件和服务器,从个人到大企业的许多开发h员已l开始登录Amazon的AWSq_来开发和提供应用软g。目前,使用Amazon的AWS服务的开发h员已l有37万h之多?/div> <div><br /> </div> <div>    AWS起初的目标是中小企业Q而不是大企业Q但现在一些大企业也开始对AWS产生了兴,毕竟它能够降低前期投资成本,有׾~自如的可扩展性以?qing)灵zȝIT资源。ؓ(f)了更好地支持q些大客PAmazon几个月前已经开始提供全天侯的电(sh)话支持以?qing)企业水准的服务。D个例子,在一个月内,如果S3的可用性降C99.9%以下Q那么,客户p获得臛_10%的信用额度。当ӞAmazonq完美Q近期它的客户也正面临着WEB站点讉K速度变慢{一pd问题?/div> <div><br /> </div> <div>    Amazon没想把自己变成一家SaaS提供商,但很多初创型企业和其他软g开发h员正在用AWS提供他们各自的SaaS产品。这里面包括VerticaQ销售基于S3的数据仓库,以及(qing)SonianQ把它的文档服务构徏在Amazon的基架构之上?/div> <div><br /> </div> </div> <img src ="http://www.tkk7.com/hengheng123456789/aggbug/344548.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hengheng123456789/" target="_blank">哼哼</a> 2011-02-17 14:21 <a href="http://www.tkk7.com/hengheng123456789/archive/2011/02/17/344548.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何构徏Apache Wink REST服务Q{Q?/title><link>http://www.tkk7.com/hengheng123456789/archive/2011/02/15/344316.html</link><dc:creator>哼哼</dc:creator><author>哼哼</author><pubDate>Tue, 15 Feb 2011 02:06:00 GMT</pubDate><guid>http://www.tkk7.com/hengheng123456789/archive/2011/02/15/344316.html</guid><wfw:comment>http://www.tkk7.com/hengheng123456789/comments/344316.html</wfw:comment><comments>http://www.tkk7.com/hengheng123456789/archive/2011/02/15/344316.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/hengheng123456789/comments/commentRss/344316.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/hengheng123456789/services/trackbacks/344316.html</trackback:ping><description><![CDATA[     摘要: 转自Qhttp://www.searchsoa.com.cn/showcontent_35288.htm   首先要介l一下REST。REST代表Representational State TransferQ它是World Wide Web所依赖的一套架构原则。Roy Fielding在他的博士论?#8220;Architectural Styles and the Design of...  <a href='http://www.tkk7.com/hengheng123456789/archive/2011/02/15/344316.html'>阅读全文</a><img src ="http://www.tkk7.com/hengheng123456789/aggbug/344316.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/hengheng123456789/" target="_blank">哼哼</a> 2011-02-15 10:06 <a href="http://www.tkk7.com/hengheng123456789/archive/2011/02/15/344316.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>HTML5崛v 2011q五大网l前端技术展望(转)http://www.tkk7.com/hengheng123456789/archive/2011/01/12/342879.html哼哼哼哼Wed, 12 Jan 2011 07:54:00 GMThttp://www.tkk7.com/hengheng123456789/archive/2011/01/12/342879.htmlhttp://www.tkk7.com/hengheng123456789/comments/342879.htmlhttp://www.tkk7.com/hengheng123456789/archive/2011/01/12/342879.html#Feedback0http://www.tkk7.com/hengheng123456789/comments/commentRss/342879.htmlhttp://www.tkk7.com/hengheng123456789/services/trackbacks/342879.html

  刚刚q去?010q里Q我们看C HTML5技术的崛vQ以?qing)CSS3的日渐成熟,l历了Rails 3.0 新版本的推出Q以?qing)全球范围内采用的@font-face selector 技术(属于CSS3 部分内容Q等{一些更多的新技术和新鲜事情。MQ?010q对于web前端开发h员来说是一个忙的一q?br />
2011q将?x)有什么web前端技术出现或者成熟?以下列D?个web技术以?qing)技术趋势,我们认ؓ(f)q些技术应该会(x)在今q进入我们的视线范围Q有些列N虽然不是具体的web开发技术,但无论如何,都会(x)或多或少的媄响到我们?br />
1. jQuery Mobile jQuery Ud应用

jQuery 已经成ؓ(f)JavaScript事实上的代名词,很大E度上是因ؓ(f)其可扩展性,易用性以?qing)在目理斚w可控。随着用于qx?sh)脑和智能手机等讑֤的触屏优化技术的演进Q以?qing)与此相关的web框架的发展,jQuery Mobile 成q_Q支持多讑֤的手机应用的非常重要的技术选择之一?br />
来多的开发者开始考虑使用html5技术来开发移动应用,建立一个稳定的易用性好的JavaScript框架成为移动技术开发h员的重要选择。jQuery Mobile具备成ؓ(f)q一框架的事实上的基。(因jQuery目前的应用范围相当广泛和普遍Q?nbsp;

2. Hardware-Accelerated Web Browsers 览器硬件加速技?br />
׃ie9使用?DirectX10以及(qing)g加速技术,大幅度提高了览器的速度和承载能力,因此Internet Explorer 9 (IE9) 目前相对于其他竞争对手来说速度奇快。Google ?Mozilla 必然?x)争先抢后地使用q些相关技术譬如硬件加速技术来应对来自 IE9的压力和竞争。今q_(d)我们大家的浏览器定会(x)飞速,Ҏ(gu)们大家绝Ҏ(gu)利好消息?br />
3. Node.js 技术以?qing)服务端JavaScript技?/strong>

Node.js技术被很多|站描述成ؓ(f) 事g驱动?JavaScript V8 引擎。本质上Q他是一个工PZ用JavaScript技术来~写服务端事仉动的工具集。什么意思?单的_(d)技术编E的时候,Ҏ(gu)不需要等?一个输入输出I/O 操作完成才能去进行另一个输入输出操作。对?Node.js 来说Q意味着它可以在服务端做所有数据运等工作Q减M客户端的压力。对于一些数据处理类的app应用来说Q像是像 实时应用、搜索引擎web爬虫、文件上传,媒体技术等{,速度是至关重要的首要环节?br />
Node.js 作ؓ(f)web前端技术实现显C层扩展C用服务端JavaScript技术,在 2011q受到广泛的应用。想了解更多的技术原理等详情Q请查看 Simon Willison 的博客?br />
4. 点击分n实时?Real-Time Clickstream Sharing Q点d享后立即呈现该分享内容到C֌或者网站等Q?br />
有无数多的方法来实现用户分享的内容呈现C联网上,包括今年出现的一些社交网站分享或者一些在U分享或者在U发布工L(fng)。随着大规模集成分享按钮的应用Q以?qing)逐渐采用客户端、weidget面lg、和在线书签{的应用方式Q这Q将使分享越来越Ҏ(gu)和简ѝ实时分享的下一方向会(x)是个人在UK历或l验分nQ在 2011q_(d)q点会(x)军_互联|是否更加好用?br />
5. No SQL Databases 无需SQL语句的数据库技?br />
NoSQLQ是一个泛定义词汇Q用来说明取代现有用SQL的数据技术,q种NoSql技术不?x)采用目前已l广泛用的传统关系型数据库技术。这UNoSQL技术近些年已经开始兴盛。无表数据库技术已l被Google Amazon h和亚马逊等巨头所xQ其取代技术有 Google?BigTable技术和 亚马逊Amazon?Dynamo技术,阿帕奇的Apache Cassandra, MongoDB, CouchDB, Voldemort 以及(qing)Riak技术等{?br />
诚然Q不同的技术实C代表着新技术是更好的,我们肯定不会(x)像扔掉小孩子一栯易放弃原有技术,技术实现的q程L有所取舍。就像Ted Dziuba wrote所_(d)“by replacing MySQL or Postgres with a different, new data store, you have traded a well-enumerated list of limitations and warts for a newer, poorly understood list of limitations and warts.”Q大致意思ؓ(f)Q选择取代 MySQL或?Postgres数据库技术,而用一个新的不同的技术方案,意味着你已l用了一个有很多局限性的不成熟技术,来取代另一个毛病多多的旧技术。)

管如此QNoSQL技术在 2011q仍然将是唯一的一个取代目前关pd数据库的新技术,q个新技术在q去几年发展Q一直朝着q个方向发展?/p>



哼哼 2011-01-12 15:54 发表评论
]]>
揭秘全球最大网站Facebook背后的那些YӞ转)http://www.tkk7.com/hengheng123456789/archive/2011/01/12/342876.html哼哼哼哼Wed, 12 Jan 2011 07:35:00 GMThttp://www.tkk7.com/hengheng123456789/archive/2011/01/12/342876.htmlhttp://www.tkk7.com/hengheng123456789/comments/342876.htmlhttp://www.tkk7.com/hengheng123456789/archive/2011/01/12/342876.html#Feedback0http://www.tkk7.com/hengheng123456789/comments/commentRss/342876.htmlhttp://www.tkk7.com/hengheng123456789/services/trackbacks/342876.html

2010q?月,Google公布全球Top 1000|站。Facebook独占鳌头?/strong>
 

 

以Facebook现在的经营规模,诸多传统服务器的技术均崩溃或Ҏ(gu)无法支撑。那么面?亿的z跃用户QFacebook的工E师们又如何让|站q稳q{呢?伯乐在线 - 职场博客的这文章将展示Facebook的工E师完成q个艰巨d所用到的一pd软g?br />

 FacebookU别规模的挑?/strong>

在我们深入细节之前,先了解一lFacebook不得不面Ҏ(gu)据,你就可以惌q种规模?/p>

  • Facebook每月的PV量:(x)630,000,000,000 Q??千亿Q?/li>
  • Facebook上的囄数量过其他囄|站的dQ包括诸如Flickrq样的图片网站)
  • 每个月有过30亿的囄上传到Facebook
  • Facebookpȝ每秒可以处理120万张囄。这q不包括F(xin)acebook的CDN处理的图片?/li>
  • 每月处理过250亿的信息内容Q包括用L(fng)态更斎ͼ评论{)
  • Facebook的服务器数量过3万台Q此数据?009q的数据Q?/li>



 Facebook所用的软g

从某些方面来_(d)Facebookq是属于LAMPcd|站Q但是,Z配合其他大量的组件和服务QFacebook对已有的Ҏ(gu)Q已l做了必要的改变、拓展和修改?br />
比如Q?/p>

  • Facebook依然使用PHPQ但Facebook已重建新的编译器Q以满在其Web服务器上加蝲本地代码Q从而提升性能Q?/li>
  • Facebook使用LinuxpȝQ但Z自n目的Q也已做了必要的优化。(其是在|络吞吐量方面)Q?/li>
  • Facebook使用MySQLQ但也对其做优化?/li>


q有定制的系l,比如Q?Haystack -- 高度可扩展的对象存储Q用来处理Facebook的庞大的囄QScribe -- Facebook的日志系l?br />
下面展现l大家的是,全球最大的C交|站Facebook所使用到的软g?br />
 Memcached  
 

Memcached是一Ƅ当有名的软g。它是分布式内存~存pȝ。Facebook(q有大量的网?用它作ؓ(f)Web服务器和MySQL服务器之间的~存层。经q多q_(d)Facebook已在Memcached和其相关软gQ比如,|络栈)上做了大量优化工作?br />
Facebookq行着成千上万的Memcached服务器,借以?qing)时处理TBU的~存数据。可以这栯QFacebook拥有全球最大的Memcached讑֤?br />
 HipHop for PHP  
 

和运行在本地服务器上代码相比QPHP的运行速度相对较慢。HipHop把PHP代码转换成C++代码Q提高编译时的性能。因为Facebook很依赖PHP来处理信息,有了HipHopQFacebook在Web服务器方面更是如虎添{?br />
HipHop诞生q程Q在FacebookQ一组工程师(最初是3位)用了18个月研发而成?br />
 Haystack  
 

Haystack是Facebook高性能的图片存?索系l。(严格来说QHaystack是一对象存储Q所以它不一定要存储囄。)Haystack的工作量大。Facebook上有过2百亿张图片,每张囄以四U不同分辨率保存Q所以,Facebook有超q?百亿张图片?br />
Haystack的作用不单是处理大量的图片,它的性能才是亮点。我们在前面已提刎ͼFacebook每秒大概处理120万张囄Q这个数据ƈ不包括其CDN处理的图片数。这可是个惊人的数据Q!Q?br />
 BigPipe  
 

BigPipe是Facebook开发的动态网处理系l。ؓ(f)了达到最优,Facebook用它来处理每个网늚分块Q也U?#8220;Pagelets”Q?br />
比如Q聊天窗口是独立索的Q新L也是独立索的。这些Pagelets是可以ƈ发检索,性能也随之提高。如此,即ɾ|站的某部分停用或崩溃后Q用户依然可以用?br />
 Cassandra  
 

Cassandra是一个没有单Ҏ(gu)障的分布式存储系l。它是前NoSQLq动的成员之一Q现已开源(已加入Apache工程Q。Facebook用它来做邮箱搜烦?br />
除了Facebook之外QCassandra也适用于很多其他服务,比如Digg?br />
 Scribe  
 

Scribe是个灉|多变的日志系l,Facebook把它用于多种内部用途。Scribe用途:(x)处理FacebookU别日志Q一旦有新的日志分类生成QScribe自动处理。(F(tun)acebook有上百个日志分类Q?br />
 Hadoop and Hive
 

Hadoop是款开源Map/Reduce框架Q它可以L处理量数据。Facebook用它来做数据分析。(前面pCQFacebook的数据量是超量的。)Hiveh于FacebookQHive可以使用SQL查询Q让非程序员比较Ҏ(gu)使用Hadoop。(?: Hive是是ZHadoop的一个数据仓库工P可以结构化的数据文件映ؓ(f)一张数据库表,q提供完整的sql查询功能Q可以将sql语句转换?MapReducedq行q行?Q?br />
 Thrift 

Facebook在其不同的服务中Q用了不同的语a。比? PHP用在前端QErlang用于聊天pȝQJava和C++用于其它地方Q等{。Thrift是内部开发的跨语a的框Ӟ把不同的语言l定在一P使之可以怺“交流”。这pFacebook的跨语言开发,变得比较L?br />
Facebook已把Thrift开源,Thrift支持的语aU类更多?br />
 Varnish  
 

Varnish是一个HTTP加速器Q担当负载均衡角Ԍ同时也用于快速处理缓存内宏V?br />
Facebook用Varnish处理囄和用L(fng)片,每天都要处理十亿U的h。和Facebook其他的应用应用一PVarnish也是开源的?br />
 Facebook可以q稳q行Q还得利于其他方?/strong>

虽然上面已经提到了一些构成Facebookpȝ的YӞ但是处理如此庞大的系l,本n是一复杂的d。所以,下面q将列出使Facebook能^E行的一些东ѝ?br />
 逐步发布&暗启?/strong>

Facebook有一个系l,他们UC?#8220;门卫”。该pȝ可以针对不同U类的用戯行不同的代码。(它简单介l了代码库中的不同条件。)该系l让Facebook逐步发布新特性、A/B试、激zM针对Facebook员工的特?{等?br />
门卫pȝ也让Facebook做些“暗启?#8221;的事情。比如,在某一Ҏ(gu)上U之前,可以Ȁz该Ҏ(gu)背后的元g。另外,它还可以做模拟压力测试,发现瓉和潜在的问题。默默启动一般都是在正式启动之前?周完成?br />
 实时pȝ的简?/span>

Facebook?x)仔l监控自w系l,有趣的是Q它q监控每个PHP函数在实时生产环境下的性能。这一实时PHP环境监控是通过一个叫XHProf的开源工具完成的?br />
 逐步用某些Ҏ(gu),借以提高性能

如果Facebook遇到性能问题QFacebook有大量的途径来逐步用不很重要的特性,以提高其核心Ҏ(gu)性能?br />
 未提到的东?/strong>

虽然q里无法q多深入g斚wQ但gl对是Facebook能达到空前规模的重要因素。比如,和其他大型网站一PFacebook也用CDN来处理静态内宏VFacebookq在国襉K的俄勒冈州徏有一大的数据中心,可以随时增加服务器?br />
当然了,除了前面已经提到的,q有其他大量的Y件没有说到。但是,希望能突出其中非常有特色的?br />
 Facebook和开源之间的“恋情”

Facebook和开源之间联p,此文不能不提Q虽不能说Facebook是多么地钟爱开源,但至可以这栯QFacebook?#8220;?#8221;着开源的?br />
Facebook不仅使用Q也捐赠Q开源YӞ比如QLinux、Memcached、MySQL、Hadoop{等Q它q内部开发不YӞq且也将之开源?br />
Facebook开发的开源工E,包括HipHop、Cassandra、Thrift和Scribe。另外,Facebook也把Tornado开源了。Tornado是一个高性能的Web服务器框Ӟ由FriendFeedq后团队开发而成。(2009q?月,Facebook收购 FriendFeed。)

QF(tun)acebook所用到的开源YӞ可以在Facebook的开源页面找到。)

 面(f)更多的大规模挑战

Facebook以一Uo(h)人难以置信的速度成长。它的用L(fng)几乎是成倍增加,z跃用户数量现已接近5ѝ而且Q谁都无法预今q底Q活跃用户量?x)到多少?br />
Facebook甚至成立了一个专门的“成长组”Q该组不断思考如何让Z使用facebookq融入到facebook中?br />
q一快速成长,意味着Facebook遇C同的性能瓉。Facebook?x)面临来q如下方面的挑战QPV、搜索、上传的囄和状态消息,用户之间的交互和用户和Facebook之间的交互带来的挑战?br />
q也是Facebook面对的事实。Facebook的工E师们将l箋L新方法来扩展Q这不只是增加服务器的问题了Q。比如,随着|站成长Q其囄存储pȝ已经多次完全重写?br />
所以,我们看到Facebook的工E师们奔向下一?#8220;山头”。我们相信他们不?x)辜负众望。毕竟,他们正跨山_(d)那个我们大多Ch仅能向往的山_(d)他们正扩展网站,那个用户来自全球各地的网站。当你实现那个里E碑Ӟ你将彪炳史册?/p>

哼哼 2011-01-12 15:35 发表评论
]]>
HBase vs Cassandra: 我们q移pȝ的原因(转)http://www.tkk7.com/hengheng123456789/archive/2011/01/12/342852.html哼哼哼哼Wed, 12 Jan 2011 06:23:00 GMThttp://www.tkk7.com/hengheng123456789/archive/2011/01/12/342852.htmlhttp://www.tkk7.com/hengheng123456789/comments/342852.htmlhttp://www.tkk7.com/hengheng123456789/archive/2011/01/12/342852.html#Feedback1http://www.tkk7.com/hengheng123456789/comments/commentRss/342852.htmlhttp://www.tkk7.com/hengheng123456789/services/trackbacks/342852.html

原文: http://ria101.wordpress.com/2010/02/24/hbase-vs-cassandra-why-we-moved/ 
原作者:(x)Dominic Williams 
原文发布日期QFebruary 24, 2010 at 7:27 pm 
译者:(x)王旭Q?a style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #004d99; ">http://wangxu.me/blog/ , @gnawuxQ?nbsp;
译旉Q?010q??1-25?/p>

我的团队q来正在忙于一个全新的产品——即发布的|络游戏 www.FightMyMonster.com。这让我们得以奢侈地LZ个全新的 NOSQL 数据库,也就是说Q我们可以把恐怖的 MySQL sharding 和昂늚可׾~性抛在脑后了。最q有很多Z直在问,Z么我们要把注意力?HBase 上{Ud Cassandra 上去。我认Q确实有q样的变化,实际上我们基本上已经把代码移植到?Cassandra 上了Q这里我给释?/p>

Z那些不熟(zhn)?NOSQL 的读者,后面的其他文章中Q我?x)介lؓ(f)什么我们将?x)在未来几年中看到地震式的?SQL ?NOSQL 的迁U,q正和向云计的q移一样重要。后面的文章q会(x)试解释Z么我认ؓ(f) NOSQL 可能?x)是贵公司的正确选择。不q本文我只是解释我们选择 Cassandra 作ؓ(f)我们?NOSQL 解决Ҏ(gu)的选择?/p>

免责声明——如果你正在L一个捷径来军_你的pȝ选择Q你必须要明白,q可不是一个详而严格的比较Q它只是概述了另一个初创团队在有限旉和资源的情况下的逻辑?/p>

Cassandra 的血l是否预a了它的未?/strong>

我最喜欢的一个工E师们用来找 bug 的谒语是“q度优先而非深度优先”。这可以可能寚w些解x术细节的人来说很ghQ因为它暗示着如果他们只是看看的话Q解x法就?x)简单很多(忠告Q只寚w些能够原谅你的同事说q个Q。我造出q个谒语的原因在于,我发玎ͼ软g问题中,如果我们我们自己在进入某行代码的l节层面之前Q先ȝ看那些高层次的考虑的话Q可以节省大量时间?/p>

所以,在谈论技术之前,我在?HBase ?Cassandra 之间的选择问题上先应用一下我的箴a。我们选择切换的技术结论可能已l可以预了QHbase和Cassandra有着q异的血l和基因Q而我认ؓ(f)q会(x)影响C们对我们的业务的适用性?/p>

严格的说QHbase 和它的支持系l源于著名的 Google BigTable ?Google 文gpȝ设计QGFS 的论文发?2003 q_(d)BigTable 的论文发?2006 q_(d)。?Cassandra 则是最q?Facebook 的数据库pȝ的开源分支,她在实现?BigTable 的数据模型的同时Q用了Z Amazon ?Dynamo 的系l架构来存储数据Q实际上QCassandra 的最初开发工作就是由两位?Amazon x?Facebook ?Dynamo 工程师完成的Q?/p>

在我看来Q这些不同的历史也导致Hbase更加适合于数据仓库、大型数据的处理和分析(如进行W(xu)eb面的烦引等Q,?Cassandra 则更适合于实时事务处理和提供交互型数据。要q行pȝ研究来证明这个观点超Z本文的范_(d)但我怿你在考虑数据库的时候总能发现q个差异的存在?/p>

注意Q如果你在寻找一个简单的证明Q你可以通过主要 committer 的关注点来进行验证:(x)大部?HBase ?committer 都ؓ(f) Bing 工作QM$ d收购了他们的搜烦公司Qƈ允许他们在数月之后l提交开源代码)。与之对应,Cassandra 的主?committer 来自 RackspaceQ用来可以自p得的支持先进的通用?NOSQL 的解x案,用来?Google, Yahoo, Amazon EC2 {提供的那些锁定在专有的 NOSQL pȝ的方案相抗衡?/p>

Malcolm Gladwell ?x)说只是?gu)q些背景的不同就可以单地选择?Cassandra。不q这是小马过河的问题。但当然Q闭着眼睛p行一个商业选择是相当困隄……

哪个 NOSQL数据库风头更?

另一个说服我们{?Cassandra 的原因是我们C֌中的大风向。如你所知,软gq_行业里,大者恒大——那些被普遍看好的^収ͼ?x)有更多集在q个q_周围Q于是,从长q看Q你可以得到更好的生态系l的支持Q也是_(d)大部分支持的软g可以从社Z获得Q也有更多的开发者可以雇佣)?/p>

如果?HBase 开始时Q我的印象就是它后面有巨大的C֌力量Q但我现在相信,Cassandra 更加强大。最初的印象部分来源?StumpleUpon ?Streamy 的两?CTO 的两个非常有说服力的的讲演,他们?Web 行业中两个在 Cassandra 成ؓ(f)一个可选系l之前的 HBase 的两个重要的贡献者,同时也部分来源于快速阅M一名?#8220;HBase vs CassandraQ?NoSQL 战役Q?#8221;的文章(大部分内定w被广泛证实了Q?/p>

势头是很隄证的Q你不得不自p行研IӞ不过我可以找到的一个重要的标志?IRC 上的开发者动向。如果你?freenode.org 上比?#hbase ?#cassandra 的开发这频道Q你?x)发?Cassandra 差不多在M时候都有两倍的开发者在Uѝ?/p>

如果你用考虑 HBase 一般的旉来考察 CassandraQ你p发现 Cassandra 的背后确实有非常明显的加速势头。你可能q会(x)发现那些逐渐出现的鼎鼎大名,?TwitterQ他们也计划q泛使用 CassandraQ?a target="_blank" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #004d99; ">q里Q?/p>

注:(x)Cassandra 的网站看h?HBase 的好看多了,但认真的_(d)q可能不仅是市场的趋ѝl吧?/p>

深入到技术部? CAP ?CA ?AP 的神?/strong>

对于分布式系l,有个非常重要的理论(q里我们在讨论分布式数据库,我相信你注意CQ。这个理UCؓ(f) CAP 理论Q由 Inktomi ?联合创始人兼首席U学?Eric Brewer 博士提出?/p>

q个理论说明Q分布式Q或׃n数据Q系l的设计中,臛_只能够提供三个重要特性中的两个——一致性、可用性和容忍|络分区。简单的_(d)一致性指如果一个h向数据库写了一个|那么其他用户能够立刻dq个|可用性意味着如果一些节点失效了Q集中的分布式pȝ仍然能l工作,而容忍分区意味着Q如果节点被分割成两l无法互盔R信的节点,pȝ仍然能够l箋工作?/p>

Brewer教授是一个杰出的人物Q许多开发者,包括 HBase C֌的很多hQ都把此理论牢记在心Qƈ用于他们的设计当中。事实上Q如果你搜烦U上的关?HBase ?Cassandra 比较的文章,你通常?x)发玎ͼHBase C֌解释他们选择?CPQ?Cassandra 选择?AP ——毫无疑问,大多数开发者需要某U程度的一致?QCQ?/p>

不过Q我需要请你注意,事实上这些生命基于一个不完全的推论。CAP 理论仅仅适用于一个分布式法Q我希望 Brewer 教授可以l一Q。但没有说明你不能设计一个系l,在其中的各种操作的底层算法选择上进行这U。所以,在一个系l中Q确实一个操作职能提供这些特性中的两个,但被忽视的问题是在系l设计中Q实际是可以允许调用者来选择他们的某个操作时需要哪些特性的。不仅如此,现实世界q不单的划分为黑白两Ԍ所有这些特性都可以以某U程度来提供。这是 Cassandra?/p>

q点非常重要Q我重申QCassandra 的优点在于你可以Ҏ(gu)具体情况来选择一个最佳的折衷Q来满特定操作的需求。Cassandra 证明Q你可以越通常?CAP 理论的解读,而世界仍然在转动?/p>

我们来看看两U不同的极端。比如我必须从数据库中读取一个要求具有很高一致性的|也就是说Q我必须 100%保证能够d到先前写入的最新的内容。在q种情况下,我可以通过指定一致性水qؓ(f)“ALL”来从 Cassandra d数据Q这时要求所有节炚w有数据的一致的副本。这里我们不h对Q何节点失效和|络分裂的容错性。在另一个极端的斚wQ如果我不特别关心一致性,或仅仅就是希望最x能Q我可以使用一致性?#8220;ONE”来访问数据。在q种情况下,从Q意一个保存有q个副本的节点获取数据都可以——即使数据有三个副本Q也q不在意其他两个有副本的节点是否失效或是否有不同Q当Ӟq种情况下我们读到的数据可能不是最新的?/p>

不仅如此Q你不必被迫生活在黑白世界中。比如,在我们的一个特定的应用中,重要的读写操作通常使用“QUORUM”一致性别,q意味着大部分存有此数据的节点上的副本是一致的——我q里是个要描qͼ具体写你?Cassandra E序之前最好还是仔l研I一下。从我们的视角看Q这q提供了一个合理的节点失效与网l分裂的耐受性,同时也提供了很高的一致性。而在一般情况下Q我们用前面提到的“ONE”一致性别,者可以提供最高的性能。就是这栗?/p>

Ҏ(gu)们来_(d)q是 Cassandra 的一个巨大的加分目。我们不仅能L地调整我们的pȝQ也可以设计它。比如,当一定数量的节点失效或出现网l连接故障时Q我们的大部分服务仍然可以l工作,只有那些需要数据一致性的服务?x)失效。HBaseq没有这么灵z,它单U地q求pȝ的一个方面(CPQ,q让我再ơ看C SQL 开发者和查询优化人员们之间的那道隔阂——有些事情最好能够超它QHBaseQ?/p>

In our project then, Cassandra has proven by far the most flexible system, although you may find your brain at first loses consistency when considering your QUORUMs.在我们的目之后Q卡桑d拉已被证明是q今为止最灉|的系l,虽然你可能发C致性第一失去你的大脑在考虑(zhn)的法定人数?/p>

在我们的目中,Cassandra 已经证明了它是有史以来最灉|的系l,虽然你可能在对这个问题进行投(QUORUMQ的时候发现的大脑失去了一致性?/p>

什么时候单体会(x)比模块化强?

Cassandra ?HBase 的一个重要区别是Q?Cassandra 在每个节Ҏ(gu)是一个单 Java q程Q而完整的 HBase 解决Ҏ(gu)却由不同部分l成Q有数据库进E本w,它可能会(x)q行在多个模式;一个配|好?hadoop HDFS 分布式文件系l,以及(qing)一?Zookeeper pȝ来协调不同的 HBase q程。那么,q是否意味着 HBase 有更好的模块化结构呢Q?/p>

虽然 HBase 的这U架构可能确实可以^衡不同开发团队的利益Q在pȝ理斚wQ模块化?HBase 却无法视Z个加分项目。事实上Q特别是对于一些小的初创公司,模块化倒是一个很大的负面因素?/p>

HBase的下层相当复杂,MҎ(gu)有疑惑的人应该读?Google ?GFS ?BigTable 的论文。即使是在一个单一节点的伪分布式模式下来架?HBase 也很困难——事实上Q我曄费力写过一快速入门的教程Q如果你要试试HBase的话看看q里Q。在q个指南里你可以看到Q设|好 HBase q启动它实际包含了两个不同系l的手工讄Q首先是 hadoop HDFSQ然后才?HBase 本n?/p>

然后QHBase 的配|文件本w就是个怪兽Q而你的设|可能和~省的网l配|有极大的不同(在文章里我写了两个不同的Ubuntu的缺省网l设|,以及(qing) EC2 里易变的 Elastic IP 和内部分配的域名Q。当pȝ工作不正常的时候,你需要查看大量的日志。所有的需要修复的东西的信息都在日志里Q而如果你是一个经验丰富的理员的话,p发现q处理问题?/p>

但是Q如果是在生产过E中出现问题Q而你又没有时间耐心查找问题呢?如果你和我们一P只有一个小的开发团队却有远大的目标Q没有经历去 7*24 的进行系l监控管理会(x)怎么样呢Q?/p>

严肃地说Q如果你是一个希望学?NoSQL pȝ的高U?DB 理员的话,那么选择 HBase。这个系l超U复杂,有灵巧双手的理员肯定能拿到高薪?/p>

但是如果你们是一个向我们一样尽力去发现隧道头的小团队的话Q还是等着听听别的闲话?/p>

胜在 GossipQ?/strong>

Cassandra 是一个完全对U的pȝ。也是_(d)没有主节Ҏ(gu)?HBase 里的 region server q样的东襎쀔—每个节点的角色是完全一L(fng)。不?x)有M特定的节Ҏ(gu)其他实体来充当协调者的角色Q集中的节点用称?“Cossip” 的纯 P2P 通信协议来协调他们的行ؓ(f)?/p>

?Gossip 的详l描q和使用 Gossip 的模型超q了本文的内容,?Cassandra 所采用?P2P 通信模型都是q的Q比如发现节点失效的消息传播到整个系l的旉Q或是一个客户应用的h被\由到保存数据的节点的旉Q所有这些过E所消耗的旉都毫无疑问的非常的短。我个h怿QCassandra 代表了当今最振奋的一U?P2P 技术,当然Q这和你?NOSQL 数据库的选择无关?/p>

那么Q这个基?Gossip 的架构究竟给 Cassandra 用户带来什么显C的好处呢。首先,l箋我们的系l管理主体,pȝ理变得单多了。比如,增加一个新节点到系l中是启动一?Cassandra q程q告诉它一个种子节点(一个已知的在集中的节点)q么单。试惛_你的分布式集可能运行在上百个节点的规模上的时候,如此L地增加新节点直是难以|信。更q一步,当有什么出错的时候,你不需要考虑是哪U节点出了问题——所有节炚w是一L(fng)Q这让调试成Z一个更加易于进行且可重复的q程?/p>

W二Q我可以得出l论QCassandra ?P2P 架构l了它更好的性能和可用性。这L(fng)pȝ中,负蝲可以被均衡地三步倒各个节点上Q来最大化潜在的ƈ行性,q个能力让系l面临网l分裂和节点失效的时候都能更加的无缝Qƈ且节点的对称性防止了 HBase 中发现的那种在节点加入和删除时的暂时性的性能都懂QCassandra 启动非常q速,q且性能可以随着节点的加入而^滑扩展)?/p>

如果你想L更多更多的证据,你会(x)对一个原来一直关?hadoop 的小l(应该?HBase 更加偏爱Q的报告很感兴趣……

一份报告胜q千a万语?/strong>我是指图?/strong>

YahooQ进行的W一?NOSQL pȝ的完整评。研I似乎证实了 Cassandra 所享有的性能优势Q从图表上看Q非常們֐?Cassandra?/p>

目前q些论文q是草稿Q你可以从这里找到这些论文:(x) 
http://www.brianfrankcooper.net/pubs/ycsb-v4.pdf 
http://www.brianfrankcooper.net/pubs/ycsb.pdf

注意Q这份报告中 HBase 仅在对一个范围的记录q行扫描q一上优于 Cassandra。虽?Cassandra 团队怿他们可以很快辑ֈ HBase 的时_(d)但还是值得指出Q在通常?Cassandra 配置中,区间扫描几乎是不可能的。我你可以无视这一点,因ؓ(f)实际上你应该?Cassandra 上面来实C自己的烦引,而非使用区间扫描。如果你对区间扫描和?Cassandra 中存储烦引相关问题有兴趣Q可以看我的q篇文章?/p>

最后一点:(x) q篇文章背后?YahooQ研I团队正试让它们的评测应用通过法律部门的评伎ͼq将它发布给C֌。如果他们成功的话,我当然希望他们成功,我们能够看C个持l的竞争场面Q不?HBase q是 Cassandra 无疑都会(x)q一步提高他们的性能?/p>

锁和有用的模块?/strong>

毫无疑问Q你?x)?HBase 阵营听到q样的声韻I(x)HBase 的复杂结构让它可以提?Cassandra ?P2P 架构无法提供的东ѝ其中一个例子可能就?Hbase 提供l开发者行锁机Ӟ?Cassandra 则没有(?HBase 中,因ؓ(f)数据副本发生?hadoop 底层Q行锁可以由 region server 控制Q而在 Cassandra ?P2P 架构中,所有节炚w是^{的Q所以也没有节点可以像一个网囊栯责锁定有副本的数据)?/p>

不够Q我q是把这个问题返回到关于模块化的争论中,q实际是?Cassandra 有理的。Cassandra 通过在对U节点上分布式存储数据来实现?BigTable 的数据模型。它完整地实Cq些功能Q而且是以最灉|和高性能的方式实现的。但如果你需要锁、事务和其它功能的话Q这些可以以模块的方式添加到你的pȝ之中——比如,我们发现我们可以使用 Zookeeper 和相关的工具来很单地为我们的应用提供可扩展的锁功能(对于q个功能QHazelcast {系l可能也可以实现q个功能Q虽然我们没有进行研IӞ?/p>

通过Z个窄领域目的来最化它的功能Q对我来_(d)Cassandra 的设计达C它的目的——比如前面指出可配置?CAP 的折街这U模块性意味着你可以依据你的需求来构徏一个系l——需要锁Q那么拿?ZookeeperQ需要存储全文烦引,拿来 Lucandra Q等{。对于我们这L(fng)开发者来_(d)q意味着我们不必部v复杂度超出我们实际需要的pȝQ给我们提供了更加灵zȝ构徏我们需要的应用的终极道路?/p>

MapReduceQ别?MapReduceQ?/strong>

Cassandra 做的q不够好的一件事情就?MapReduceQ对于不_N此Ҏ(gu)术同学简单的解释一句,q是一个用于ƈ行处理大量数据的pȝQ比如从上百万从|络上抓取的面提取l计信息。MapReduce 和相关系l,比如 Pig ?Hive 可以?HBase 一赯好协作,因ؓ(f)它?HDFS 来存储数据,q些pȝ也是设计用来使用 HDFS 的。如果你需要进行这L(fng)数据处理和分析的话,HBase 可能是你目前的最佳选择?/p>

CQ这像马q河Q?/p>

因此Q我停止了对 Cassandra  的优点的赞美Q实际上QHBase ?Cassandra q不一定是一对完全的竞争Ҏ(gu)。虽然它们常常可以用于同L(fng)用途,?MySQL ?PostgreSQL cMQ我怿在将来它们将?x)成Z同应用的首选解x案。比如,据我所?StumbleUpon 使用?HBase ?hadoop MapReduce 技术,来处理其业务的大量数据。Twitter 现在使用 Cassandra 来存储实时交互的C֌发言Q可能你已经在某U程度上使用它了?/p>

作ؓ(f)一个有争议的(f)别赠aQ下面我们进入下一个话题?/p>

注意Q在l箋下一个小节之前,我要指出QCassandra ?0.6 版本?x)?hadoop 支持Q所?MapReduce 整合能获得更好的支持?/p>

兄弟Q我不能失去数据…

作ؓ(f)先前 CAP 理论争议的一个可能结果,可能有这L(fng)印象QHBase 的数据似乎比 Cassandra 中的数据更安全。这是我希望揭露的最后一个关?Cassandra 的秘密,当你写入新数据的时候,它实际上立刻它写入一个将要存储副本的仲裁节点?commit log 当中了,也被复制C节点们的内存中。这意味着如果你完全让你的集群掉电(sh)Q只可能?x)损失极数据。更q一步,在系l中Q通过使用 Merkle tree 来组l数据的q分不一_(d)数据熵)Q更加增加了数据的安全?img alt="Q)" src="http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif" style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; font-size: 13px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; outline-width: 0px; outline-style: initial; outline-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; max-width: 576px; " />

事实上,我对 HBase 的情况ƈ不是非常切——如果能有更l节的情况,我回快更新q里的内容的——但现在我的理解是,因ؓ(f) hadoop q不支持 appendQHBase 不能有效地将修改的块信息刷入 HDFS Q新的对数据变化?x)被复制为多个副本ƈ怹化保存)。这意味着?x)有一个更大的~口Q你最新的更改是不可见的(如果我错了,可能是这P请告诉我Q我回修正本文)?/p>

所以,管希腊话中的 Cassandra 非常不幸Q译注:(x)Cassandra 是希腊神话里Q特z伊的那个可怜的奛_知的名字Q如果你不知道详情的话,可以参考wikiQ,但你?Cassandra 中的数据不会(x)有危险?/p>

注意QWade Amold 指出Q?hadoop .21 很快׃(x)发布Q其中将?x)解?HBase 的这个问题?/p>

哼哼 2011-01-12 14:23 发表评论
]]>
վ֩ģ壺 ۺС˵ɫɫ| ձĻ߿| ۺ| ֻѸۿ| ģ߹ۿ| jizzjizzƵѿ| ұͨӰƬ߲ | ޴Ů߹ۿ| xxxx߳Ƶ| һaƬþëƬ | ޹ŷպƷһ| ɫAëƬѿ| va߹ۿ| 97ɫ׳Ƶ| ޳AƬ| ޾ñĻ| ޾Ʒ͵Բ| ȫ߲ëƬ| 4444wwwѿ| ý߹ۿƵѹۿ | ޳˸߹ۿ| Ʒ޸һ| ³˿Ƭһ| ëƬѹۿƵ| Ļ˿Ʒһ| ޾Ʒ߹ۿ| AVרAV| պƷרҹ| ʮ˽վ߹ۿ| ޺ݺݰۺӰԺ| þþƷž޾Ʒ| ŮһëƬѹۿ| 97Ƶ| AVһ߹ۿ| ޾Ʒ˽Ĺ| aƬձþ| 91Ƶַ| Ƶһ| ޳˼С˵| þù׾Ʒǿ| ղƵ߹ۿ |