I have successfully hosted Grails-based sites on Amazon EC2. To reduce the cost, I used a small reserved instance. I think it is normal to use Amazon EC2 AMI for temporary files such as searchable index files, since you can always reindex if AMI crashes.
To store user images, I used Amazon S3 using the Grails AWS SDK plugin ( http://grails.org/plugin/aws-sdk ). It is very easy to upload files to S3 using the Amazon SDK http://blanq.imtqy.com/grails-aws/1.2.12.1/index.html -
To download a file with public read permissions.
amazonWebService.s3.putObject(new PutObjectRequest('some-grails-bucket', 'somePath/someKey.jpg', new File('/Users/ben/Desktop/photo.jpg')).withCannedAcl( CannedAccessControlList.PublicRead ) )
Download the file.
amazonWebService.s3.getObject(new GetObjectRequest('some-grails-bucket', 'somePath/someKey.jpg'), new File('/Users/ben/Downloads/photo.jpg'))
Delete a file.
amazonWebService.s3.deleteObject('some-grails-bucket', 'somePath/someKey.jpg')
Hope this helps.
Saurabh
source share