Thanks Cloud Foundry for turning every programmer into a Hero !

‘Spring Data promotes the classic Spring values, enhancing developer productivity by removing the API noise, boiler-plate code and resource management and offering a consistent programming model.’

Spring Roo revolutionized the concept of ‘Rapid Application Development’ by on-demand resource allocation and service provisioning through load-time-weaving of aspects !

Couple of lines of commands and the complete gwt-spring-mvc application launched into Google App Engine !

At the same time MongoDB came up with a ‘ridiculously simple’ json-based api to provide super-fast asynchronous highly-scalable, available, partitioned data-storage with simple ways to crud, map-reduce, search, index ! Redis garnered much excitement by providing a brilliant ‘data-structure key-value storage’ !

Its no wonder that Spring quickly provided a wrapper to access MongoDB, Redis, Riak, Node.js.

VMWare blended the virtualization platform with SpringSource and Ubuntu and formed the magical CloudFoundry (IaaS + PaaS) !

Now any programmers can really taste the flavor of Cloud Computing (which was so far affordable only by large enterprises ).

The Coder just need to simply specify/change/manage what sorts of service it requires (mongodb, redis, grails, node.js etc..) and specify the target (amazon cloud, vmware, cloud foundry , azure, etc..) !
Enough theory ! Its time to get our hands dirty !Build Cloud-ready App using Ruby :
The CLI Tool – VMC (vmware cloud-controller) can be installed by ruby gem.
VMC simply make various rest requests (push / update / target / start / stop ..). Accordingly cloud-controller delegates the requests to droplet execution engine which routes the requests to service providers (allocated by cloud-controllers).Here goes the simple steps to push a ruby ‘Say hello’ app to Cloud !
http://seroter.wordpress.com/2011/05/11/6-quick-steps-for-windows-net-folks-to-try-out-cloud-foundry/

require ‘sinatra’
get ‘/’ do
“Welcome ! You are now in Cloud Foundry! “
end

Launch a Spring-MySql App into Cloud :

Nothing gets more exciting to be able to deploy our very own sample app on cloud !
1. This sample code ‘To-Do List Manager’ just works and need no tweaking !
https://github.com/daveys/spring-todo
** Login Credentials specified in security-context.xml
2. Just need to remember that we should create a ‘tododb’ service and link it to the application !
Upon starting the app if it does not work on first chance, we just need to restart it once or twice !
3. Inspect logs
# look at the main logs that contain crash information
vmc crashlogs my-app
# to inspect other logs (migration.log, staging.log, etc.)
vmc files my-app logs/migration.log
4.Check-out http://blog.springsource.com/2011/04/12/cloud-foundry-for-spring-developers/
Launch a Spring-MongoDB App on the Cloud :
1. Download hello-spring-mongodb from cloudfoundry samples.
2. Import the project in STS.
3. Rename the application to some unique name like –mongoapp
4. Remember to add the mongodb namespace – in root-context.xml
xmlns:mongo=”http://www.springframework.org/schema/data/mongo” and specify the schema location
http://www.springframework.org/schema/data/mongo http://www.springframework.org/schema/data/mongo/spring-mongo-1.0.xsd5. Now few Command Line tasks..
6. Package the app : mvn package
7. Test that vmc target is api.cloudfoundry.com
8. Next attach a mongoDB service and start the service as shown below…
9. The service name should match with the one specified in ‘mongoTemplate‘ e.g. ‘mongodb-hello-mongo’10. Finally we should expect the output as specified in – https://github.com/SpringSource/cloudfoundry-samples/wiki/Spring-Hello-MongoDB-Sample-Application
—————————————————————————-
A ready-to-go powerful web-flow sample :
See Live : http://travel.cloudfoundry.com
—————————————————————————-
For more complicated examples involving Social Search, Events and Caching – we can consult the following articles : this is a SUPER SHOT … http://blog.springsource.com/2011/05/03/using-mongodb-redis-node-js-and-spring-mvc-in-a-single-cloud-foundry-application/ …..
and another ACTION-PACKED sample … http://blog.springsource.com/2011/04/27/getting-started-redis-spring-cloud-foundry/A very complex streaming-events sample where external source sends events to redis store. Events are sent to browser using ajax-long-polling (instant update) and also pushed into Mongo for future lookup and analysis (BI) . Cloudfoundry makes it look so simple and easy to learn the concepts !Here I show the steps … (assumption : ticker-analysis mongo service and ticker-stream redis service are already created) :
See it live : http://streaming-events.cloudfoundry.com
More food for thoughts : http://blog.mongodb.org/post/6587009156/cloudfoundry-mongodb-and-nodejsReferences :
Comprehensive List : http://devstonez.wordpress.com/2011/04/13/all-you-need-to-know-about-cloud-foundry-blogs-articles-reviews-tutorials-videos/
Command Line Reference : https://github.com/cloudfoundry/vmc/blame/master/README.mdArchitecture :
http://www.slideshare.net/mccrory-me/cloud-foundry-a-developers-perspective http://www.slideshare.net/lethee/cloud-foundry-practiceRuby on CloudFoundry :
http://support.cloudfoundry.com/entries/20019747-ruby-and-cloudfoundry-things-to-know
http://www.slideshare.net/oisin/constructing-web-apis-with-rack-sinatra-and-mongodbhttp://docs.aptana.com/docs/index.php/Plugging_Aptana_into_an_existing_Eclipse_configuration
http://update1.aptana.org/rails/1.2.1.23268/index.html
http://www.ibm.com/developerworks/opensource/library/os-rubyeclipse/

MongoDB on CLoudFoundry :

https://github.com/SpringSource/cloudfoundry-samples/wiki/Spring-MongoDB
http://mongo.cloudfoundry.com/
https://github.com/SpringSource/cloudfoundry-samples/wiki/Spring-Hello-MongoDB-Sample-Application
http://www.slideshare.net/lethee/mongo-db-with-spring-data-document

Redis on CloudFoundry in Ubuntu :
http://blog.aestasit.com/taking-vmware-cloud-foundry-on-a-test-drive/
http://redis.io/topics/twitter-clone
http://static.springsource.org/spring-data/data-keyvalue/examples/retwisj/current/#retwisj:design:persistence

Build CloudFoundry Apps from STS
http://blog.springsource.com/2011/04/12/cloud-foundry-for-spring-developers/
http://blog.springsource.com/2011/04/13/using-cloud-foundry-from-sts/

Watch the Webinar and Download the Slides !
http://www.springsource.com/webinar/getting-started-spring-and-springsource-tool-suite

Grails-Integrationhttp://www.grails.org/STS+Integration

Spring MVC with STShttp://www.giantflyingsaucer.com/blog/?p=2373

http://www.youtube.com/user/SpringSourceDev
http://blog.springsource.com/category/green-beans/
http://blog.springsource.com/category/spring/31/  
Great MVC Resource – http://www1.springsource.com/files/Getting%20Started%20with%20Spring%20and%20STS%203-17-11.pdf

Google App Engine with STS – http://code.google.com/webtoolkit/doc/latest/tutorial/roo-sts.html

Spring Insight for Monitoring : http://blog.espenberntsen.net/tag/spring-insight/

Full Story : http://gigaom.com/cloud/vmware-open-source-cloud/
FAQ : http://support.cloudfoundry.com/forums/373015-knowledge-base
http://www.cloudfoundry.com/
http://www.youtube.com/user/vmwaretv?feature=mhum#p/c/71331D676E1D17CA

Advertisements