views:

114

answers:

1

I am at the point with my Grails app that I want to deploy it up onto Amazon EC2 so I can start showing it to people. I have a little experience using EC2 "manually" to put other projects onto the web, but I was hoping to find something which made the deployment cycle a little more manageable. In steps CloudFoundry.

I have read through the web site and watched the tutorials, and on the face of it I like what I see. However, before I commit to it I wondered whether any of you have experiences to share from the coal face.

Specifically I am going to be deploying a MySQL database along with the app and it's not clear what exactly you need to supply (SQL scripts?) and how to best configure my project to deploy through CloudFoundry so that the host name is configured correctly. I also have a small amount of standard rows which I insert in my BootStrap.groovy and I wonder whether that stuff makes it through deployment.

Lastly, it is free at the moment, but they are sayin they will introduce charging later. Are there any open source alternatives that it may be better to investigate in case CloudFoundry ends up being expensive?

Thanks

+2  A: 

Hi. I have a little experience with CloudFoundry. They have been so kind to sponsor the GR8Conf website, deployed through their service. For configuring the SQL, it appears to me, that the simple solution is to use the CloudFoundry plugin, and enter

    cloudFoundry.db.schemaName="myName"

in the config/CloudFoundry.groovy file.

In your config/DataSource.groovy you should have:

    production {
        dataSource {
            driverClassName = 'com.mysql.jdbc.Driver'
            dbCreate = "update"
            url = "jdbc:mysql://localhost/myName" // or url = "jdbc:mysql://${System.getProperty("dbHostName", "localhost")}/myName"
            dialect = 'org.hibernate.dialect.MySQLDialect'
            username = "myName_user"
            password = "myName_password"
        }
    }

(I got some of this info from: http://www.cloudfoundry.com/getting_started.html)

I do not think that you have to supply additional SQL scripts. What you define in your BootStrap will make through deployment.

On pricing, I have no ideas. I'd suggest you write to their support to ask.

On a side notice: The www.gr8conf.org website is not running on EC2 yet, but that is beacuse I have not yet figured out, how to back up my database from EC2 to S3, and that's rather important, because when an EC2 instance ends, everything in it is lost, if not backed up. /Søren

sbglasius
+1 Thanks. I feel like we are blazing a trail somewhat. The practical reality of deployment through CloudFoundry will be that you want a distributed topology and of course S3 for the data. You will also probably always want to be able to send email from your app and have a payment gateway involved somewhere - after all these are commercial app, not static web pages that we're building. There is clearly a gap in wrapping up the whole deployment into something easily consumable by engineers and CloudFoundry feels like a good start, but they are still a way off being a complete offering IMO.
Simon