SlideShare une entreprise Scribd logo
1  sur  41
Télécharger pour lire hors ligne
Microservices Architecture:
Building Scalable (Library)
Software Solutions
CNI Spring 2016 Membership Meeting, San Antonio, TX
Jason Varghese
(New York Public Library)
@jsonlibrary
Microservices
● Buzzword compliant
● Not a microservices “sales” talk
● Explore microservice principles
● Explore Use Cases/Examples
Microservices
● For web scale only?
● Libraries => Web Scale
● Libraries => Technology Leaders
● Allows for increased pace of innovation
Observe
Decide
OrientAct
● Sometimes referred to as “monoliths”
● Can follow best practices in regards to architecture
● Applications packaged and deployed as single artifact or directory hierarchy
Traditional Web Applications
Server
JVM
Tomcat/Container
Java webapp
(.war file)
UI (server-side)
war file
Circulation
Cataloging
Recommendation
Releasing/versioning monolithic applications
UI
Domain
Persistence UI
Domain
Persistence UI
Domain
Persistence
v1.0
v1.1
v1.2
● Horizontal Scaling
● Vertical Scaling
● Sharding
Scaling Traditional Web Applications
Load Balancer
Instance
#1
Instance
#2
Instance
#N
● Difficult to maintain and release over time
● Dependency management issues
● “Wholesale” scaling of apps.
● Upfront technology stack decision (lock-in).
“Limitations” of monoliths
Scaling by Functional Decomposition
http://akfpartners.com/techblog/2008/05/08/splitting-applications-or-services-for-scale/
Microservices doesn’t solve everything
● Microservices are not a silver bullet
● “Microservices - not a free lunch”
● “If you can't build a monolith, what makes you think microservices are the
answer?”
http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html
http://www.codingthearchitecture.com/2014/07/06/distributed_big_balls_of_mud.html
https://plus.google.com/+ProgrammingCom/posts/LECNUgi4t6R?pid=5851335745881982002&oid=105792929719283190873
Road to microservices
● Domain Driven Design
● Bounded Context
Road to microservices
● Virtualization
● IaaS
● Containerization
● Devops Practice
● PaaS
Road to microservices - Pre VM
● Long lead time to stand up new server
● Special snowflake servers
○ ie. diglibdev1, diglibqa1, diglibprod1, diglibprod2, diglibprod3
● Inconsistent environments
● Package artifact and throw over wall
● Pack everything onto single machine
● But it works on my laptop!
http://blog.codinghorror.com/the-works-on-my-machine-certification-program/
Server
OS
App App App
Road to microservices - Virtualization
● Virtualization
● Multiple VMs per machine
● VMs still require resources
● IaaS (AWS)
● Cloud based VM’s
● Rapid elasticity Server
Host OS
Hypervisor
Guest OS
App
VM
Guest OS
App
VM
Cloud VM
(EC2)
Road to microservices - Containers
● More lightweight than VMs
● No guest OS
● Docker
● Docker Hub
Server
Host OS
Kernel
Container
App
Container
App
Road to microservice - Devops
● Devops is about organization culture
● Devops != {‘Chef’ || ‘Puppet’ || ‘Ansible’}
● Automation
● Getting things done
● Turn around time is minutes/days not weeks/months
● PaaS
Enter Microservices
● “An application architectural style for creating a set of loosely coupled
services each with a bounded context”
UI (server-side)
war file
Circulation
Cataloging
Recommendation
UI
Circulation
Cataloging
Recommendation
Advantages of microservices
● Allows organizations to evaluate and experiment with new technologies
● Fine grain scaling resulting in more efficient use of resources
● Faster/less risky incremental releases
● Break down complex application and problem spaces
Properties of Microservices
● Bounded context
● Encapsulate implementation details
● One datastore per microservice/no integration database across services
● Loosely coupled
● Clear external interfaces
● Centered around product teams
● Products vs. Projects
Cataloging Postgres
Recommendation MongoDB
Complexities
● Distributed Systems
● CAP Theorem
○ Eventually Consistent Systems
But what about SOA?
● Best of SOA Principles
● SOA 2.0
● Less emphasis on middleware (ESB, etc)
● Smart endpoints, dump pipes
● Beware of microservice-enabled middleware, “micro-service product”
Refactoring/Integrating with existing apps
● Strategies for dealing with legacy/3rd party applications
● Case study
Drupal 6 Drupal 7
Refactoring/Integrating with existing apps
● Migrated D6--->D7 instance
● “Locations” experiment
Drupal 7
Locations API AngularJS nypl.org/locations
nypl.org/*
routing
(RP)
Refactoring/Integrating with existing apps
● Iterate and expand on architecture
Drupal 7
Refinery API
nypl.org/locations
nypl.org/staff-picks
nypl.org/staff-profilesReactJS
ReactJS
ReactJS
AngularJS
routing
(RP)
nypl.org/*
JSON file
refactor as needed
Best practices/Emerging Trends
● Providing CMS content as service is appearing to be a best practice
● Building Microservice book describes “CMS as a Service”
● Drupal 8 describes “Content as a Service”
https://www.drupal.com/feature/content-as-a-service
Refactoring/Integrating with existing apps
Drupal 7
nypl.org/locations
nypl.org/staff-picks
nypl.org/staff-profilesReactJS
ReactJS
ReactJS
AngularJS
routing
(RP)
nypl.org/*
JSON file
refactor as needed
New D7
Refinery API
Refactoring/Integrating with existing apps
Drupal 7
nypl.org/locations
nypl.org/staff-picks
nypl.org/staff-profilesReactJS
ReactJS
ReactJS
AngularJS
routing
(RP)
nypl.org/*
JSON file
New D7
Refinery API
nypl.org/new-arrivalsReactJSInventory-Svc
ILS!!!
Refactoring/Integrating with existing apps
Drupal 7
nypl.org/locations
nypl.org/staff-picks
nypl.org/staff-profilesReactJS
ReactJS
ReactJS
AngularJS
routing
(RP)
nypl.org/*
JSON file
New D7
Refinery API
nypl.org/new-arrivalsReactJSInventory-Svc
ILS!!!
nypl.org/betasearchGoogle Custom Search Search-Svc Front end D7
Inventory Service - closer look
Spring Boot
microservice
ILS
Solr
Workers
RabbitMQ
REST/HTTP
AMQP
HTTP
HTTP
ReactJS
JDBC
REST/HTTP
Redis
Microservices for complex workflow
● Orchestration
● Choreography
● NYPL A/V ingest use case
○ Have an idea of end state
○ current state and workflows unclear
○ Spreadsheets
○ “Parking lot” storage (backlog > 600+TB)
○ Bag created as result of current process
● Initial known steps
○ Watch for file/bag
○ Create entry in metadata system
○ Transcode the video
○ Place preservation master in Isilon storage
Audio/Video Ingest
● Not service based
● Ingest Script
watchForFile()
createRecord()
uploadToS3()
moveToIsilon()
new file
ingest.rb
Audio/Video Ingest
● Make it service based
● Orchestrated Approach Example
Ingester/
Filewatcher
Create
Metadata Entry
S3 Uploader/
Elastic
Transcode
Isilon Pusher
new file
Audio/Video Ingest
● Choreographed Approach Example
● Polyglot services
FileWatcher
(IngestMaster)
Create
Metadata Entry
S3 Uploader/
Elastic
Transcoder
IsilonPusher
new file
Message
Broker
Audio/Video Ingest
● Scale out services as needed
● Scale across multiple hosts
FileWatcher
(IngestMaster)
Create
Metadata Entry
IsilonPusher
new file
Message
Broker S
S3 Uploader/
Elastic
Transcoder
IsilonPusherIsilonPusher
FileWatcher
(IngestMaster)
FileWatcher
(IngestMaster)
Audio/Video Ingest
● Modify and extend
FileWatcher
(IngestMaster)
Modified
Metadata Entry
IsilonPusher
new file
Message
Broker S
S3 Uploader/
Elastic
Transcoder
IsilonPusherIsilonPusher
FileWatcher
(IngestMaster)
FileWatcher
(IngestMaster)
Future New
Step
A/V ingest workflow
● Tracking status
● Use Correlation ids (uuid-based)
● View status in log aggregation tool
Deployment Strategies
● Multiple services per host
● Definition of host
● Service per host
● Docker/Kubernetes
Svc Svc
Svc Svc
SvcSvc
Svc
Microservice Requirements
● Automation
○ Provisioning
○ Automated testing
○ CI/CD
○ Rollback
● Monitoring
○ APM
○ Log aggregation
○ Checkpoints (queue-in, queue-out)
○ Correlation IDs
● Service Discovery
● Design for Failure
○ Any node can go down
○ Network failure
○ Degrade functionality without taking down system
Security
● OAuth2.0
● Parties
○ Resource Owner
○ Resource Server
○ Client
○ Authorization Server (can be same as resource server sometimes)
● Authorization Grant Types
○ Authorization Code
○ Client Credentials
○ Implicit Resource Owner
○ Password Credentials
● Open ID Connect
○ Open ID providers
○ Relying Party
● JSON Web Tokens (JWT)
Testing
● Integration Environments
● End to End tests?
Svc - dev
Svc - prod
Dep Svc -
dev
Dep Svc -
prod
?
UI - dev
UI - prod
Svc - dev
Google API
(prod)
UI - dev
Thank You

Contenu connexe

Tendances

Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsŁukasz Sowa
 
Deploying WSO2 Middleware on Kubernetes
Deploying WSO2 Middleware on KubernetesDeploying WSO2 Middleware on Kubernetes
Deploying WSO2 Middleware on KubernetesWSO2
 
Microservices and modularity with java
Microservices and modularity with javaMicroservices and modularity with java
Microservices and modularity with javaDPC Consulting Ltd
 
MicroProfile Panel - Sept 2016
MicroProfile Panel - Sept 2016MicroProfile Panel - Sept 2016
MicroProfile Panel - Sept 2016Ray Ploski
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019graemerocher
 
Building Big Architectures XP Conference 2016
Building Big Architectures XP Conference 2016Building Big Architectures XP Conference 2016
Building Big Architectures XP Conference 2016Ramit Surana
 
Bootstraping real world Jakarta EE/MicroProfile microservices with Maven Arch...
Bootstraping real world Jakarta EE/MicroProfile microservices with Maven Arch...Bootstraping real world Jakarta EE/MicroProfile microservices with Maven Arch...
Bootstraping real world Jakarta EE/MicroProfile microservices with Maven Arch...Víctor Leonel Orozco López
 
Secure JAX-RS
Secure JAX-RSSecure JAX-RS
Secure JAX-RSPayara
 
Effective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfileEffective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfilePayara
 
Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019graemerocher
 
Gradual migration to MicroProfile
Gradual migration to MicroProfileGradual migration to MicroProfile
Gradual migration to MicroProfileRudy De Busscher
 
Automate your development environment with Jira and Saltstack
Automate your development environment with Jira and SaltstackAutomate your development environment with Jira and Saltstack
Automate your development environment with Jira and SaltstackNetworkedAssets
 
Dnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforussoDnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforussoDotNetCampus
 
Monitor Micro-service with MicroProfile metrics
Monitor Micro-service with MicroProfile metricsMonitor Micro-service with MicroProfile metrics
Monitor Micro-service with MicroProfile metricsRudy De Busscher
 
容器革命的「利」與「必」
容器革命的「利」與「必」 容器革命的「利」與「必」
容器革命的「利」與「必」 inwin stack
 
Lagom : Reactive microservice framework
Lagom : Reactive microservice frameworkLagom : Reactive microservice framework
Lagom : Reactive microservice frameworkFabrice Sznajderman
 

Tendances (20)

Microservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problemsMicroservices - opportunities, dilemmas and problems
Microservices - opportunities, dilemmas and problems
 
Deploying WSO2 Middleware on Kubernetes
Deploying WSO2 Middleware on KubernetesDeploying WSO2 Middleware on Kubernetes
Deploying WSO2 Middleware on Kubernetes
 
Microservices and modularity with java
Microservices and modularity with javaMicroservices and modularity with java
Microservices and modularity with java
 
MicroProfile Panel - Sept 2016
MicroProfile Panel - Sept 2016MicroProfile Panel - Sept 2016
MicroProfile Panel - Sept 2016
 
Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019Introduction to Micronaut - JBCNConf 2019
Introduction to Micronaut - JBCNConf 2019
 
Javantura v4 - The power of cloud in professional services company - Ivan Krn...
Javantura v4 - The power of cloud in professional services company - Ivan Krn...Javantura v4 - The power of cloud in professional services company - Ivan Krn...
Javantura v4 - The power of cloud in professional services company - Ivan Krn...
 
Building Big Architectures XP Conference 2016
Building Big Architectures XP Conference 2016Building Big Architectures XP Conference 2016
Building Big Architectures XP Conference 2016
 
Bootstraping real world Jakarta EE/MicroProfile microservices with Maven Arch...
Bootstraping real world Jakarta EE/MicroProfile microservices with Maven Arch...Bootstraping real world Jakarta EE/MicroProfile microservices with Maven Arch...
Bootstraping real world Jakarta EE/MicroProfile microservices with Maven Arch...
 
Secure JAX-RS
Secure JAX-RSSecure JAX-RS
Secure JAX-RS
 
Effective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfileEffective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfile
 
Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019Micronaut Deep Dive - Codeone 2019
Micronaut Deep Dive - Codeone 2019
 
Docker+java
Docker+javaDocker+java
Docker+java
 
Gradual migration to MicroProfile
Gradual migration to MicroProfileGradual migration to MicroProfile
Gradual migration to MicroProfile
 
Automate your development environment with Jira and Saltstack
Automate your development environment with Jira and SaltstackAutomate your development environment with Jira and Saltstack
Automate your development environment with Jira and Saltstack
 
Dnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforussoDnc2015 azure-microservizi-vforusso
Dnc2015 azure-microservizi-vforusso
 
Monitor Micro-service with MicroProfile metrics
Monitor Micro-service with MicroProfile metricsMonitor Micro-service with MicroProfile metrics
Monitor Micro-service with MicroProfile metrics
 
Javantura v4 - Support SpringBoot application development lifecycle using Ora...
Javantura v4 - Support SpringBoot application development lifecycle using Ora...Javantura v4 - Support SpringBoot application development lifecycle using Ora...
Javantura v4 - Support SpringBoot application development lifecycle using Ora...
 
容器革命的「利」與「必」
容器革命的「利」與「必」 容器革命的「利」與「必」
容器革命的「利」與「必」
 
Lagom : Reactive microservice framework
Lagom : Reactive microservice frameworkLagom : Reactive microservice framework
Lagom : Reactive microservice framework
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 

En vedette

Presentation To The Sub Committee
Presentation To The Sub CommitteePresentation To The Sub Committee
Presentation To The Sub Committeejasonmeyers
 
What Is Branding?
What Is Branding?What Is Branding?
What Is Branding?bratram
 
Foundation Center Green IT Presentation Apr2010
Foundation Center Green IT Presentation Apr2010Foundation Center Green IT Presentation Apr2010
Foundation Center Green IT Presentation Apr2010guest1883a7
 
Cicles formatius 2011
Cicles formatius 2011Cicles formatius 2011
Cicles formatius 2011garrigatorres
 
Opp Pres Eng
Opp Pres EngOpp Pres Eng
Opp Pres Engpatamino
 
DDoS Saldırıları ve Benzetim Teknikleri
DDoS Saldırıları ve Benzetim TeknikleriDDoS Saldırıları ve Benzetim Teknikleri
DDoS Saldırıları ve Benzetim TeknikleriOğuzcan Pamuk
 

En vedette (8)

Policia canina
Policia caninaPolicia canina
Policia canina
 
Presentation To The Sub Committee
Presentation To The Sub CommitteePresentation To The Sub Committee
Presentation To The Sub Committee
 
What Is Branding?
What Is Branding?What Is Branding?
What Is Branding?
 
Foundation Center Green IT Presentation Apr2010
Foundation Center Green IT Presentation Apr2010Foundation Center Green IT Presentation Apr2010
Foundation Center Green IT Presentation Apr2010
 
Cicles formatius 2011
Cicles formatius 2011Cicles formatius 2011
Cicles formatius 2011
 
Opp Pres Eng
Opp Pres EngOpp Pres Eng
Opp Pres Eng
 
DDoS Saldırıları ve Benzetim Teknikleri
DDoS Saldırıları ve Benzetim TeknikleriDDoS Saldırıları ve Benzetim Teknikleri
DDoS Saldırıları ve Benzetim Teknikleri
 
Aitor h
Aitor hAitor h
Aitor h
 

Similaire à 2016_04_04_CNI_Spring_Meeting_Microservices

Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015aspyker
 
Netflix Container Scheduling and Execution - QCon New York 2016
Netflix Container Scheduling and Execution - QCon New York 2016Netflix Container Scheduling and Execution - QCon New York 2016
Netflix Container Scheduling and Execution - QCon New York 2016aspyker
 
Scheduling a fuller house - Talk at QCon NY 2016
Scheduling a fuller house - Talk at QCon NY 2016Scheduling a fuller house - Talk at QCon NY 2016
Scheduling a fuller house - Talk at QCon NY 2016Sharma Podila
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014Hojoong Kim
 
Microservices Architecture and Containers.
Microservices Architecture and Containers.Microservices Architecture and Containers.
Microservices Architecture and Containers.imjacobclark
 
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...Pôle Systematic Paris-Region
 
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...MongoDB
 
RedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases DistributedRedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases DistributedRedis Labs
 
Netflix and Containers: Not A Stranger Thing
Netflix and Containers:  Not A Stranger ThingNetflix and Containers:  Not A Stranger Thing
Netflix and Containers: Not A Stranger Thingaspyker
 
Netflix and Containers: Not Stranger Things
Netflix and Containers: Not Stranger ThingsNetflix and Containers: Not Stranger Things
Netflix and Containers: Not Stranger ThingsAll Things Open
 
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka Mario Ishara Fernando
 
NetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talksNetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talksRuslan Meshenberg
 
#RADC4L16: An API-First Archives Approach at NPR
#RADC4L16: An API-First Archives Approach at NPR#RADC4L16: An API-First Archives Approach at NPR
#RADC4L16: An API-First Archives Approach at NPRCamille Salas
 
OSOM Operations in the Cloud
OSOM Operations in the CloudOSOM Operations in the Cloud
OSOM Operations in the Cloudmstuparu
 
OSOM - Operations in the Cloud
OSOM - Operations in the CloudOSOM - Operations in the Cloud
OSOM - Operations in the CloudMarcela Oniga
 
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...Outlyer
 
Netflix Architecture and Open Source
Netflix Architecture and Open SourceNetflix Architecture and Open Source
Netflix Architecture and Open SourceAll Things Open
 

Similaire à 2016_04_04_CNI_Spring_Meeting_Microservices (20)

Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015Triangle Devops Meetup 10/2015
Triangle Devops Meetup 10/2015
 
Netflix Container Scheduling and Execution - QCon New York 2016
Netflix Container Scheduling and Execution - QCon New York 2016Netflix Container Scheduling and Execution - QCon New York 2016
Netflix Container Scheduling and Execution - QCon New York 2016
 
Scheduling a fuller house - Talk at QCon NY 2016
Scheduling a fuller house - Talk at QCon NY 2016Scheduling a fuller house - Talk at QCon NY 2016
Scheduling a fuller house - Talk at QCon NY 2016
 
Open shift and docker - october,2014
Open shift and docker - october,2014Open shift and docker - october,2014
Open shift and docker - october,2014
 
Microservices Architecture and Containers.
Microservices Architecture and Containers.Microservices Architecture and Containers.
Microservices Architecture and Containers.
 
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
Building a high-performance, scalable ML & NLP platform with Python, Sheer El...
 
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...
MongoDB Days UK: Using MongoDB to Build a Fast and Scalable Content Repositor...
 
RedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases DistributedRedisConf17 - Dynomite - Making Non-distributed Databases Distributed
RedisConf17 - Dynomite - Making Non-distributed Databases Distributed
 
Netflix and Containers: Not A Stranger Thing
Netflix and Containers:  Not A Stranger ThingNetflix and Containers:  Not A Stranger Thing
Netflix and Containers: Not A Stranger Thing
 
Netflix and Containers: Not Stranger Things
Netflix and Containers: Not Stranger ThingsNetflix and Containers: Not Stranger Things
Netflix and Containers: Not Stranger Things
 
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
Microservices , Docker , CI/CD , Kubernetes Seminar - Sri Lanka
 
NetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talksNetflixOSS Open House Lightning talks
NetflixOSS Open House Lightning talks
 
#RADC4L16: An API-First Archives Approach at NPR
#RADC4L16: An API-First Archives Approach at NPR#RADC4L16: An API-First Archives Approach at NPR
#RADC4L16: An API-First Archives Approach at NPR
 
Red Hat Storage Roadmap
Red Hat Storage RoadmapRed Hat Storage Roadmap
Red Hat Storage Roadmap
 
Red Hat Storage Roadmap
Red Hat Storage RoadmapRed Hat Storage Roadmap
Red Hat Storage Roadmap
 
OSOM Operations in the Cloud
OSOM Operations in the CloudOSOM Operations in the Cloud
OSOM Operations in the Cloud
 
OSOM - Operations in the Cloud
OSOM - Operations in the CloudOSOM - Operations in the Cloud
OSOM - Operations in the Cloud
 
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...
Owain Perry (Just Giving) - Continuous Delivery of Windows Micro-Services in ...
 
Netflix Architecture and Open Source
Netflix Architecture and Open SourceNetflix Architecture and Open Source
Netflix Architecture and Open Source
 
56k.cloud training
56k.cloud training56k.cloud training
56k.cloud training
 

2016_04_04_CNI_Spring_Meeting_Microservices

  • 1. Microservices Architecture: Building Scalable (Library) Software Solutions CNI Spring 2016 Membership Meeting, San Antonio, TX Jason Varghese (New York Public Library) @jsonlibrary
  • 2. Microservices ● Buzzword compliant ● Not a microservices “sales” talk ● Explore microservice principles ● Explore Use Cases/Examples
  • 3. Microservices ● For web scale only? ● Libraries => Web Scale ● Libraries => Technology Leaders ● Allows for increased pace of innovation Observe Decide OrientAct
  • 4. ● Sometimes referred to as “monoliths” ● Can follow best practices in regards to architecture ● Applications packaged and deployed as single artifact or directory hierarchy Traditional Web Applications Server JVM Tomcat/Container Java webapp (.war file) UI (server-side) war file Circulation Cataloging Recommendation
  • 5. Releasing/versioning monolithic applications UI Domain Persistence UI Domain Persistence UI Domain Persistence v1.0 v1.1 v1.2
  • 6. ● Horizontal Scaling ● Vertical Scaling ● Sharding Scaling Traditional Web Applications Load Balancer Instance #1 Instance #2 Instance #N
  • 7. ● Difficult to maintain and release over time ● Dependency management issues ● “Wholesale” scaling of apps. ● Upfront technology stack decision (lock-in). “Limitations” of monoliths
  • 8. Scaling by Functional Decomposition http://akfpartners.com/techblog/2008/05/08/splitting-applications-or-services-for-scale/
  • 9. Microservices doesn’t solve everything ● Microservices are not a silver bullet ● “Microservices - not a free lunch” ● “If you can't build a monolith, what makes you think microservices are the answer?” http://highscalability.com/blog/2014/4/8/microservices-not-a-free-lunch.html http://www.codingthearchitecture.com/2014/07/06/distributed_big_balls_of_mud.html
  • 11. Road to microservices ● Domain Driven Design ● Bounded Context
  • 12. Road to microservices ● Virtualization ● IaaS ● Containerization ● Devops Practice ● PaaS
  • 13. Road to microservices - Pre VM ● Long lead time to stand up new server ● Special snowflake servers ○ ie. diglibdev1, diglibqa1, diglibprod1, diglibprod2, diglibprod3 ● Inconsistent environments ● Package artifact and throw over wall ● Pack everything onto single machine ● But it works on my laptop! http://blog.codinghorror.com/the-works-on-my-machine-certification-program/ Server OS App App App
  • 14. Road to microservices - Virtualization ● Virtualization ● Multiple VMs per machine ● VMs still require resources ● IaaS (AWS) ● Cloud based VM’s ● Rapid elasticity Server Host OS Hypervisor Guest OS App VM Guest OS App VM Cloud VM (EC2)
  • 15. Road to microservices - Containers ● More lightweight than VMs ● No guest OS ● Docker ● Docker Hub Server Host OS Kernel Container App Container App
  • 16. Road to microservice - Devops ● Devops is about organization culture ● Devops != {‘Chef’ || ‘Puppet’ || ‘Ansible’} ● Automation ● Getting things done ● Turn around time is minutes/days not weeks/months ● PaaS
  • 17. Enter Microservices ● “An application architectural style for creating a set of loosely coupled services each with a bounded context” UI (server-side) war file Circulation Cataloging Recommendation UI Circulation Cataloging Recommendation
  • 18. Advantages of microservices ● Allows organizations to evaluate and experiment with new technologies ● Fine grain scaling resulting in more efficient use of resources ● Faster/less risky incremental releases ● Break down complex application and problem spaces
  • 19. Properties of Microservices ● Bounded context ● Encapsulate implementation details ● One datastore per microservice/no integration database across services ● Loosely coupled ● Clear external interfaces ● Centered around product teams ● Products vs. Projects Cataloging Postgres Recommendation MongoDB
  • 20. Complexities ● Distributed Systems ● CAP Theorem ○ Eventually Consistent Systems
  • 21. But what about SOA? ● Best of SOA Principles ● SOA 2.0 ● Less emphasis on middleware (ESB, etc) ● Smart endpoints, dump pipes ● Beware of microservice-enabled middleware, “micro-service product”
  • 22. Refactoring/Integrating with existing apps ● Strategies for dealing with legacy/3rd party applications ● Case study Drupal 6 Drupal 7
  • 23. Refactoring/Integrating with existing apps ● Migrated D6--->D7 instance ● “Locations” experiment Drupal 7 Locations API AngularJS nypl.org/locations nypl.org/* routing (RP)
  • 24. Refactoring/Integrating with existing apps ● Iterate and expand on architecture Drupal 7 Refinery API nypl.org/locations nypl.org/staff-picks nypl.org/staff-profilesReactJS ReactJS ReactJS AngularJS routing (RP) nypl.org/* JSON file refactor as needed
  • 25. Best practices/Emerging Trends ● Providing CMS content as service is appearing to be a best practice ● Building Microservice book describes “CMS as a Service” ● Drupal 8 describes “Content as a Service” https://www.drupal.com/feature/content-as-a-service
  • 26. Refactoring/Integrating with existing apps Drupal 7 nypl.org/locations nypl.org/staff-picks nypl.org/staff-profilesReactJS ReactJS ReactJS AngularJS routing (RP) nypl.org/* JSON file refactor as needed New D7 Refinery API
  • 27. Refactoring/Integrating with existing apps Drupal 7 nypl.org/locations nypl.org/staff-picks nypl.org/staff-profilesReactJS ReactJS ReactJS AngularJS routing (RP) nypl.org/* JSON file New D7 Refinery API nypl.org/new-arrivalsReactJSInventory-Svc ILS!!!
  • 28. Refactoring/Integrating with existing apps Drupal 7 nypl.org/locations nypl.org/staff-picks nypl.org/staff-profilesReactJS ReactJS ReactJS AngularJS routing (RP) nypl.org/* JSON file New D7 Refinery API nypl.org/new-arrivalsReactJSInventory-Svc ILS!!! nypl.org/betasearchGoogle Custom Search Search-Svc Front end D7
  • 29. Inventory Service - closer look Spring Boot microservice ILS Solr Workers RabbitMQ REST/HTTP AMQP HTTP HTTP ReactJS JDBC REST/HTTP Redis
  • 30. Microservices for complex workflow ● Orchestration ● Choreography ● NYPL A/V ingest use case ○ Have an idea of end state ○ current state and workflows unclear ○ Spreadsheets ○ “Parking lot” storage (backlog > 600+TB) ○ Bag created as result of current process ● Initial known steps ○ Watch for file/bag ○ Create entry in metadata system ○ Transcode the video ○ Place preservation master in Isilon storage
  • 31. Audio/Video Ingest ● Not service based ● Ingest Script watchForFile() createRecord() uploadToS3() moveToIsilon() new file ingest.rb
  • 32. Audio/Video Ingest ● Make it service based ● Orchestrated Approach Example Ingester/ Filewatcher Create Metadata Entry S3 Uploader/ Elastic Transcode Isilon Pusher new file
  • 33. Audio/Video Ingest ● Choreographed Approach Example ● Polyglot services FileWatcher (IngestMaster) Create Metadata Entry S3 Uploader/ Elastic Transcoder IsilonPusher new file Message Broker
  • 34. Audio/Video Ingest ● Scale out services as needed ● Scale across multiple hosts FileWatcher (IngestMaster) Create Metadata Entry IsilonPusher new file Message Broker S S3 Uploader/ Elastic Transcoder IsilonPusherIsilonPusher FileWatcher (IngestMaster) FileWatcher (IngestMaster)
  • 35. Audio/Video Ingest ● Modify and extend FileWatcher (IngestMaster) Modified Metadata Entry IsilonPusher new file Message Broker S S3 Uploader/ Elastic Transcoder IsilonPusherIsilonPusher FileWatcher (IngestMaster) FileWatcher (IngestMaster) Future New Step
  • 36. A/V ingest workflow ● Tracking status ● Use Correlation ids (uuid-based) ● View status in log aggregation tool
  • 37. Deployment Strategies ● Multiple services per host ● Definition of host ● Service per host ● Docker/Kubernetes Svc Svc Svc Svc SvcSvc Svc
  • 38. Microservice Requirements ● Automation ○ Provisioning ○ Automated testing ○ CI/CD ○ Rollback ● Monitoring ○ APM ○ Log aggregation ○ Checkpoints (queue-in, queue-out) ○ Correlation IDs ● Service Discovery ● Design for Failure ○ Any node can go down ○ Network failure ○ Degrade functionality without taking down system
  • 39. Security ● OAuth2.0 ● Parties ○ Resource Owner ○ Resource Server ○ Client ○ Authorization Server (can be same as resource server sometimes) ● Authorization Grant Types ○ Authorization Code ○ Client Credentials ○ Implicit Resource Owner ○ Password Credentials ● Open ID Connect ○ Open ID providers ○ Relying Party ● JSON Web Tokens (JWT)
  • 40. Testing ● Integration Environments ● End to End tests? Svc - dev Svc - prod Dep Svc - dev Dep Svc - prod ? UI - dev UI - prod Svc - dev Google API (prod) UI - dev