Flexible Micro-Hydro Systems Scalable Affordable for Grid ...
Scalable Systems Using Micro- RESTful Services
description
Transcript of Scalable Systems Using Micro- RESTful Services
![Page 1: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/1.jpg)
Scalable Systems Using Micro-RESTful Services
SILICON VALLEY CODE CAMPOCTOBER 6TH, 2013
by Ted M. Younghttp://about.me/tedmyoungTwitter: @jitterted
![Page 2: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/2.jpg)
What to expect this session The Problem
An Architectural Solution
Our Proof of Concept
![Page 3: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/3.jpg)
The Problems
![Page 4: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/4.jpg)
Monolithic
![Page 5: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/5.jpg)
Layered Architecture
Platform
Business Logic
UI APIsBatch
Biz Logic Biz Logic
Biz Logic
![Page 6: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/6.jpg)
Tight-Coupling
![Page 7: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/7.jpg)
Complexity
![Page 8: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/8.jpg)
Many Responsibilities
![Page 9: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/9.jpg)
Scalability Limitations
![Page 10: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/10.jpg)
RPC-Based APIs are Brittle
![Page 11: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/11.jpg)
TheArchitecture CubeandMicro-ServicesSERVICES PER FEATURE INTEGRATED USING REST
![Page 12: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/12.jpg)
From "The Art of Scalability" (Figure 12.3)
ArchitecturalPrinciples
![Page 13: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/13.jpg)
Scalability CubeFrom "The Art of Scalability" (Figure 23.1)
![Page 14: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/14.jpg)
Layered Architecture(Traditional)
![Page 15: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/15.jpg)
Onion (Clean) Architecture
![Page 16: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/16.jpg)
System Architecture
TaskManagement
Service
CommissionService
Billing andPaymentService
UserManagement
Service
AgentManagement
Service
![Page 17: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/17.jpg)
Service Architecture
![Page 18: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/18.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/19.jpg)
Fits in your head
![Page 20: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/20.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/21.jpg)
Proof of ConceptOUR SUMMER EXPERIMENT
![Page 22: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/22.jpg)
Tech Stack Dropwizard services
AngularJS UI Client
Jenkins + Maven (Nexus) deployment
Custom Dashboard
![Page 23: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/23.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/24.jpg)
REST: Media Types More structure than POAJ
◦Plain Old application/json
Leverage libraries
![Page 25: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/25.jpg)
Media Types for APIs In/Out: application/collection+json
In: application/x-www-form-urlencoded
![Page 26: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/26.jpg)
collection+json (aka Cj)
![Page 27: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/27.jpg)
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](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/28.jpg)
CD Goal
![Page 29: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/29.jpg)
Monitoring
![Page 30: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/30.jpg)
Future Monitoring/Mgmt
![Page 31: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/31.jpg)
Still In Progress API Facades
Better Deployment/Management
![Page 32: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/32.jpg)
Final Questions?
![Page 33: Scalable Systems Using Micro- RESTful Services](https://reader036.fdocuments.net/reader036/viewer/2022062411/56816688550346895dda3b60/html5/thumbnails/33.jpg)
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