Google Cloud Storage to serve website images - image

We will launching a Google Campaign for our Website and expecting high number of users visiting our website.
Hence, I did some pre-calculations and figured out that serving images from Cloud servers would be best approach, which are currently being served from dedicated server.
I haven't got any clue on how Google Cloud Storage works or any other service. So can someone please guide me to relevant steps that I should be taking for hosting all our images to Google Cloud Storage and how can I serve them from Europe, and mapping of subdomain.
Currently I am following this Guide
Edit:
Before going for Cloud I compared the purpose of CDN vs Cloud and this what I figured out.
CDN: Used for serving contents from multiple regions: Speed is the purpose
Cloud: Used for serving contents for high bandwidth usage: High Availability is the purpose
And my Main purpose is High Availability, I hope I have gained correct information from dear friend Google.

Are you looking for this: https://developers.google.com/storage/docs/bucketnaming
You need verifying your domain name so it can use a CNAME in Google Cloud Storage
https://groups.google.com/forum/#!topic/gs-discussion/V-nLULNRQLI
After second thought, are you sure you need Google Cloud Storage?
It sounds like you just need a CDN or Amazon S3 stuff.
If memory serves, you need to do the following to use Google Cloud Storage with a custom domain:
verify your own domain names, such as example.com
upload images to Google Cloud Storage, you can use tools such as gsutil etc
serve these images with your own subdomain names such as images.example.com etc

You can serve images from google cloud storage. The nice benefit is: Google will do the serving for you and when you use the images api to create serving_url's you can crop and size the images while serving.
Look at this gist for details.
If you like to use you own domain as part of the image url, you cannot use https!

Serving Static Files
Applications often need to serve static files such as JavaScript, images, and CSS in addition to handling dynamic requests. Apps in the flexible environment can serve static files from a Google Cloud option like Cloud Storage.
https://cloud.google.com/appengine/docs/flexible/nodejs/serving-static-files

Related

Where Media files (images, etc) Should Be Stored For A Websites?

hopefull someone can shed some light on this topic and here are some of my questions:
How do big ecommerce websites manage their images for their websites?
Is there any Best Practices should be consider when deciding where to keep websites images?
I have heard to keep the images in multiple folder structure on the same server where the website is hosted so websites can render them easily and fast since they are all on same server - Is this the idea solution?
How do professionals or big ecommerce handle images storage and maintain website images reliability and stability?
Is Azure or AWS etc best place to store images for websites rendering?
Thanks in advance!
Keeping the files in the same server comes with more risk, if your server crashes or region goes down your application stopped as well as your files not gonna render if you are using those files separately for different applications like mobile applications.
In this case, users will also face a high loading time for those media files if the users are not in the same zone as your application hosted.
The best practice to store the image/media files on some cloud storage like S3 or Azure Blob then connect it with some CDN like CloudFront or Azure CDN.
Now you can serve your media files via CDN which will act as a global caching system for your media files.

What is a recommended platform that can act as a scalable image hosting for static websites?

I've come across this issue where I don't know of any reliable places where I could upload all these images for my personal GitHub page.
I don't want to upload them directly to the GitHub repo and take up storage space.
AWS and Google Cloud seem too expensive for this small website.
Has anyone had any experience using Google Photos, Dropbox or Imgur for hosting images that get referenced on their websites?
Did that scale well?
Are there any other solutions out there I'm unaware of?
Questions asking to find an off-site resource are off-topic to Stack Overflow, but I'll throw a couple ideas out there:
I'd start by just doing a Google search for "static file hosting" for a ton of results. Any of the options you mentioned will probably work, but it might be easier if you use something specifically designed to host files that are used by a website. Put another way, you could also upload all of your images to Facebook and use the URLs of the images on your site. But that's not really what it's designed for.
You could use Amazon S3, which you can use to host static files. See also:
Hosting a Static Website on Amazon S3
How Do I Configure an S3 Bucket for Static Website Hosting?
Moving a Static Site to S3 Before My Girlfriend Got Out of the Shower
Similarly, you could use Google Cloud Storage. See also:
Hosting a static website with Cloud Storage
Hosting a Static Website
Static Website Examples, Troubleshooting and Tips
I found all of the above using pretty basic Google searches, so that's where you should start. The only way to really answer this question is for you to try out a bunch of different things and see which one you like best.

Add files from Google Cloud Storage to Drive

