doudu5498 2011-06-13 07:18
浏览 36
已采纳

GSUtil与PHP RESTful类

We all know that working with S3 is a pain: deleting virtual directories requires to delete all the objects from within the path, etc. At least with RESTful API this is the case.

I was wondering whether there would be any performance improvement if I would use PHP to call GSUtil rather than using my own PHP class. Is there anything special the way GSUtil handles requests or is it the same REST wrapper?

The main issues I am having:

  • deleting big folders
  • uploading many small files
  • reading hierarchical data steps (e.g. only files and folders under /foo path, but not their children-children)
  • 写回答

1条回答 默认 最新

  • duanhe1903 2012-01-28 00:32
    关注

    Fundamentally, your PHP code and gsutil are both using the RESTful interface (gsutil is actually layered atop an open source Python library called boto which implements the bulk of the REST interface), however, there are several reasons to consider using gsutil:

    • Gsutil takes care of OAuth 2.0 authentication/authorization for you.
    • Gsutil does wildcard expansion, which, for example would enable you to remove all objects in a bucket by specifying, simply, 'gsutil rm gs://bucket/*'
    • Gsutil has lots of other features (get/set ACLs and associated XML parse/build, listing bucket contents, dump object contents, etc.) which you would have to implement yourself (or find in some other PHP library) if you bypass gsutil.
    • Gsutil has some nice performance capabilities for your "uploading many small files" use case. In particular, the -m option runs your uploads in parallel processes and threads, which provides a substantial performance boost.

    In summary, you can roll your own PHP code but I think you'll get your job done faster and have access to more functionality if you leverage gsutil.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了
  • ¥50 切换TabTip键盘的输入法
  • ¥15 可否在不同线程中调用封装数据库操作的类
  • ¥15 微带串馈天线阵列每个阵元宽度计算
  • ¥15 keil的map文件中Image component sizes各项意思
  • ¥20 求个正点原子stm32f407开发版的贪吃蛇游戏