Top Banner
Scalable Systems Using Micro-RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH , 2013 by Ted M. Young http://about.me/tedmyoung Twitter: @jitterted
33

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

Mar 28, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Scalable Systems Using Micro-RESTful Services

SILICON VALLEY CODE CAMP

OCTOBER 6TH, 2013

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

Page 2: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

What to expect this session

The Problem

An Architectural Solution

Our Proof of Concept

Page 3: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

The Problems

Page 4: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Monolithic

Page 5: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Layered Architecture

Platform

Business Logic

UI APIsBatch

Biz Logic Biz Logic

Biz Logic

Page 6: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Tight-Coupling

Page 7: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Complexity

Page 8: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Many Responsibilities

Page 9: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Scalability Limitations

Page 10: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

RPC-Based APIs are Brittle

Page 11: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

TheArchitecture CubeandMicro-ServicesSERVICES PER FEATURE INTEGRATED USING REST

Page 12: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

From "The Art of Scalability" (Figure 12.3)

ArchitecturalPrinciples

Page 13: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Scalability Cube

From "The Art of Scalability" (Figure 23.1)

Page 14: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Layered Architecture(Traditional)

Page 15: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Onion (Clean) Architecture

Page 16: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

System Architecture

TaskManagement

Service

CommissionService

Billing andPaymentService

UserManagement

Service

AgentManagement

Service

Page 17: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Service Architecture

Page 18: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

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

Page 19: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Fits in your head

Page 20: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Hypermedia (REST)

Resource-oriented

Flexible in face of change

User-facing clients leverage links

Async and Stateless services

Page 21: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Proof of ConceptOUR SUMMER EXPERIMENT

Page 22: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Tech Stack

Dropwizard services

AngularJS UI Client

Jenkins + Maven (Nexus) deployment

Custom Dashboard

Page 23: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

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

Page 24: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

REST: Media Types

More structure than POAJ◦Plain Old application/json

Leverage libraries

Page 25: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Media Types for APIs

In/Out: application/collection+json

In: application/x-www-form-urlencoded

Page 26: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

collection+json (aka Cj)

Page 27: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Continuous Deployment

Current:◦ Jenkins

◦ Nexus repository (Maven package)◦ Shell script

Tried:◦ Upstart script & Puppet◦ Ansible◦ Bamboo 5

Page 28: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

CD Goal

Page 29: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Monitoring

Page 30: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Future Monitoring/Mgmt

Page 31: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Still In Progress

API Facades

Better Deployment/Management

Page 32: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

Final Questions?

Page 33: Scalable Systems Using Micro- RESTful Services SILICON VALLEY CODE CAMP OCTOBER 6 TH, 2013 by Ted M. Young  Twitter: @jitterted.

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