Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up
for free
Djangocong Apps to Services
Craig Kerstiens
April 14, 2012
Programming
5
630
Djangocong Apps to Services
Craig Kerstiens
April 14, 2012
Tweet
Share
More Decks by Craig Kerstiens
See All by Craig Kerstiens
craigkerstiens
0
83
craigkerstiens
0
110
craigkerstiens
1
270
craigkerstiens
0
75
craigkerstiens
1
120
craigkerstiens
1
89
craigkerstiens
1
280
craigkerstiens
0
110
craigkerstiens
2
360
Other Decks in Programming
See All in Programming
zsmb
2
110
showwin
0
120
standfm
0
230
wasabeef
1
560
zsmb
1
130
xrdnk
0
130
trajchevska
2
340
momofff
0
160
mu2in
0
140
line_developers_tw2
0
670
daiki1020
0
1.1k
itosho525
0
360
Featured
See All Featured
iamctodd
17
1.8k
bryan
100
11k
yeseniaperezcruz
302
31k
brad_frost
156
6.4k
jasonvnalue
82
8k
scottboms
251
11k
denniskardys
220
120k
hursman
106
9.2k
cassininazir
347
20k
davidbonilla
69
3.5k
pauljervisheath
196
15k
edds
56
9.3k
Transcript
Django Apps to Services
Craig Kerstiens @craigkerstiens work at @heroku
Project App A collection of configuration and apps for a
particular Website. (per Django Project) Django
Project App A collection of configuration and apps for a
particular Website. A web application that does something. I.e. Weblog, Poll, Ticket system (per Django Project) Django
Within Django
Project Within Django
Project App Within Django
Project App App Within Django
Project App App App Within Django
Project App App App Tickets FAQ FaqCreator Within Django
REUSABILITY means faster features due to DRY (Don’t Repeat Yourself)
REUSABILITY does not always mean SCALABILITY or MAINTAINABILITY
Project App A collection of configuration and apps for a
particular Website. A web application that does something. I.e. Weblog, Poll, Ticket system (per Django Project) Django
Project App A collection of configuration and apps for a
particular Website. A web application that does something. I.e. Weblog, Poll, Ticket system Django Service Method of communication over the web. Web APIs allow combination of multiple services
None
Tech imitate Teams Project App App App Tickets FAQ FaqCreator
Company Support Knowledge Base
App App Support Knowledge Base Teams Grow
App App Support Knowledge Base Billing Teams Grow
App App Support Knowledge Base Billing Marketing Teams Grow
App App Support Knowledge Base Billing Marketing Analytics Mobile API
Front End Social Teams Grow
App App App Support Knowledge Base Billing Apps Grow Marketing
Analytics Mobile API Front End Social 3 Apps
App App App Support Knowledge Base Billing Apps Grow App
App App Marketing Analytics Mobile App App App API Front End Social 9 Apps
Support Knowledge Base Billing Apps Grow Marketing Analytics Mobile API
Front End Social 9 Apps 1 Codebase
Defined contract for communicating Service
Defined contract for communicating Service $ curl -O $FAQ_API/create/ -X
“question=my\ question source=123”
In Python
In Python data = { ‘question’: “my question”, ‘source’: 123
} requests.POST(os.environ[‘FAQ_API’] + ‘/create/’, data=data)
None
Version Bump data = { ‘question’: “my question”, ‘source’: 123,
‘related’: [456, 789] } requests.POST(os.environ[‘FAQ_API’] + ‘/v2/create’, data=data)
Version Bump data = { ‘question’: “my question”, ‘source’: 123,
‘related’: [456, 789] } requests.POST(os.environ[‘FAQ_API’] + ‘/v2/create’, data=data)
Version Bump
Version Bump data = { ‘question’: “my question”, ‘source’: 123,
‘related’: [456, 789] } requests.POST(os.environ[‘FAQ_API’] + ‘/v2/create’, data=data) STILL VALID requests.POST(os.environ[‘FAQ_API’] + ‘/v1/create’, data=data)
Whats a service Provider API_HOST= http://127.0.0.1
Whats a service Provider Endpoint API_HOST= http://127.0.0.1 /v1/create/
Whats a service Provider Endpoint API_HOST= http://127.0.0.1 /v1/create/ Contract {
‘question’: ‘foo bar’, ‘source’: 123 }
Service App
Service App Models Views URLs Provider Endpoint Contract
A SERVICE means REUSABILITY and enables SCALABILITY and MAINTAINABILITY
A SERVICE means REUSABILITY and enables SCALABILITY and MAINTAINABILITY
Fin. Resources http://bit.ly/djangocong http://bit.ly/appstoservices http://www.12factor.net