To store images in file system, database, or blob? [closed] - image

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have roughly 600 static images that I need to store and use for my web app and I was wondering what kind of options I have for this application.
What is the typical procedure?
What are my options, and what are the pro's and con's of each?
Thanks ahead of time.

You should store static resources that you want to serve from your site somewhere under the wwwroot folder. I recommend putting them in an images subfolder, but you can use whatever organization works for you. There are many reasons why it can be worthwhile to use a Content Delivery Network (CDN) for serving your static resources, including scripts, stylesheets, and images, in which case you might want to store your images there. For example Amazon CloudFront is an inexpensive CDN service you can use for this purpose. This will speed up your page load times since the images will load in parallel with your site's assets, it will reduce load on your server, and the CDN server will host the images on edge servers that are geographically close to the client (so clients on the other side of the world from your server will get the files faster than if they loaded them from your server).
Overall this isn't so much an ASP.NET Core question, but a general web site question. ASP.NET Core will serve static resources (as long as you have the static files middleware installed), but other than that it doesn't have a lot to do with it. Just put the files under wwwroot and you're good to go unless you think it's worth using a CDN.

Related

What are the possible ways of storing web contents ( images,videos,pdf etc)? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
We are planning to host one web app which uses multiple resources like banner images, videos, pdf and they need to be changed by time. If we package those resources in app, app size will get increased and in every change we need to repackage and redeploy.
So we have planned to have aws S3 and cloudFront cdn for serving all static web content and we can use them in application.
Please suggest pros and cons of our architecture and other possible ways of achieving it.
Yes. AWS S3 is indeed a very good choice for hosting your static assets.
As stated by AWS itself :
S3 is a highly durable, highly available, and inexpensive object
storage service that can serve stored objects directly via HTTP. This
makes it wonderfully useful for serving static web content directly to
web browsers for sites on the Internet.
What does your "app" do? Is it just to display static content? Or does it have a solid backend?
Since it is unclear, to get started, here is a wonderful resource from the official AWS site :
https://aws.amazon.com/getting-started/projects/build-modern-app-fargate-lambda-dynamodb-python/
They have clearly explained how to host your static content and structure your web app.
The pros of using AWS S3 are that it's really cheap, easy to use and configure.
Cons are ,IF you are just hosting static content, you will be charged for it.Why not use Github pages? It's entirely free!
You could use Azure Blob storage. You may store any file format and it can be secured with a security token for restricted access. It scales without limit and is considered a best practice for large volume web traffic. Hope it helps.

Google drive, onedrive or box which is the fastest API method for displaying complete folder contents? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
We are working on a web application for photo selections/proofing. To manage the photo albums, we want to use a file sharing service like dropbox, google drive, onedrive etc.
One of our use cases includes displaying albums with large quantity of photos inside our web application. We are currently using dropbox to fetch complete folders (albums) but since the dropbox api doesn't offer batch requests, it takes A LOT of time to generate individual share links and display inside our application (in terms of hours)
I am personally checking other APIs too but will really appreciate little guidance from people having experience with other APIs like google drive, onedrive, box.com etc
What will be the best method/api to achieve the use case efficiently?
Like I personally think if we have a batch operations available, we would be able to fetch an album of 3000 photos (120 kb avg size) in less than 5 minutes on a normal internet connection.
All services you mention (dropbox, onedrive, google drive) offer a thumbnail service. My advice is to use that functionality first.
So (supported by all services):
request meta data about all files in folder (one call), including thumbnail URL and id. Normally this request is paged. For 3000 images you need only three requests (if page-size is 1000, the maximum for Google Drive API)
display thumbnails (using the cached URL)
retrieve actual image if user selects thumbnail based on the cached id. Which is one call
We integrated with all three services (and s3) and in my experience, the performance is more than enough for this kind of scenario.

Fastest Image delivery from local server or CDN, or Cloud? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 5 years ago.
Improve this question
My situation is as follows. I've a reasonably fast website that hosts around 200,000 images. I'm as of now using these images without any problem (reasonably fast image loading) and displaying it on my website. But now, I realise that I have an option to download all these 200,000 onto my local server using a small python script. I could also upload these 200,000 images onto a cloud, CDN.
I've seen famous websites like google request their data from a separate domain and most probably a separate server.
So my question is this. Which is the best way to store a large number of image files for fastest delivery on my webpage. Is it on a local server, a external server or a strategically placed server like what CDNs do? Because, I'm under the impression right now that data is transfer ed within the server fastest and hence it would be best to have it on my local server.
The term fastest depends on so many factors like
Region of server located
Bandwidth of server and user
Server RAM Size & Hard Disk read/write speed
When having same features comparing to cloud,cdn,local
I choose cloud because reliability of cloud is better than local

When not to use AJAX client-side routing? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
Using client-side routing (with Angular's $routeProvider for example), it is possible to load a whole web app at once and not interact with the server anymore.
However this might imply a long load time when visitors first open the web app assuming it has a lot of views.
What are the best practices in terms of client-side routing vs. initial load time?
Well the default behaviour of angular is to have the whole app front loaded. But it depends what your app does and how big it is. If it's a small app you could do that. If your app is huge (unlikely given all the app will do is just show some static data) then it's not really a good idea to load everything up front. For a smaller app it would be OK, especially if you minify everything. But for larger apps, what if you have 10MB of scripts and resources? You're putting a lot of strain on your server and eating your customers bandwidth. Fr large apps you could dynamically load scripts as routes change, we do something similar to this in a pretty huge angular app.
The best practice would be to only get the files that are required to generate the content you want to show to the user on that specific route, which goes against what you want to do. Regarding "not interact with the server anymore", well if your app relies on a server to get some data or do some authentication, you can't really stop interacting with the server.

May I use CDN for whole website (PHP, Apache, MySQL) or just for images and CSS, JS files? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
May I use CDN for whole website (PHP, Apache, MySQL) or just for images and CSS, JS files?
What's the best choice > cloud-hosting or dedicated-hosting? Does CDN has that support?
Witch hosting you suggest me the best - the fastest, stablest 100% uptime, CDN, not expensive at all?
CDN hosting is purely for static content only - it is never advised to host a dynamic application on CDN.
CDN is a content delivery network - your hosting company has edge servers on various locations across the globe. Job of these edge servers is to cache your content and deliver to your clients. If edge server doesn't have cached your content, they pull these content from the source server and deliver to your visitor. If they have cached copy, they deliver that immediately. This cache is usually refreshed every 12 hours - it varies host by host.
Since edge servers deliver cached copy, it is never advised to host dynamic websites on CDN Hosting.
Question:
What's the best choice? cloud-hosting or dedicated-hosting? Does CDN
has that support?
Answer:
Cloud hosting is superior by infrastructure. It has redundant array of disk drives and processors. You will enjoy almost 100% uptime on Cloud hosting.
Question:
Witch hosting you suggest me the best - the fastest, stablest 100%
uptime, CDN, not expensive at all?
Answer: From my professional experience, CDN hosting is the fastest, Cloud hosting is stable and 100% uptime and VPS Hosting is not expensive. If you want to make a choice of of these three, Cloud hosting is stable and cost-effective.
From the way the question was phrased, I think managed hosting would be most appropriate for your application.
It is fairly unlikely that you will run into any performance issues that are not self-inflicted (say, by writing suboptimal database queries, performing database processing in the frontend etc) unless you have a significant advertising budget and a mass market application, in which case you should also have a mid-sized IT department that can roll a custom solution.
Weighing cost and reliability against each other can be left to the accountants, for the most part.

Resources