SVCC2013-Micro-RESTful Services

Download Report

Transcript SVCC2013-Micro-RESTful Services

SILICON VALLEY CODE CAMP
OCTOBER 6 TH , 2013
Scalable Systems Using
Micro-RESTful Services
by Ted M. Young
http://about.me/tedmyoung
Twitter: @jitterted
What to expect this session
The Problem
An Architectural Solution
Our Proof of Concept
The Problems
Monolithic
Layered Architecture
UI
Biz Logic
APIs
Biz Logic
Business Logic
Platform
Batch
Biz Logic
Tight-Coupling
Complexity
Many Responsibilities
Scalability Limitations
RPC-Based APIs are Brittle
The
Architecture Cube
and
Micro-Services
SERVICES PER FEATURE INTEGRATED USING REST
Architectural
Principles
From "The Art
of Scalability"
(Figure 12.3)
Scalability Cube
From "The Art
of Scalability"
(Figure 23.1)
Layered Architecture
(Traditional)
Onion (Clean) Architecture
System Architecture
Task
User
Management
Management
Billing and
Service
Service
Payment
Service
Commission
Service
Agent
Management
Service
Service Architecture
The Unix Philosophy
Write programs that do one thing and do it
well. Write programs to work together.
Write programs that handle text streams,
because that is a universal interface.
- Lions' Commentary on Unix
Fits in your head
Hypermedia (REST)
Resource-oriented
Flexible in face of change
User-facing clients leverage links
Async and Stateless services
Proof of Concept
OUR SUMMER EXPERIMENT
Tech Stack
Dropwizard services
AngularJS UI Client
Jenkins + Maven (Nexus) deployment
Custom Dashboard
Dropwizard
◦Jetty for HTTP
◦Jersey for REST (and HttpClient)
◦Jackson for JSON
◦Metrics (includes Healthcheck) for
monitoring
◦Logback/slf4j for logging
◦Other useful libraries
◦ Guava, JDBI, Liquibase, Freemarker, Joda Date/Time
REST: Media Types
More structure than POAJ
◦Plain Old application/json
Leverage libraries
Media Types for APIs
In/Out: application/collection+json
In: application/x-www-form-urlencoded
collection+json (aka Cj)
Continuous Deployment
Current:
◦ Jenkins
◦ Nexus repository (Maven package)
◦ Shell script
Tried:
◦ Upstart script & Puppet
◦ Ansible
◦ Bamboo 5
CD Goal
Monitoring
Future Monitoring/Mgmt
Still In Progress
API Facades
Better Deployment/Management
Final Questions?
Notes (stuff I didn’t get to
talk about)
Using a RESTful (or Hypermedia) architecture, we've created
"micro" services that talk to each other in order to provide
scalability, along with ease of development, deployment, and
management.
◦ Deployment and Management
◦ Purpose: scaling, updating
◦ Tools: Ansible, Mesos with Marathon,
◦ Event information/Logging
◦ Monitoring
◦ Custom dashboards
◦ REST or Hypermedia
◦ Example of a client that can change functionality over time