MS Azure Image (blob) storage

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Hi,

I know this has been touched on several times and with nop now using .net 4.0 framework this is probably able to be implemented with much less difficulty.  I found an interesting article on it which indicates that most things are fine
http://www.danielroot.info/2009/09/ecommerce-in-cloud-running-nopcommerce.html

Images were mentioned as a problem since nop wants to save them to the file system which you cannot do in azure and need to use the azure blob storage.  I have found some example code showing how to abstract the file system storage and blob storage so that both could be supported.

I would also be keen to add a hash value to the Nop_Picture table (md5 or sha1) so that duplicate images would not need to be stored which may help to reduce the amount of storage needed.  (I know a lot of our customers often use the same image for products that are the same but have different sizes and pack types).  The filename (or blob) name for the image will be the hash.

Do you think these changes make sense?  If not did you have some alternate suggestions before I start to work on it to ensure that I haven’t gone completely in the wrong direction and would require huge changes before been considered for inclusion in the main code set.

Blob Storage
Would add a IBlobStorage interface with methods like Save, Delete, Load, GetURL etc
Modify PictureService to use IoC.Resolve<IBlobStorage>()…

Picture Hash
Add PictureHash to the Nop_Picture table nvarchar(255) (same as PasswordHash)
Add methods for FindByHash etc
May need to encode Hash using Base32 since windows files system is case insensitive. (so base64 could potentially clash).
A setting will also be required for backward compatibility otherwise all existing saved images would stop working.
Hash value would need to be initialised during an upgrade


More thoughts?

Mark
13 years ago
Been stuck doing other projects for the last couple of months but I have made a start on this and created a
IStorageService interface and created a FileSystemStorageService object.  Changed the PictureService (and some other areas) to use the IStorageService and things seem to be working as expected under ASP.NET

Have uploaded the code http://cid-0e41a9872b232e24.office.live.com/self.aspx/Public/nop^_storage.zip

I will work on creating and testing a AzureBlobStorageService object over the next couple of weeks but figured it would be worth submitting this code now. (let me know changes/imporvements etc that may be required)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.