Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M....

Post on 28-Mar-2015

214 views 0 download

Tags:

Transcript of Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M....

Scalable Systems Using Micro-RESTful Services

SILICON VALLEY CODE CAMP

OCTOBER 6TH, 2013

by Ted M. Younghttp://about.me/tedmyoungTwitter: @jitterted

What to expect this session

The Problem

An Architectural Solution

Our Proof of Concept

The Problems

Monolithic

Layered Architecture

Platform

Business Logic

UI APIsBatch

Biz Logic Biz Logic

Biz Logic

Tight-Coupling

Complexity

Many Responsibilities

Scalability Limitations

RPC-Based APIs are Brittle

TheArchitecture CubeandMicro-ServicesSERVICES PER FEATURE INTEGRATED USING REST

From "The Art of Scalability" (Figure 12.3)

ArchitecturalPrinciples

Scalability Cube

From "The Art of Scalability" (Figure 23.1)

Layered Architecture(Traditional)

Onion (Clean) Architecture

System Architecture

TaskManagement

Service

CommissionService

Billing andPaymentService

UserManagement

Service

AgentManagement

Service

Service Architecture

The Unix PhilosophyWrite 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 ConceptOUR 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