Deepesh Shetty
Deepesh Shetty

Reputation: 1166

Versioning support in Google Cloud Storage from Java?

Previously I asked one question regarding building Document management system on top of GAE using Google cloud storage Document management system using Google Cloud Storage. I think I got appropriate answers for it. This question just an extension of the same. So My question is: can I handle versioning through my java code like mention in this link (developers.google.com/storage/docs/object-versioning) like listing all versions of an object, retrieving a specfic version of an object etc.

Since I found list API's for listing, deleting objects and doing several operations on Google cloud storage but can I handle version through any API's provided by the same from Java?

Thanks in advance.

Upvotes: 2

Views: 709

Answers (1)

tuxSlayer
tuxSlayer

Reputation: 2824

As Google Cloud Storage doc states (https://developers.google.com/storage/docs/developer-guide) stored objects are immutable.

I.e. you can only delete object after storing and store new one, even with the same name.

So to have versioning you can organize data in pseudo folders. Like: bucket/file-name/version-1; data/file-name/version-2 etc. Then you need to add some BL to handle this versions (access most recent one when needed, delete outdated, etc). However, in document management system its good to think about transactions, conflicts etc. So probably you will want to manage versions in DB (on GAE?) and just store versions content in the cloud as files (i.e. named by file content hashes).

Upvotes: 1

Related Questions