SVCC2013-Micro-RESTful Services - Blogs by Ted M. Young

yrekazzyzxamuckInternet and Web Development

Dec 4, 2013 (3 years and 10 months ago)

88 views

Scalable Systems Using
Micro
-
RESTful

Services

SI LI CON VALLEY CODE CAMP

OCTOBER 6
TH
, 2013

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

Platform

Business Logic

UI

APIs

Batch

Biz Logic

Biz Logic

Biz Logic

Tight
-
Coupling

Complexity

Many Responsibilities

Scalability Limitations

RPC
-
Based APIs are Brittle

The

Architecture
Cube

and

Micro
-
Services

SERVI CES PER FEATURE I NTEGRATED USI NG REST

From "The Art
of Scalability"
(Figure 12.3)

Architectural

Principles

Scalability Cube

From "The Art
of Scalability"
(Figure 23.1)

Layered Architecture

(Traditional)

Onion (Clean) Architecture

System Architecture

Task

Management

Service

Commission

Service

Billing and

Payment

Service

User

Management

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 EXPERI MENT

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