Smart Client
Service discovery
service://identity/...
Retry failed GET/PUT/DELETE (idempotent) requests
Run HTTP requests asynchronously
Slide 24
Slide 24 text
Smart Client
Atlas
Slide 25
Slide 25 text
Smart Client
ZooKeeper
Atlas
DynamoDB
/hosts/identity/host001.runscope.com = 5000
/hosts/identity/host001.runscope.com/enabled = True
Register service metadata
in Zookeeper & DynamoDB
Slide 26
Slide 26 text
Smart Client
Atlas
Sidecar
Runs HAProxy on each host.
Reads cluster state from
atlas.
Watches for changes to
services and updates the
local configuration.
host001
host002
host003
Smart Service
Various additions to the flask app object
from flask import current_app
current_app.realm
current_app.redis
current_app.database
current_app.api
Slide 42
Slide 42 text
Smart Service
Common Logging Configuration
/var/log/runscope/.access.log
/var/log/runscope/.error.log
current_app.logger.warn(“Uh oh!”)
bugsnag.notify(e)
Slide 43
Slide 43 text
$> generate-service my-awesome-service
Creating a service skeleton with this configuration:
Service name: my-awesome-service
Destination directory: ~/runscope/my-awesome-service
Python package name: my_awesome_service
HTTP port: 5004
1. Generating files in ~/runscope/my-awesome-service
2. Initializing Git repository in ~/runscope/my-awesome-service
3. Creating virtualenv my-awesome-service
4. Installing Python prerequisites (requirements.txt and setup.py)
All done! my-awesome-service source code can be found in ~/runscope/my-awesome-service
Smart Service
Auto Generate Service Skeletons
Slide 44
Slide 44 text
Smart Service
Reduce Cognitive Overhead
Slide 45
Slide 45 text
How do you make building
services easy?
Smart Service
Slide 46
Slide 46 text
What happens when you have
so many services?
Slide 47
Slide 47 text
What happens when you have
so many services?
A Lot :)
Slide 48
Slide 48 text
Automate everything
Slide 49
Slide 49 text
Language Agnostic
Slide 50
Slide 50 text
Language Agnostic
HTTP is our common ‘language’
Slide 51
Slide 51 text
No shared databases
Slide 52
Slide 52 text
Dashboard
Traffic
Gateway
API
Postgresql
Slide 53
Slide 53 text
Dashboard
Traffic
Gateway
API
Postgresql
X
Slide 54
Slide 54 text
Dashboard
Traffic
Gateway
API
Identity
Postgresql
Flask
Redis
A service owns it’s own datastore(s).
Slide 55
Slide 55 text
Dashboard
Traffic
Gateway
API
And exposes an API for that data.
Identity
GET /teams/
PUT /teams/
GET /buckets
...
Slide 56
Slide 56 text
Invest in deployment
automation.
Slide 57
Slide 57 text
Invest in deployment
automation.
1-Click Deploys
Slide 58
Slide 58 text
No content
Slide 59
Slide 59 text
0
10
20
30
40
50
Jun 2014 Jul Aug Sep Oct Nov Dec Jan Feb Mar 2015
Deploys per day
Slide 60
Slide 60 text
Test & Monitor your APIs
Slide 61
Slide 61 text
Test Lifecycle
Local Dev
{{identity_host}} = http://localhost
Local Agents
Slide 62
Slide 62 text
Test Lifecycle
Test Realm
Local Dev
{{identity_host}} = http://test001.runscope.com
Local Agents
Trigger URLs
Slide 63
Slide 63 text
Test Lifecycle
Test Realm
Production
Local Dev
{{identity_host}} = http://host002.runscope.com
Local Agents
Trigger URLs
Schedules
Slide 64
Slide 64 text
0
10
20
30
40
50
Jun 2014 Jul Aug Sep Oct Nov Dec Jan Feb Mar 2015
Deploys per day
Slide 65
Slide 65 text
Smart Services & Smart Clients
How microservices change the way you build and deploy code
Frank Stratton
@FrankRStratton
Runscope