googleapis / googleapis/google-cloud-php

Cloud Storage - Implement method to check existence of multiple objects in a single operation

Open
#2,337 4 comments 0 reactions 0 assignees View on GitHub
api: storage type: feature request
Dominant language
PHP
Stars
1.2k
Forks
463
Avg merge
2d 1h
Merged PRs (30d)
145

Description

Hello

We are using the PHP cloud storage library, and we are facing a performance issue to check existence of multiple objects in a storage bucket.
Currently, the only way to implement such check is by using a loop such as:
```
$names=["file1","file2",...,"fileN"];
foreach ($names as $name)
{
$object=$bucket->object($name);
if (!$object->exists()) {...};
}
```
This triggers a REST api call for each of the objects, which is slow. We usually have around 10 object names per loop, so this takes around 0.4s.
As we do this a lot of times, we have a performance issue.

It would be great to have a method in the Bucket class to check multiple object names at once, with a single request to the cloud storage back-end APIs (not sure such method exists in the back-end API).

Thanks !

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.