新浪sae不支持写操作,需要移植代码!

  • 时间:2013-01-16 18:20:06
  • 分类:网络文摘
  • 阅读:89 次

   为什么要移植代码

   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等服务存储需写入的数据。

推荐阅读:
3 Ways to Convert Blog Readers to Leads  7 Ways To Deal With AdBlock Users If You’re A Blogger  2020 Design Trends [Infographic]  8 Content Marketing Plugins You Need For Your WordPress Blog  Tips to Make Money from the Comfort of Your Own Home  5 Tips for Protecting Your Freelance Business from Liabilities  5 Easy Ways On How To Build An Authority Website  How to Protect Your WordPress Site From Hackers  Top 10 Relationship Blogs With the Best Pieces of Advice in 2020  How to Construct Binary Search Tree from Preorder Traversal in P 
评论列表
添加评论