Highlighted
fanisch
1 Copper

Custom user cloud storage

Jump to solution

Hi all,

we are trying to implement a cloud storage for the users of our site. The site is a music store and it sells content from extarnal providers. The requirement is that when a user downloads an item for the first time then the item is also stored in his/hers music library and disk space. Other users that download the same item should have a reference to their library and disk space to the that first download.

I was thinking of using the object interface and tag the object with the library guids, but I'm not sure what the maximum number of tags and tag length that is supported by Atmos. If 1000 users purchase the same item will atmos 1000 tags?

The other approach is to create a file structure with a directory per user library where we will store the objects. My question about this approach is whether we can store, instead of the object, a reference to that first download.

I also was wondering about scalability and performance issues of those 2 approaches.

I'm looking forward to hearing any ideas you have.

Labels (2)
0 Kudos
1 Solution

Accepted Solutions
8 Krypton

Re: Custom user cloud storage

Jump to solution

The ObjectID is always 44 characters.

0 Kudos
3 Replies
8 Krypton

Re: Custom user cloud storage

Jump to solution

While Atmos can have millions of objects per listable tag, each object is limited to 127 listable tags, so tagging each song with the users that purchased it would not work.  As an alternative, you could create a "soft link" object, tag it with the user's ID and then use a regular metadata tag to contain the ID of the master song file.  Then you can enumerate all of a user's songs by using their listable tag.

Also note that if you have more than about 64k listable tags, you need to "partition" the tags like a directory structure to keep less than 64k per level , e.g. 12a3f58b -> 12a3/f58b.

Using the above, the "soft link" procedure would look something like this:

String accountId = "12a3/f58b";

String songObjectId = "499ad542a1a8bc200499ad5a6b05580499c3168560a4";

MetadataList mlist = new MetadataList();

mlist.add(new Metadata(accountId, "", true));

mlist.add(new Metadata("SongId", songObjectId, false));

// Add any other song metadata (Title, Artist, etc) here.

atmos.createObject(null, mlist, null, null);

Then to list the songs owned by a user you can use listObjects:

ListOptions options = new ListOptions();

options.setIncludeMetadata(true);

List<ObjectResult> results = atmos.listObjects(accountId, options);

while(results.getToken() != null) {

    // Get more results

    results.addAll(atmos.listObjects(accountId, options));

}

fanisch
1 Copper

Re: Custom user cloud storage

Jump to solution

Thank you Jason,

we have decided to keep the reference to our application db.

Do you happen to know what is the maximum length of the object ID?

0 Kudos
8 Krypton

Re: Custom user cloud storage

Jump to solution

The ObjectID is always 44 characters.

0 Kudos