Grails cloud rental guidelines

I am looking for cloud hosting for the Grails application. I used to try several applications, including CloudFoundry, JElastic, AppFog, but I could never successfully deploy the application. The application should:

  • MySQL database
  • File system access for storing files and index images of searchable plugins uploaded by users

I will only use this site to ensure quality, so performance is not my concern. Obviously, I would like it to be as easy as possible to deploy the application, and I would like to pay as little as possible for hosting.

I have already tried using the CloudFoundry Grails plugin to deploy to CloudFoundry, but without any success.

+7
source share
2 answers

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.

+1
source

I know this is not an ideal solution, but you can use gridfs mongodb to store your files, not the file system. Cloudfoundry supports mongodb, as I'm sure you know.

This will not help with your searchable plugin index.

0
source

All Articles