23. vmc tunnel (caldecott)
$ vmc tunnel
1: foobar-mq
2: foobar-pg
3: postgresql-handson-cf
Which service instance?> 3
1: none
2: psql
Which client would you like to start?> 2
Opening tunnel on port 10000...
29. Main Risk: Lock In
Welcome to the hotel california
Such a lovely place
Such a lovely face
Plenty of room at the hotel california
Any time of year, you can find it here
Last thing I remember, I was
Running for the door
I had to find the passage back
To the place I was before
’relax,’ said the night man,
We are programmed to receive.
You can checkout any time you like,
But you can never leave!
-the Eagles
30. Don’t Code to (any) Cloud!
§ Auto-Reconfiguration
§ For the Last 5%
• Insulate your Code
• Leverage Frameworks, e.g. Spring Profiles
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"...>
<bean id="mongoTemplate"
class="org.springframework.data.mongodb.core.MongoTemplate">
<constructor-arg ref="mongoDbFactory" />
</bean>
<beans profile="default">
<mongo:db-factory id="mongoDbFactory"
dbname="test"
host="127.0.0.1"
port="27017"
username="foo"
password="bar" />
</beans>
<beans profile="cloud">
<cloud:mongo-db-factory id="mongoDbFactory"
service-name="myBoundServiceName" />
</beans>
</beans>
34. Traditional Cloud
Dev ≠ Staging
Machines Identical
≠ Prod
Manual,
Process Automated
inconsistent
People Dev ≠ Ops Devops
35. One app, Many deploys
of
ONE set
les
deliverab
Code Build
Deployment
Config
ploys
MANY de
36. “ Environment Variables [...] unlike custom config
files, or other config mechanisms such as Java
System Properties, are a language- and OS-
agnostic standard
The Twelve Factor App, http://www.12factor.net
38. Do your current apps look like this?
Tomcat
.war
Browser Apache MySQL
39.
40. “ SOA is like Adam Sandler’s career:
Do one thing, and do it well.
Rob Spectre, Developer Evangelism,
Twilio
41. Another way to look at it
cut -d" " -f1 < access.log | sort | uniq -c | sort -rn | less
42. Chances are they will soon look like this..
Tomcat
search.
war
Desktop
Browser
Tomcat
Native users.
Node.js Message Bus war Mongo
Mobile
Front End e.g. RabbitMQ
App
HTML5
Mobile
App
Tomcat
orders.
war MySQL
60. Write your own logic
Use system-level metrics
$vmc stats myapp
instance #0
cpu 0.0% of 2 cores
memory 191.6M of 512M
disk 15.0M of 2G
as well as
business-related
info
http://www.sxc.hu/photo/1128191
61. Write your own logic
Use Inter-process scaling
$vmc scale myapp
--instances 3
--memory 1G
as well as
intra-process
(thread pools)
63. Blue/Green Deployment
$vmc app awesome
awesome: running
platform: spring on java
usage: 512M × 1 instance
urls: awesome.cloudfoundry.com
services: postgresql-db
Version N Version N
Users LB / Proxy
64. Blue/Green Deployment
$vmc push --name awesome_v2
--url awesome_secret.cloudfoundry.com
Version N Version N
Users LB / Proxy
Version N+1 Version N+1
65. Blue/Green Deployment
$vmc unmpap awesome awesome.cloudfoundry.com
$vmc map awesome_v2 awesome.cloudfoundry.com
Version N Version N
Users LB / Proxy
Version N+1 Version N+1
73. Limit your Http Traffic
There is no File System
Strive for Statelessness
Automate your DB Migrations
Avoid Vendor Lock-in
Treat all envs as Identical
It’s all about Loose Coupling
Use Frequent Deployments
Targeted and Custom Scaling
Upgrade with Zero Downtime
74. Thank You
Eric Bottard
Developer Advocate • VMware
t@ebottard
Äericbottard
ebottard@vmware.com