Pergunta

Avatar image: store in database or on CDN?

Ps( avatar is the users profile photo)

Foi útil?

Solução

Why store it yourself when you can just use http://en.gravatar.com/ or similar like Stack Overflow uses?

Outras dicas

If you store in database, the image file are uncacheable, because user browser will cache the image file by the link so that it don`t have to download the file again.

Normally, user avatar files are store in file dictionary, so it have a permalink for the image file.

You can use CDN to accelerate the loading speed and save the bandwidth of user avatar.

Both ways have their advantages.

Storing images in the file system is of great advantage for applications that have:

  • Small and simple logic
  • Images that are static and doesn’t change very often
  • No concern for security
  • Extremely large images such as maps

Storing images in SQL Server is of great advantage for applications that have:

  • Highly sensitive image data such as medical x-rays or court evidence where security is extremely important
  • High availability requirements
  • Maintainability requirements
  • Very large size (such as a HR system with more than 200,000 employees with very fast movement of such as rehire and resignation)
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top