This talk will provide an overview of the PaaS (Platform as a Service) landscape, and will describe the Cloud Foundry open source PaaS, with its multi-framework, multi-service, multi-cloud model. Cloud Foundry allows developers to provision apps in Java/Spring, Ruby/Rails, Ruby/Sinatra, Javascript/Node, and leverage services like MySQL, MongoDB, Reddis, Postgres and RabbitMQ. It can be used as a public PaaS on CloudFoundry.com and other service providers (ActiveState, AppFog), to create your own private cloud, or on your laptop using the Micro Cloud Foundry VM. Micro Cloud Foundry is a very easy way for developers to start working on their application using their framework of choice and MongoDB, without the need to setup a development environment, and your app is one command line away (vmc push) from deployment to cloudfoundry.com.
2. P@ in a nutshell
• French, based in San Francisco
• Senior Director, Developer Relations,VMware
• Software Plumber, API guy, mix of Enterprise and
Consumer
• 18 years writing software, backend guy with a
taste for javascript
• 2 y Accenture (Notes guru), 3 y Netscape/AOL
(Servers, Portals), 5 y Sun (ecommerce, blogs,
Portals, feeds, open source)
• 6 years at Google, API guy (first hired, helped start the
team)
• Adwords, Checkout, Social, HTML5, Cloud
Friday, December 9, 11
4. Spring’s aim:
bring simplicity to java development
data
web tier integration
batch access
& service tier & mobile
processing / NoSQL /
RIA messaging
Big Data
The Spring framework
the cloud: lightweight traditional
CloudFoundry WebSphere
tc Server
VMForce JBoss AS
Tomcat
Google App Engine WebLogic
Jetty
Amazon Web Services (on legacy versions, too!)
4
Friday, December 9, 11
8. New demands on data
access
•... until we needed
inexpensive horizontal
scaling for some large web
based applications ...
• ... and we needed to
deploy our apps in the
cloud ...
* image courtesy of Bitcurrent 8
Friday, December 9, 11
9. NoSQL offers several data store categories
Key-Value Column Document Graph
Redis, Cassandra, MongoDB Neo4J
Riak HBase
9
Friday, December 9, 11
10. NoSQL offers several data store categories
Key-Value Column Document Graph
MongoDB
(who cares about the rest?)
10
Friday, December 9, 11
11. Spring Framework
built-in data access support
•Transaction abstractions
•Common data access exception hierarchy
•JDBC - JdbcTemplate
•ORM - Hibernate, JPA support
•OXM - Object to XML mapping
•Serializer/Deserializer strategies (Spring 3.0)
•Cache support (Spring 3.1)
11
Friday, December 9, 11
12. http://www.springsource.org/spring-data
•Spring Data Key-value
•Spring Data Document
•Spring Data Graph
•Spring Data Column
•Spring Data Blob
•Spring Data JPA Repository / JDBC Extensions
•Spring Gemfire / Spring Hadoop ...
•Grails iNcOnSeQuentiaL
12
Friday, December 9, 11
13. Spring Data Building Blocks
•Low level data access APIs
✓MongoTemplate, RedisTemplate ...
•Object Mapping (Java and GORM)
•Cross Store Persistence Programming model
•Generic Repository support
•Productivity support in Roo and Grails
13
Friday, December 9, 11
15. Spring Data Document
Mongo
•MongoTemplate interface for mapping Mongo documents
•MongoConverter
•SimpleMongoConverter for basic POJO mapping support
•Leverage Spring 3.0 TypeConverters and SpEL
•Exception translation
•Advanced Mapping(@Document, @Id, @DbRef)
•Annotation based
•MongoRepository
•Built on Hades support for JPA Repositories
15
Friday, December 9, 11
17. Mongo Template
Direct Usage of the Mongo Template:
17
Friday, December 9, 11
18. Mongo Template
Direct Usage of the Mongo Template:
Insert into “Person”
Collection
17
Friday, December 9, 11
19. Mongo Template
Direct Usage of the Mongo Template:
findOne using query: { "name" : "Joe"}
in db.collection: database.Person
17
Friday, December 9, 11
20. Mongo Template
Direct Usage of the Mongo Template:
Dropped collection [database.person]
17
Friday, December 9, 11
21. Generic Repository
Interface for generic CRUD operations on a repository for a specific type
18
Friday, December 9, 11
22. Paging and Sorting Repository
Paging and Sorting Repository: Extends “CrudRepository”
19
Friday, December 9, 11
23. Paging and Sorting Repository
Paging and Sorting Repository: Extends “CrudRepository”
Usage:
19
Friday, December 9, 11
35. Cloud Foundry: The Open PaaS
• Open Source: Apache 2 Licensed
• multi language/frameworks
• multi services
• multi cloud
Ap
ce
pli
vFabric
rfa
Postgres Private
ca
nte
Data
Services tio Clouds
rI
n
e
Se
Public
vid
vFabric
RabbitMQTM rvi
Cloud
ro
Msg Services
ce
dP
Micro
ou
Other
Cloud
Cl
Services
25
Friday, December 9, 11
42. What is a Micro Cloud?
Or
Entire Cloud Running inside of a single VM
32
Friday, December 9, 11
43. Micro Cloud Foundry… (BETA)
A pre-built Micro (Single VM) version of Cloud Foundry…
You need a Cloud Foundry.com Account to use Micro Cloud Foundry
Signup @ http://cloudfoundry.com/micro
33
Friday, December 9, 11
44. Micro Cloud Foundry… (BETA)
A pre-built Micro (Single VM) version of Cloud Foundry…
Micro
You need a Cloud Foundry.com Account to use Micro Cloud Foundry
Signup @ http://cloudfoundry.com/micro
33
Friday, December 9, 11
45. Pre-requisites
Resources
Minimum 1 GB Minimum 8 GB Internet Connectivity
RAM Disk (w/DHCP is ideal)
Virtualization
Clients
VMC STS
Command line GUI
34
Friday, December 9, 11
46. What is in Micro Cloud Foundry?
.COM
Dynamic Updating DNS
App Instances Services
Open source Platform as a Service project
10.04
35
Friday, December 9, 11
47. Other Cloud Foundry powered PaaS
Private PaaS
Added Python and Perl
Public PaaS
Added PHP
36
Friday, December 9, 11
51. Service Creation and Binding
App Instance Redis Service
39
Friday, December 9, 11
52. Service Creation and Binding
App Instance Redis Service
39
Friday, December 9, 11
53. Service Creation and Binding
App Instance Redis Service
MongoDB
Service
39
Friday, December 9, 11
54. Development
LifeCycle
40
Friday, December 9, 11
55. Traditional App Deploy and Request/Response
Web
Request/Allocate
Web Build/Setup
Install/Configure
App
Deploy/Test
App
Scale?
Upgrade?
DB
DB
Update?
Friday, December 9, 11
56. How Apps are Deployed on Cloud Foundry
Web
Web
App
“vmc push MyApp” DB
App
Web
Scale? “vmc instances MyApp 5”
DB Upgrade? “vmc map MyApp MyApp2”
Update? “vmc update MyApp”
Friday, December 9, 11
57. How Apps are Deployed on Cloud Foundry
Web
Web
App
“vmc push MyApp” DB
App
Web
Scale? “vmc instances MyApp 5”
DB Upgrade? “vmc map MyApp MyApp2”
Update? “vmc update MyApp”
Friday, December 9, 11
58. How Apps are Accessed on Cloud Foundry
Request Web Interface
Load
Balancing
Response
and
Routing
Web
App
App Instance
DB
“vmc push MyApp”
Service
Friday, December 9, 11
59. How Apps are Scaled on Cloud Foundry
Request
Load
Load
Load
Balancer(s)
Balancing Response
Balancer(s)
and
Routing
App Instances
Web Web Web
App App App
DB
“vmc instances MyApp 3”
Service
Friday, December 9, 11
60. How Apps are Updated on Cloud Foundry
Previous Instance Updated New
Version Stopped Code Version
Web Web Web Web
App App App App
DB DB
Service Service
“vmc update MyApp”
Friday, December 9, 11
61. At Scale – Multi-Node Distributed App
system load balancer
elastic pool
redis mysql
front_end front_end
rabbitMQ
elastic pool
mongodb
back_end
46 10
Friday, December 9, 11
67. Where to Find More
§ Spring Data Project:
http://bit.ly/spring-data
§ CloudFoundry Samples:
http://bit.ly/cloudfoundry-samples
§ MicroCloud Foundry for Spring Developers
http://bit.ly/mcf4spring
§ Spring Data Mongo on Cloud Foundry (webinar, 12/01/2011)
§ http://bit.ly/spring-mongo-cloudfoundry
52
Friday, December 9, 11