Forums / General Questions / AWS EC2 instances and S3 buckets for product images.

AWS EC2 instances and S3 buckets for product images.

Started by chibipaw on 14 Jul 2015, 8:21 PM · Views: 605

Results 1 to 4 of 4
14 Jul 2015, 8:21 PM
#1
chibipaw avatar

chibipaw

Zen Follower

Join Date:
Jul 2011
Posts:
169
Plugin Contributions:
0

AWS EC2 instances and S3 buckets for product images.

Hi, I've searched around for forums, doesn't look this is a question anyone really had answered or had successfully implemented yet.

My shopping cart is hosted using a number of EC2 load balanced instances, all drawing from a single RDS. Scaling up when demands are high is a breeze. However, I would like to be able to host the product images in a centralized location like an S3 bucket, so all of the servers can read the images from a single source. Im aware that there is already a module for download products using S3, but thats not what Im looking to do. As I have no downloadable products, as I am only physical products that requires product images. And updating each machine to have it's own local repository of product images is horribly inefficient.

I'm currently toying around using a FUSE based S3fs to mount the buckets. But is there a better, and more graceful way of doing this ? Or is S3FS my best bet?

15 Jul 2015, 11:39 AM
#2
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: AWS EC2 instances and S3 buckets for product images.

I'm not sure I completely understand the question, and I'm not sure this will work with the current Zencart version, but:

https://www.zen-cart.com/downloads.php?do=file&id=1077

15 Jul 2015, 11:44 AM
#3
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: AWS EC2 instances and S3 buckets for product images.

I was thinking that it might be as simple as changing the DIR_WS_IMAGES in your configure.php files to reference your S3 bucket as a full path.

Could be wrong, probably am...

stevesh, thought is to have a single source that is not on the current storage location of the ZC files to access a common location for all images. Very much along the lines of the suggested code. The only other thing I see though is handling the access rights that seem might be necessary in order to save the new images from within the admin panel versus simply ftping them to the destination. Meaning maintenance may be either be a little more difficult or such access commands may need to be incorporated into the storage of the images wherever they are being processed to store.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

15 Jul 2015, 11:54 AM
#4
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: AWS EC2 instances and S3 buckets for product images.

Ran out of time, but:

EDIT: After looking at what stevesh posted, which is provides a similar result, difference(s) being that the plugin instruction allows for images to exist at a remote site as well as on the local machine whereas the method I suggested would force all images to be on the remote machine. Regardless the domain name would need to be included.

If implementing the suggested plugin would recommend that the constant entered should simply be '//' not 'http://' to ensure that images are presented in the format for the applicable page.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...