none
[PHP] Using Azure Storage SDK in Server ( Php)

    Question

  • Hello everyone,

    I'd like to know how Data bits flow when we use Azure SDKs in server for Storage Service.

    Assume I've got a server & hosting Asp.net/Php website which users Azure Storage SDK.

    When I upload a file to Storage BLOB,  Does the bits of the Uploaded file flow through my server and reach Azure storage Container ?

    OR it directly uploads the bits from my browser to Azure container server?

    I'm trying to see if I can take advantage of high config/performance of Azure container servers. But if the bits are going to go through my little server, then it's gonna get choked.

    Could someone shed some light on this?

    If I'm using the SDK in Phone client, like iOS, Android , the flow is clear, it's directly flushing the Buffer straight from Device into Azure servers. 

    But when it comes to web, I think it's going through the server.  If yes, it'd be a bottle neck, correct? 

    If Yes, is there a way to escape this bottle neck?

    May be using JS SDK?


    StackDev







    Monday, November 14, 2016 9:38 AM

All replies

  • Hello,

    We are checking on the query and would get back to you soon on this.I apologize for the inconvenience and appreciate your time and patience in this matter.

    Regards,
    Sumanth BM

    Monday, November 14, 2016 5:06 PM
    Moderator
  • It doesn't go through your server, it should upload the file directly to Azure Storage. This probably depends on how you're doing the upload. If you are using the SDK and calling UploadBlob, you're golden. If you're reading the whole blob into memory and then streaming it out to storage, I can't be certain that will work the same way.

    You can always run fiddler on the web application and upload the blob and see where the traffic goes.

    Robin


    Sr. Content Developer at Microsoft

    Tuesday, November 15, 2016 2:48 AM
  • >If you are using the SDK and calling UploadBlob, you're golden

    Thanks a lot.

    I think the php code what the devs used should be this :

    $content = fopen("c:\myfile.txt", "r");
    $blob_name = "myblob";
    
    try {
        //Upload blob
        $blobRestProxy->createBlockBlob("mycontainer", $blob_name, $content);
    }

    They'd refer this doc:

    https://azure.microsoft.com/en-in/documentation/articles/storage-php-how-to-use-blobs/

    I'm trying to understand if all these code is put as server script (php), how the File-buffer would be streamed from the browser? It might be more convincing if the Storage SDK was a Javascript one.

    I'm just trying to see through things.  Thanks for the replies.




    StackDev

    Tuesday, November 15, 2016 1:46 PM
  • >You can always run fiddler on the web application and upload the blob and see where the traffic goes.

    Sure I'd try this too.  


    StackDev

    Tuesday, November 15, 2016 1:50 PM