Start a Conversation

This post is more than 5 years old

Solved!

Go to Solution

1932

February 16th, 2012 21:00

Questions around REST API ObjectID method / use cases.

I'm struggling to understand the use cases around using "ObjectID" method. I don't see a way to present the filename of the object, and so retrieving the file I need is difficult. Suppose I upload a file “picture1.jpg” and also tag it with “pictures”, and then upload another file named “picture2.jpg” and tag it with “pictures”. I can perform a metadata Tag search for “pictures” but I will be presented with two object IDs, and no way to actually know which Object ID is the file I want. Is there a way to identify a specific file?

It would be great to get an answer on how to retrieve a specific file if there are multiple objects attached to the same tag(s). Also, to hear some hear some possible use cases around this method.

I'm also curious, are there any noticable differences in performance when using the ObjectID method over the Namespace method?

Many thanks,

Zach

222 Posts

February 17th, 2012 09:00

Zach,

If your intention is to access objects using a user defined key then you may consider using the namespace interface.  It allows you to store objects using filenames such as picture1.jpg, etc.  The namespace interface provides file system semantics that you may be looking for, but it also forces the developer to manage the keyspace for objects.  In other words, as a developer you wouldn't want to create an excessive number of objects in the same directory.

The object interface allows developers to store objects, but Atmos defines the key.  In this case the key in the key space is the object ID.  There's less management of the objects from the developer perspective, but also less control over the object or key name. 

Many applications will choose to persist the object ID in their own database and map that internally to filenames, etc.  This is the recommended method if possible.

Are you using one of our Atmos wrappers?  Can you describe your application a little more?  Happy to answer other questions or speak on the phone if necessary.

Raj

February 17th, 2012 01:00

Hi Zach,

Why not add another piece of custom metadata which has the file names as that piece of metadata?

The other alternative is that you also upload an index file which has a list of filenames and object id's. This file could also hold the object ID of the thumbnail as well so then you can build some dynamic code. The index file could be tagged with a listable index and you pick the latest version and never actually overwrite the previous version.

Just some thoughts.

Darrren

281 Posts

February 17th, 2012 09:00

Hi Zach,

It sounds like your use case really needs to use namespace.  Inside the namespace you have the same constructs as normal directories and files, so the namespace will enforce that inside your 'pictures' directory there can only be one "picture1.jpg".

Note that you can mix listable tags and namespace.  For instance, you could create all of your files in the namespace and still tag all of your pictures with "picture" and then enumerate the listable tag to find all of your pictures regardless of directory.

February 17th, 2012 09:00

Hi Darren,

The problem with using custom metadata is that it's possible to have two different files with the same file name under the same tag; so we still won't be able to distinguish between the files.

Using an index file sounds interesting... but I'm thinking again how would we manage to force an integrity rule that only one filename is allowed? I could just perform a sorting algorithm across the index file and determine if the filename already exists. But I don’t see the benefit of this in regards to “ObjectID” vs “NameSpace”. Correct me if I’m missing something here… but the index file will have too much load when it comes to reading and writing to the file, as I would have to perform a sorting algorithm every time the file is updated. More importantly, it’s a single point of failure.

February 17th, 2012 12:00

Thanks all for the replies, collectivly they have all helped me understand the general use cases between the two methods. Much appreciated to everyone.

No Events found!

Top