The document is a presentation about building applications for the cloud on OpenStack. It discusses how applications used to be built with tight coupling between components on individual servers, but in the cloud applications need to be designed from the start to scale horizontally and handle failures. It provides guidance on componentizing applications into loosely coupled microservices, using stateless components, leveraging images to easily deploy identical instances, and implementing auto-scaling and auto-recovery features.
1 of 61
Downloaded 17 times
More Related Content
Building cloudy apps
1. April 16, 2013
Building ¡°Cloudy¡± Apps
OpenStack Summit April 2013 - Portland, Oregon
1
1Tuesday, April 30, 13
2. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
The End
2
1
2
Enable Scaling
Expect Failure
2Tuesday, April 30, 13
3. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Know Your Audience
? How many of you are attending your first OpenStack Summit?
? How many of you have attended a Rackspace Training class before?
? How many of you know which track this talk is listed under?
? How many of you are just getting started with OpenStack?
? How many of you are Developers?
? How many of you are Operators?
? How many of you are both?
? How many of you are neither?
? How many of you consider yourself to be technical?
? How many of you have access to a working OpenStack Cluster?
? How many of you know what OpenStack is?
? How many of you know which projects make up OpenStack?
? How many of you have ever written a production application for the cloud?
? How many of you remember the end of my talk?
3
3Tuesday, April 30, 13
4. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Know Your Speaker
4
Tony Campbell
Director of Training and Certi?cation
training.rackspace.com
www.rackertalent.com
@CloudTrainMe
tonycampbell
4Tuesday, April 30, 13
5. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Know Your Speaker
5
Broadcast Communications / English / Theater
Sun Microsystems
eCommerce in 1997
Hitachi Data Systems
eBene?ts Start Up
Rackspace
5Tuesday, April 30, 13
6. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Know Your Speaker
6
Rackspace (The last 10 years)
Web Development - Rackspace.com
Software Development - MyRackspace
The ¡°Original¡± Rackspace Cloud - Mosso
Rackspace Private Cloud and OpenStack
Software Development
6Tuesday, April 30, 13
7. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
My Happy Place
7
Software
Development
Hardware
Management
7Tuesday, April 30, 13
8. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Before the Cloud
Throwback Applications
8
8Tuesday, April 30, 13
9. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
9
Writing Apps that Users Used
Application
9Tuesday, April 30, 13
10. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
10
Developers wrote applications
Data Access Layer
Services Layer
Presentation Layer
10Tuesday, April 30, 13
11. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
11
Developers wrote applications
Data Access Layer
Services Layer
Presentation Layer
Database
11Tuesday, April 30, 13
12. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
12
Developers wrote applications
Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
12Tuesday, April 30, 13
13. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
13
Developers wrote applications
Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
13Tuesday, April 30, 13
14. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
14
Developers wrote applications
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 1
Database
Database Server 1
14Tuesday, April 30, 13
15. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
15
Developers wrote applications
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 1
Database
Database Server 1
15Tuesday, April 30, 13
16. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
16
Developers wrote applications
Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 2
Database Server 1
Load Balancer
16Tuesday, April 30, 13
17. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
17
Developers wrote applications
Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 2
Database Server 1
Load Balancer
17Tuesday, April 30, 13
18. Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 2
Database Server 1
Load Balancer
Database
Replicated Database
RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
18
Developers wrote applications
18Tuesday, April 30, 13
19. Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 2
Database Server 1
Load Balancer
Database
Replicated Database
RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
19
The Cost of Success
19Tuesday, April 30, 13
20. Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 2
Database Server 1
Load Balancer 1
Database
Replicated Database
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 3
RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
20
The Cost of Success
Physical Machine X
Physical Machine X
Physical Machine X
Just in Case
20Tuesday, April 30, 13
21. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
21
HA Networking
Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 2
Database Server 1
Load Balancer 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 3
Load Balancer 2
Firewall 1 Firewall 2
Database
Replicated Database
21Tuesday, April 30, 13
22. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time
22
Datacenter 1
Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 2
Database Server 1
Load Balancer 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 3
Load Balancer 2
Firewall 1 Firewall 2
Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 2
Database Server 1
Load Balancer 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 3
Load Balancer 2
Firewall 1 Firewall 2
Datacenter 2
22Tuesday, April 30, 13
23. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time - Failure Scenarios
23
23Tuesday, April 30, 13
24. Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 2
Database Server 1
Load Balancer 1
Database
Replicated Database
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 3
RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time - Failure Scenarios
24
Dealing with Failure
24Tuesday, April 30, 13
25. Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 2
Database Server 1
Load Balancer 1
Database
Replicated Database
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 3
RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time - Failure Scenarios
25
Dealing with Failure
25Tuesday, April 30, 13
26. Data Access Layer
Services Layer
Presentation Layer
Database
Physical Machine 1
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 2
Database Server 1
Load Balancer 1
Database
Replicated Database
Data Access Layer
Services Layer
Presentation Layer
Physical Machine 3
RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Once upon a time - Failure Scenarios
26
Dealing with Failure
26Tuesday, April 30, 13
27. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
OpenStack in 60 Seconds
But who¡¯s counting?
27
27Tuesday, April 30, 13
28. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
My Happy Place
28
Software
Development
Hardware
Management
28Tuesday, April 30, 13
29. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
OpenStack in 60* seconds
29
* I reserve the right to take more than 60 seconds
Software
Hardware
29Tuesday, April 30, 13
30. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
OpenStack in 60* seconds
? Cracking the code (names)
¨C Nova
¨C Swift
¨C Glance
¨C Keystone
¨C Horizon
¨C Cinder
¨C Quantum
30
* I reserve the right to take more than 60 seconds
30Tuesday, April 30, 13
31. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Make It ¡°Cloudy¡±
31
31Tuesday, April 30, 13
32. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
The End
32
1
2
Enable Scaling
Expect Failure
32Tuesday, April 30, 13
33. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
The Questions
33
1
2
How is my application going to
handle success?
How is my application going to
handle failure?
33Tuesday, April 30, 13
34. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
The Benefits
34
Cloud can provide powerful
options for scaling your
application
Cloud can help your application
handle failure elegantly
1
2
34Tuesday, April 30, 13
36. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Cloud Enable Your App
36
Cloud Enabled
ApplicationMy Application
36Tuesday, April 30, 13
37. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Horizontal Scaling
Don¡¯t buy a bigger box, just get more boxes
37
37Tuesday, April 30, 13
38. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Scaling in a Cloud World
38
Vertical Horizontal
Big
Bigger
Biggest
Super Big
Instance Instance InstanceInstance Instance
Instance Instance InstanceInstance Instance
Instance Instance InstanceInstance Instance
Instance Instance InstanceInstance Instance
38Tuesday, April 30, 13
39. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Componentized
Break your app into components
39
39Tuesday, April 30, 13
40. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
¡°Componentize¡± your application
40
Identify your Node Types
Web
Server
Node
Service
Node
Data
Node
Running the web server
May leverage a web framework
Serves the user interface
Only accessible by the web server nodes
Specialized to deliver discrete functionality
Stateless and autonomous
Interacts with the datastore
Read only from the web server nodes
Read / Write from the service nodes
40Tuesday, April 30, 13
41. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
¡°Componentize¡± your application
41
Identify your Node Types
Service
Node
Only accessible by the web server nodes
Specialized to deliver discrete functionality
Stateless and autonomous
Registration
Service
Node
Billing
Service
Node
Idea
Service
Node
Auth
Service
Node
Report
Service
Node
Admin
Service
Node
Service Oriented Architecture
41Tuesday, April 30, 13
42. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
How you ¡°Componentize¡±
your application will
determine how you scale your
application
42
42Tuesday, April 30, 13
43. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Loosely Coupled & Autonomous
Lets keep it on a need to know basis
43
43Tuesday, April 30, 13
44. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Loosely Coupled & Autonomous
44
Registration
Service
Node
Payment
Service
Node
Idea
Service
Node
Auth
Service
Node
Report
Service
Node
Admin
Service
Node
Web Server
Node
Web Server
Node
Web Server
Node
NOT!
44Tuesday, April 30, 13
45. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Loosely Coupled & Autonomous
45
Registration
Service
Node
Payment
Service
Node
Idea
Service
Node
Auth
Service
Node
Report
Service
Node
Admin
Service
Node
Queueing System
Web
Service
Node
Web
Service
Node
Web
Service
Node
45Tuesday, April 30, 13
46. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Stateless Nodes
Not necessarily a stateless application
46
46Tuesday, April 30, 13
47. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Stateless Nodes
47
Views
Services
Model
Database
State
Data
Controller
Views
Presentation
Services
Controller
Application
Services
Data Services
Database
State
Data
47Tuesday, April 30, 13
48. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Persistent Storage
Where does all my data live?
48
48Tuesday, April 30, 13
49. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Persistent Storage
49
Relational
DB
NoSQL
DB
Block
Storage
Object
Storage
Cache
49Tuesday, April 30, 13
50. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Images
The key to being scale ready
50
50Tuesday, April 30, 13
51. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Images
51
Web Node
Image
Service Node
Image
Data Store
Image
Machine Type
+ Web Node
=
Machine Type
+ =
Machine Type
+ = Data Node
Service Node
51Tuesday, April 30, 13
53. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Auto-Scaling
53
Monitoring
Cloud Load
Balancer
Web Server
Node
Web Server
Node
Web Server
Node
Queueing System
Service
Node
Service
Node
Service
Node
Service
Node
Database
Database
Database
Database
Web Server
Node
Service
Node
Web Server
Node
53Tuesday, April 30, 13
54. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Cost-Scaling
Cloud Load
Balancer
Web Server
Node
Web Server
Node
Web Server
Node
Queueing System
Service
Node
Service
Node
Database
Database
Database
Database
Service
Node
Service
Node
Web Server
Node
Web Server
Node
Service
Node
Service
Node
54Tuesday, April 30, 13
55. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Failure Recovery
Expect Failure and Code For It
55
55Tuesday, April 30, 13
56. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
Auto-Recovery
56
Cloud Load
Balancer
Web Server
Node
Web Server
Node
Web Server
Node
Queueing System
Service
Node
Service
Node
Service
Node
Service
Node
Database
Database
Database
Database
Monitoring
Web Server
Node
56Tuesday, April 30, 13
57. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
The End
57
1
2
Enable Scaling
Expect Failure
57Tuesday, April 30, 13
59. RACKSPACE? HOSTING | WWW.RACKSPACE.COM
www.rackertalent.com
59
We¡¯re Hiring
We¡¯re Training
training.rackspace.com
59Tuesday, April 30, 13
60. 60
RACKSPACE? HOSTING | 5000 WALZEM ROAD | SAN ANTONIO, TX 78218
US SALES: 1-800-961-2888 | US SUPPORT: 1-800-961-4454 | WWW.RACKSPACE.COM
RACKSPACE? HOSTING | ? RACKSPACE US, INC. | RACKSPACE? AND FANATICAL SUPPORT? ARE SERVICE MARKS OF RACKSPACE US, INC. REGISTERED IN THE UNITED STATES AND OTHER COUNTRIES. | WWW.RACKSPACE.COM
60Tuesday, April 30, 13