How to MAP RBsID in AllDocStreams with the name of the Blob file on the File system[SharePoint 2010 & RBS ]

Aug 3, 2010 at 6:47 AM

Hi,

I have successfully Installed and configure RBS on SharePOint 2010.

Now I want to know.

How do I fetch the Document and Its List information from the Blob file on the File System.

How the RbsId column in the AllDocStreams table is Mapped with Blob file on the File System.

Is RbsId and the file on the blob store (File System) is same?

Aug 3, 2010 at 4:08 PM

Hi Galankar,

You can use the SharePoint object model to fetch the document and its list information. RBS does not store the list information and cannot help you here.

In general, RBS is meant to encapsulate storing and retrieving blobs completely for the application. Once a blob is stored, it should be read using the RBS API only and not directly from the blob store. The RBS blob_id is an alias for the blob and does not correspond directly to the blob in the blob store. Is there a reason you want to directly access the blob?

Regards,

Pradeep.

Aug 5, 2010 at 6:34 AM

Hi Pradeep,

Thanks for the reply,
I just wanted to back track, that how the FileName (GUID) on the Blob store is associated with the RbsId in the AllDocStreams table.

I also want to find out the orphan blobs, so that I can write a small GC for Blob.

If you have any information, sample code or link on how to Access documents using Rbs API please let me know.

 

Thanks,
TusharG

Aug 5, 2010 at 6:17 PM

Hi Tushar,

RBS ships with a Maintainer, which should be used to do GC. It does two things - deletes orphan blobs from the blob store as well as deletes blobs that were deleted by the application (SharePoint) earlier. It is neither easy nor safe to write your own GC. It is not easy because RBS does not expose a "Delete" method for blobs; the only (disallowed/not recommended) way to do it would be to talk directly to the blob store and delete the blob. It is not safe because this causes inconsistencies in the RBS metadata. Why do you want to write your own GC?

To track a SharePoint document to a blob, you need to take the RBS BlobId from the AllDocStreams table and from it, retrieve two things: blob_number and collection_id. You can use the functions rbs_fn_get_blob_number and rbs_fn_get_collection_id to retrieve them. Join these with the rbs_blob_details view where (blob_number, collection_id) is a unique key. This will give you the store_pool_id and store_blob_id which are specific to the blob store. In the case of RBS Filestream provider, the store_blob_id is the GUID in a Filestream table corresponding to the pool.

Regards,

Pradeep.

Aug 6, 2010 at 6:41 AM

Hi Padeep,

Thank you for the valuable information.
actually I was not aware of the Maintainer Utility. So that is why I am trying to write a small GC for that like we need to write in EBS case.

The Information about the BlobId and Blobstore is really vaulable for me.

Just want some more information on writting RBS provider. I am planning to write our own RBS for SharePoint 2010.  Can you please guid me for this by .....

any Specification,Documents or sample code which I will be used for study purpose.

How easy/difficult it is to write our own RBS provider.?

Thanks,
TusharG

Aug 10, 2010 at 4:07 PM

Hi Tushar,

This codeplex site has a sample RBS provider that uses a file server. This is not production-ready, but is a starting point for you to understand how an RBS provider works. The provider spec is at http://msdn.microsoft.com/en-us/library/cc905212.aspx. You can also look at our blog http://blogs.msdn.com/b/sqlrbs where we post useful information from time to time.

Regards,

Pradeep.

Aug 11, 2010 at 6:15 AM

Hi Pradeep,

Thanks for your information.

These links are definitely helped me....

 

 

Thanks,
TusharG

Feb 6, 2011 at 5:55 PM

Is there a process for the reverse mapping? i.e. you know blobid and storeid and want to find either RbsId or, even better, SPListItem.Id?

Since RBS itself knows nothing of SharePoint metadata, if the blob store wants to base its logic on knowledge of application (in case this SharePoint's) information about the blob. For instance, perhaps some blobs should be stored more securely than others, or perhaps some blobs should be on faster storage.