Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Firebase and s3 to store images

Is it possible to use firebase and s3 together. I need to store images and firebase can get pricy. Could I use s3 to store to store the images and save the url (from s3) to firebase as a string. And then call the url as needed from firebase?

Also could be the cost associated with this, I know that I would be paying for storage. But are there any cost when an image is loaded from a url (data transfer)?

Thanks

like image 296
Isaac Avatar asked Sep 16 '15 01:09

Isaac


2 Answers

You can certainly store images in s3 and store the s3 link in firebase. To make your life easy, save them as publicly accessible links so that your site doesn't need to be authenticated to access them. I've stored an image here if you'd like to embedding a public s3 link into your site. Here is some information on setting up a public bucket. Here is some information on making objects public.

There is a small cost to requests to s3, see the pricing overview here.

like image 119
Benjamin Cohen Avatar answered Sep 29 '22 15:09

Benjamin Cohen


It is possible. Basically you should use CloudFront to deliver images to clients, because it caches S3 access and save money. So a network request should be like this:

User -> CloudFront -> S3

You can make objects on S3 public, but disabling public access to any objects on S3 is the best practice. Only allow access from CloudFront using S3 origin access identity.

like image 29
Kazuya Gosho Avatar answered Sep 29 '22 15:09

Kazuya Gosho