Image ina folder or in a database

답변됨 Image ina folder or in a database

  • 2012년 4월 16일 월요일 오전 6:56
     
     

    Hello

    On azure is it better, in term of performance, to store images in a database or in a folder

    in particular when we have a large number of images?

모든 응답

  • 2012년 4월 16일 월요일 오전 7:25
     
     답변됨

    Hi,

    You should use the blob storage to store images. This will give you the best performance and the lowest cost compared to database.

    • Database: Expensive, doesn't scale that easily
    • Local folder: Not persisted (if your machine is deleted, so is your data)
    • Blob storage: cheap, very fast, will increase performance of your website (you'll be loading data from different domains)

    Sandrino


    Sandrino Di Mattia | Twitter: http://twitter.com/sandrinodm | Azure Blog: http://fabriccontroller.net/blog | Blog: http://sandrinodimattia.net/blog

    • 답변으로 제안됨 Sandrino Di Mattia 2012년 4월 16일 월요일 오전 7:25
    • 답변으로 표시됨 marck68 2012년 4월 16일 월요일 오전 7:54
    •  
  • 2012년 4월 25일 수요일 오전 3:55
     
     답변됨

    The right answer really depends on the nature of your application--particularly on how often a given image is accessed by both users and the application.

    From a performance perspective, you're generally better off using blob storage. Blobs also have the advantage of being easy to connect with the CDN.

    However, from a cost perspective, if your images are accessed frequently, you might be better off putting them in a database. There's a cost in blob storage both for the amount of data stored, and per-transaction. Transaction fees are "only" $0.01 per 10,000, but they can add up surprisingly fast (for example, if you periodically scan the files to determine counts, sizes, names, new content, or something like that). In the DB, it's only based on the space used; no per-transaction fees.

    Another option is to use either blob storage or the DB as your primary store, and use local Windows Azure storage as a cache. For blob storage as the primary, after the initial transfer, there wouldn't be any additional per-transaction fees. For SQL Azure as the primary, it would be slower than blobs on first access only.


    Check out my book: Ultra-fast ASP.NET: Building Ultra-Fast and Ultra-Scalable Websites using ASP.NET and SQL Server

    • 답변으로 표시됨 marck68 2012년 4월 25일 수요일 오전 7:01
    •