新浪sae不支持写操作,需要移植代码!
- 时间:2013-01-16 18:20:06
- 分类:网络文摘
- 阅读:118 次
为什么要移植代码
SAE禁止IO写操作,代码目录不能写入。这意味着普通程序的上传图片、生成缓存等操作都不能在SAE上正常运行,这时候你需要对这些代码进行修改后才能让你的程序运行在SAE上。
SAE为什么要禁止IO写操作?
SAE采用分布式架构设计, 应用代码将部署在多台前端服务器上, 每次访问请求可能到达不同服务器。
假设现在有A、B、C、D四台服务器。用户上传一张图片到A服务器,第二次访问请求可能到达B服务器,此时将无法获取保存在A服务器上的图片。
SAE使用MemcacheX、Storage等存储型服务代替传统IO操作,效率比传统IO读写操作高,有效解决因IO瓶颈导致程序性能低下的问题。
另外,很多网站被攻击都是因为服务器有写的权限,程序代码能被黑客修改,SAE禁止写操作,也提升了服务器的安全性。
所以SAE为了提升性能和安全,禁止本地IO写操作。开发者可以使用Storage,Memcache,KVDB等服务存储需写入的数据。
Big O Simply Explained How to Rotate a Matrix (Clockwise and Anti-clockwise) in place? The Odds Are Ever in Your Favor: The Numbers Game of Earning Cli Beyond Infographics: Alternative Visual Content Strategies That 7 Keys to Business Success for Young Digital Marketers 4 Ways to Deepen Engagement with Your Blog Audience Attract Tech Talent To Your Small Business With This Expert Advi 3 Steps To A Better Classifieds Website Jailed Saudi Blogger’s Children Plead For His Release Chatbots and the Changing Art of Blogging
- 评论列表
-
- 添加评论