Decomposing applications for scalability and deployability - svcc sv_code_camp 2012
Decomposing applications for deployability and scalability (CF India July/August 2012)
-
Upload
chris-richardson -
Category
Technology
-
view
660 -
download
3
description
Transcript of Decomposing applications for deployability and scalability (CF India July/August 2012)
![Page 1: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/1.jpg)
Decomposing applications for deployability and scalability
Chris Richardson
Author of POJOs in ActionFounder of the original CloudFoundry.com
@[email protected]://plainoldobjects.com/
1
![Page 2: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/2.jpg)
Presentation goal
2
How decomposing applications improves
deployability and scalability and
How Cloud Foundry helps
![Page 3: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/3.jpg)
About Chris
3
![Page 4: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/4.jpg)
dsply ‘About Chris’;
4
RPG
![Page 5: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/5.jpg)
(About Chris)
5
![Page 6: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/6.jpg)
About Chris()
6
![Page 7: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/7.jpg)
About Chris
7
![Page 8: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/8.jpg)
About Chris
http://www.theregister.co.uk/2009/08/19/springsource_cloud_foundry/
8
![Page 9: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/9.jpg)
vmc push About-Chris
9
Developer Advocate for CloudFoundry.com
Signup at http://cloudfoundry.com
![Page 10: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/10.jpg)
10
Agenda The (sometimes evil) monolith Decomposing applications into services How do services communicate? Presentation layer design How Cloud Foundry helps
![Page 11: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/11.jpg)
Let’s imagine you are building an e-commerce application
11
![Page 12: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/12.jpg)
Tomcat
Traditional web application architecture
12
Browser
WAR
MySQL Database
ShippingService
AccountingService
InventoryService
StoreFrontUI
developtestdeployscale
Simple to
Apache
![Page 13: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/13.jpg)
But there are problems
13
![Page 14: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/14.jpg)
Users expect a rich, dynamic and interactive experience on mobile devices and desktop
14
Java Web Application
Browser
HTTP Request
HTML/Javascript
Old style UI architecture isn’t good enough
Real-time web ≅ NodeJS
![Page 15: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/15.jpg)
Obstacle to frequent deployments Need to redeploy everything to change one component Interrupts long running background (e.g. Quartz) jobs Increases risk of failure
Fear of change
Updates will happen less often e.g. Makes A/B testing UI really difficult 15
![Page 16: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/16.jpg)
Overloads your IDE and container
16Slows down development
![Page 17: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/17.jpg)
Obstacle to scaling development
17
!=Scalable development
WAR
Shipping
Accounting
InventoryService
StoreFrontUI
Forces teams to synchronize development efforts Teams need to coordinate updates
![Page 18: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/18.jpg)
Requires long-term commitment to a technology stack
Switching technology stack ⇒ touches entire application Painful and rarely done Makes it difficult to incrementally adopt newer technologies You end up being stuck with the technology you started with
18
![Page 19: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/19.jpg)
19
Agenda The (sometimes evil) monolith Decomposing applications into services How do services communicate? Presentation layer design How Cloud Foundry helps
![Page 20: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/20.jpg)
3 dimensions to scaling
20
X axis - horizontal duplicationZ ax
is - d
ata pa
rtitio
ning
Y axis - functionaldecomposition
Scale by cloning
Scale
by sp
litting
simila
r thin
gsScale by splitting different things
![Page 21: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/21.jpg)
Y axis scaling - functional partitioning Splits monolithic application into a set of services Each service implements a set of related functionality Partitioning schemes:•Partition functionality by noun or by verb•Single Responsibility Principle•Unix utilities - do one focussed thing well
21
Something of an art
![Page 22: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/22.jpg)
Y axis scaling - application level
22
WAR
ShippingService
AccountingService
InventoryService
StoreFrontUI
![Page 23: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/23.jpg)
Y axis scaling - application level
23
Store front web application
shipping web application
inventory web application
Apply X axis cloning and/or Z axis partitioning to each service
ShippingService
AccountingService
InventoryServiceStoreFrontUI
billing web application
![Page 24: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/24.jpg)
Real world examples
24
http://highscalability.com/amazon-architecture
Between 100-150 services are accessed to build a page.
http://techblog.netflix.com/
http://www.addsimplicity.com/downloads/eBaySDForum2006-11-29.pdf
http://queue.acm.org/detail.cfm?id=1394128
![Page 25: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/25.jpg)
There are drawbacks Complexity: development, deployment, etc. Multiple databases ⇒ transaction management challenges Deciding when to use it• In the beginning: you don’t need it and it will slow you down•When you do need it: refactoring existing code is painful
25
See Steve Yegge’s Google Platforms Rant re Amazon.com
![Page 26: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/26.jpg)
But there are many benefits Scales development: develop, deploy and scale each service
independently Improves fault isolation Enforces well defined interfaces between components Eliminates long-term commitment to a single technology
stack
26
Modular, polyglot, multi-framework applications
![Page 27: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/27.jpg)
Two levels of architecture System level•Defines the inter-service glue: interfaces and
communication mechanisms•Slow changing
Service level•Defines the internal architecture of each service•Far fewer constraints on technology•Each service could use a different technology stack•Pick the best tool for the job•Rapid evolving
27
Versus
![Page 28: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/28.jpg)
If services are small... Regularly rewrite using a better technology stack Adapt system to changing requirements and better
technology without a total rewrite Pick the best developers rather than best <pick a
language> developers ⇒ polyglot culture
28
Fred George “Developer Anarchy”
![Page 29: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/29.jpg)
The human body as a system
29
![Page 30: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/30.jpg)
50 to 70 billion of your cells die each day
30
![Page 31: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/31.jpg)
Yet you (the system) remain you
31
![Page 32: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/32.jpg)
Can we build software systems with these characteristics?
32
http://dreamsongs.com/Files/WhitherSoftware.pdf
http://dreamsongs.com/Files/DesignBeyondHumanAbilitiesSimp.pdf
![Page 33: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/33.jpg)
33
Agenda The (sometimes evil) monolith Decomposing applications into services How do services communicate? Presentation layer design How Cloud Foundry helps
![Page 34: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/34.jpg)
Inter-service communication options Multiple collaborating services ⇒ need a communication
mechanism Many choices:•Synchronous ⇔ asynchronous•Transports: HTTP, AMQP, ...•Formats: JSON, XML, Protocol Buffers, Thrift, ...•Even via the database
Distributed application ⇒ error handling strategies
34
Asynchronous is preferred
JSON is fashionable but binary format is more efficient
![Page 35: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/35.jpg)
StoreFrontUI
wgrus-store.war
AccountingService
wgrus-billing.war
InventoryService
wgrus-inventory.war
ShippingService
wgrus-shipping.war
MySQL
35
RabbitMQ(Message Broker)
Asynchronous message-based communication
![Page 36: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/36.jpg)
Benefits and drawbacks Benefits•Decouples caller from server•Caller unaware of server’s coordinates (URL)•Message broker buffers message when server is down/slow
Drawbacks•Additional complexity of message broker •RPC using messaging is more complex
36
![Page 37: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/37.jpg)
Writing code that calls services
37
![Page 38: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/38.jpg)
Composable futures Problem:•Service A needs to call services B and C and then D•Makes sense to call B and C parallel•Yet most concurrency APIs are low-level, error-prone etc
Solution:•Use Akka composable futures = really nice abstraction
38
val futureB = callB()val futureC = callC()
val futureD = for { b <- futureB.mapTo[SomeType] c <- futureC.mapTo[SomeType] d <- callD(b, c) } yield d
val result = Await.result(futureD, 1 second). asInstanceOf[SomeOtherType]
http://doc.akka.io/docs/akka/2.0.1/scala/futures.htmlhttp://en.wikipedia.org/wiki/Futures_and_promises
Two calls execute in parallel
And then invokes D
Get the result of D
![Page 39: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/39.jpg)
Spring Integration
Builds on Spring framework
Implements EAI patterns = high-level of abstraction for building message based applications
Provides the building blocks for a pipes and filters architecture
• Pipes = message channels
• Filters = endpoints that filter, transform, route messages and integrate with external messaging infrastructure
Enables development of components that are
• loosely coupled
• insulated from underlying messaging infrastructure
39
![Page 40: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/40.jpg)
Handling failure
40
Service A Service B
Errors happen in distributed systems
![Page 41: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/41.jpg)
Use timeouts and retries
Never wait foreverErrors can be transient ⇒ retry
41http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
![Page 42: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/42.jpg)
Service A
Service B
Use per-dependency bounded thread pool
42http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
Runnable 1
Runnable 2
Runnable
bounded queue
Task 1
Task 2
Task ...
bounded thread pool
Limits number of outstanding requests
Fails fast if service is slow or down
![Page 43: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/43.jpg)
Use a circuit breakerHigh error rate ⇒ stop calling temporarily
Avoids calling service that has issues
Down ⇒ wait for it to come back up
Slow ⇒ gives it a chance to recover
43http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
![Page 44: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/44.jpg)
On failure - don’t fail tooReturn cached dataReturn default data
Invoke custom error handler
44http://techblog.netflix.com/2012/02/fault-tolerance-in-high-volume.html
![Page 45: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/45.jpg)
45
Agenda The (sometimes evil) monolith Decomposing applications into services How do services communicate? Presentation layer design How Cloud Foundry helps
![Page 46: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/46.jpg)
Modular application
Choice of presentation layer technology+
Redeploy UI frequently/independently
46
![Page 47: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/47.jpg)
NodeJS is the fashionable technology
47
Many JavaScript client frameworks have a NodeJS counterparte.g. socket.io
![Page 48: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/48.jpg)
NodeJS example
48
var http = require('http');var fs = require("fs");
http.createServer(function (req, res) { fs.readFile('somefile.txt', function (err, data) { if (err) throw err; res.writeHead(200, {'Content-Type': 'text/plain'}); res.end(data); });}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
Handle HTTP
request Handle file read
![Page 49: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/49.jpg)
NodeJS isn’t the only game in town
49
JVM-based http://vertx.io/
![Page 50: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/50.jpg)
A modern web application
50
Browser
Service 1
Service 2
...
HTML 5Application
Socket.ioclient
Events
RESTful WS
Server Application
Socket.ioserver
Node JS
![Page 51: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/51.jpg)
NodeJS - using RESTful WS and AMQP
51
Node JS
Service
RabbitMQ Service
REST
AMQP AMQP
RESTRequests
Eventssocket.io
![Page 52: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/52.jpg)
Updating the UI is easy
52
Update the UI independently of rest of system Easily run A/B tests Enables fast iteration of the UI
http://theleanstartup.com/principles
![Page 53: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/53.jpg)
53
Agenda The (sometimes evil) monolith Decomposing applications into services How do services communicate? Presentation layer design How Cloud Foundry helps
![Page 54: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/54.jpg)
Traditional tools: monolithic applications
54
![Page 55: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/55.jpg)
Developing modular apps is more difficult Many more moving parts to manage•Platform services: SQL, NoSQL, RabbitMQ•Application services: your code
Who is going to setup the environments:• the developer sandbox?• ...•QA environments?
55
But Cloud Foundry helps...
![Page 56: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/56.jpg)
Applica'on Service Interface
Data Services
Other Services
Msg Services
Easy polyglot application deployment and service provisioning
vFabric Postgres
vFabric RabbitMQTM
Additional partners services …
OSS community
Private Clouds
PublicClouds
MicroClouds
![Page 57: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/57.jpg)
Creating a platform service instance$ vmc create-service mysql --name mysql1Creating Service: OK
$ vmc services......
=========== Provisioned Services ============
+-------------+---------+| Name | Service |+-------------+---------+| mysql1 | mysql |+-------------+---------+
![Page 58: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/58.jpg)
Multi-application manifest - part 1--- applications: inventory/target: name: inventory url: cer-inventory.chrisr.cloudfoundry.me framework: name: spring info: mem: 512M description: Java SpringSource Spring Application exec: mem: 512M instances: 1 services: si-rabbit: type: :rabbitmq si-mongo: type: :mongodb si-redis: type: :redis
58
Path to application
Required platform services
![Page 59: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/59.jpg)
Multi-application manifest - part 2 store/target: name: store url: cer-store.chrisr.cloudfoundry.me framework: name: spring info: mem: 512M description: Java SpringSource Spring Application exec: mem: 512M instances: 1 services: si-mongo: type: :mongodb si-rabbit: type: :rabbitmq
59
Path to application
Required platform services
![Page 60: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/60.jpg)
One command to create platform services and deploy application
$ vmc push Would you like to deploy from the current directory? [Yn]: Pushing application 'inventory'...Creating Application: OKCreating Service [si-rabbit]: OKBinding Service [si-rabbit]: OKCreating Service [si-mongo]: OKBinding Service [si-mongo]: OKCreating Service [si-redis]: OKBinding Service [si-redis]: OKUploading Application: Checking for available resources: OK Processing resources: OK Packing application: OK Uploading (12K): OK Push Status: OKStaging Application 'inventory': OK Starting Application 'inventory': OK Pushing application 'store'...Creating Application: OKBinding Service [si-mongo]: OKBinding Service [si-rabbit]: OKUploading Application: Checking for available resources: OK Processing resources: OK Packing application: OK Uploading (5K): OK Push Status: OKStaging Application 'store': OK Starting Application 'store': ... 60
vmc push:•Reads the manifest file•Creates the required platform services•Deploys all the applications
![Page 61: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/61.jpg)
Micro Cloud Foundry: new developer sandbox
61
Open source Platform as a Service project
App Instances Services
10.04
A PaaS packaged as a VMware Virtual Machine
Use as a developer sandbox
• Use the services from Junit integration tests
• Deploy your application for functional testing
• Remote debugging from STS
![Page 62: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/62.jpg)
Using Caldecott to tunnel into your services
62
![Page 63: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/63.jpg)
Caldecott = TCP over HTTP
63
Your computer
Caldecott gem
Cloud Foundry
Caldecott application
ServiceHTTP native
protocol
Port NNN
Service client
nativeprotocol
![Page 64: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/64.jpg)
Using Caldecott…$ vmc tunnel1: mysql-135e02: mysql1Which service to tunnel to?: 2Password: ********Stopping Application: OKRedeploying tunnel application 'caldecott'.Uploading Application: Checking for available resources: OK Packing application: OK Uploading (1K): OK Push Status: OKBinding Service [mysql1]: OKStaging Application: OK Starting Application: OK Getting tunnel connection info: OK
Service connection info: username : uMe6Apgw00AhS password : pKcD76PcZR7GZ name : d7cb8afb52f084f3d9bdc269e7d99ab50
Starting tunnel to mysql1 on port 10000.1: none2: mysqlWhich client would you like to start?: 2
![Page 65: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/65.jpg)
…Using CaldecottLaunching 'mysql --protocol=TCP --host=localhost --port=10000 --
user=uMe6Apgw00AhS --password=pKcD76PcZR7GZ d7cb8afb52f084f3d9bdc269e7d99ab50'
Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 10944342Server version: 5.1.54-rel12.5 Percona Server with XtraDB (GPL),
Release 12.5, Revision 188
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
![Page 66: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/66.jpg)
Running JUnit test with Caldecott
66
Configure your test code to use port + connection info
![Page 67: Decomposing applications for deployability and scalability (CF India July/August 2012)](https://reader033.fdocuments.us/reader033/viewer/2022060108/554f46dab4c905423f8b49b4/html5/thumbnails/67.jpg)
Summary Monolithic applications are simple to develop and deploy
BUT have significant drawbacks
Applying the scale cube
Decomposes your application into services Enables scaling for transactions and data volumes Tackles application complexity Enables scaling for development Enables frequent, independent deployments Make it easy to leverage other technologies
AND
Cloud Foundry simplifies the development and deployment of modular, service-based applications 67