I'm developing a backend service in NodeJS. It processes images from Google Cloud Storage by requesting a temporary link and sending this link to a third party analysis service. I'd also want the images to be added to a shared Google Drive folder. Is there any possible way to do this easily (e.g. by using the Drive API and posting the link to the file, instead of downloading the file and subsequently uploading it). In other words: does the Drive API accept links to files, instead of uploading them? Or is there any other clever way of sharing Google Cloud to Drive easily (as it's both Google services).
Thanks
The best way to do this right now would be to use a Google Colab notebook:
Create a Google Colab notebook and connect to your GCP bucket and mount Google Drive to it:
# authenticate
from google.colab import auth
auth.authenticate_user()
# set your gcp project
!gcloud config set project my-project
# mount your drive
from google.colab import drive
drive.mount('/content/drive')
Run a gsutil command to copy your GCP storage data to the mounted drive
!gsutil -q -m cp -r gs://my-bucket-name /content/drive/My\ Drive/
I have done some searching but, I don't see a way to add files from Google Cloud Storage to Google Drive other than doing downloading and uploading them. Also AFAIK, gsutil, which Google Cloud Storage APIs can interact with, also supports downloading and uploading of files when sharing to other storage.
And, as answered in Cloud Storage - Frequently Asked Questions, Google Drive and Google Cloud Storage are two different storage services wherein both allow programmatic access to their functionality, but the goals of the APIs are quite different.
However, you may want to try using Request Endpoints wherein you can access Google Cloud Storage through three request endpoints (URIs). Which one you use depends on the operation you are performing.
IMPORTANT NOTE: The Google Cloud Storage URIs described on this page are subject to change.
You can use the following URLs to access an object:
XML API
storage.googleapis.com/<bucket>/<object>
<bucket>.storage.googleapis.com/<object>
JSON API
www.googleapis.com/download/storage/v1/b/<bucket>/o/<object-encoded-as-URL-path-segment>?alt=media
These URLs support secure sockets layer (SSL) encryption, which means you can use either HTTP or HTTPS. If you authenticate to the Google Cloud Storage API using OAuth 2.0, you should use HTTPS.
You may want to also check Sharing and Collaboration for more information.

Photo and Video hosting on a shared server?

I need to have several videos and photos on my website.
Primarily videos will range to more than a 100, and photos might be more than 10000.
Since i am using a shared server hosting, i cant have enough space to upload them on my server nor will the performance graph be any good.
Hence i decided, i can upload the videos on YouTube and embed them in my web site.
However the problem is with the photographs. Which would be the best photostorage web service which can
A) Have a Web API
B) Would have no need to create a badge or in any way not make it obvious that the photo is from some other source.
C) Unlimited Storage
D) High performance retrieval.
picasa fit all your requirements except unlimited storage. but you have a lot of space and can buy extra storage for little money
I don't know if you want a cloud based service or a self-hosted service?
If you want to self hosted an image hosting service, then you can check this project, ImageS3, web admin console, REST api, and of course, no usage limitation on APIs.
If you wish to use the cloud based image hosting service, then you can use imgur.com, imageshack.com or www.imgix.com.

Hosting web site images: Flickr PRO, Amazon S3 or...?

I'd like to save some of my site monthly bandwidth allocation and I'm wondering if I can use Flickr PRO or I should rely on Amazon S3 as an hosting service for my web site images. (My Web Application allows users to upload their own pictures and at the moment it's managing around 40GB of data)
I've never used Amazon's services and I like the idea of using Flickr REST Api do dynamically upload images from my webApp.
I like also the idea of having virtually unlimited space to store images on Flickr for only 25$/year but I'm not sure if I can use their service on my web site.
I think that my account can be banned if I use Flickr services to store images (uploaded by users of my website) that are not only for 'personal use'.
What's your experience and would you suggest other services rather than Amazon's S3 or is this the only available option at the moment?
Thanks
edit: Flickr explicitly says 'Don’t use Flickr for commercial purpose', you could always contact them to ask to evaluate your request but it sounds to me like I can't use their services to achieve what I want. S3 looks like the way to go then...
Even though a rough estimate of what I'm going to spend every month is still scaring
5000 visit/day
* 400 img/user (avg 50kB/image)
* 30 days
= ~3TB of traffic
* 0.15$/GB (Amazon S3)
= 429$/month
is there any cheaper place to host my images?
400 images per user seems high? Is that figure from actual stats?
Amazon S3 is great and it just works!
A possible cheaper option is Google. Google docs now supports all file types, so you can load the images up to a Google docs folder, and share the folder for public access. The URL's are kind of long e.g.
http://lh6.ggpht.com/VMLEHAa3kSHEoRr7AchhQ6HEzHVTn1b7Mf-whpxmPlpdrRfPW216UhYdQy3pzIe4f8Q7PKXN79AD4eRqu1obC7I
Add the =s paramter to scale the image, cool! e.g. for 200 pixels wide
http://lh6.ggpht.com/VMLEHAa3kSHEoRr7AchhQ6HEzHVTn1b7Mf-whpxmPlpdrRfPW216UhYdQy3pzIe4f8Q7PKXN79AD4eRqu1obC7I=s200
Google only charge USD5/year for 20GB. There is a full API for uploading docs etc
I love amazon S3. There are so many great code libraries (LitS3) and browser plugins (S3Fox) and upload widgets (Flajaxian) that make it really easy to use.
And you only pay for what you use. I use it a lot and have only ever experienced down time on one occasion.
Nivanix is an s3 competitor. I haven't used them, but they have a bit more functionality (image resizing) etc.
Edit:The link about Nivanix is dead now(2015/07/21), because Nivanix was dead.

Resources