SlideShare una empresa de Scribd logo
1 de 54
Shaun Abram
Shaun Abram
RESTful Microservices
October 3rd, 2015
Shaun Abram 2
Startup: widgets.com
Monolith
Deployed as a single artifact
Scaled by replicating monolith
on multiple servers
Single codebase
Adapted from http://martinfowler.com/articles/microservices.html
Shaun Abram 4
Monoliths
Great.
Until they’re not.
+Tangled Dependencies…
Shaun Abram 6
monoliths force everyone
into the same decisions
Shaun Abram 7
What is a microservice?
Small
Focused
Independent
Monolith
Deployed as a single artifact
Scaled by replicating monolith
on multiple servers
All functionality in
a single process
Microservices
Deployed independentlyEach functional element
as a separate service
Scaled by replicating only as needed
Java
Scala
Groovy
v11 v3
v1
+ resilient
Shaun Abram 9
Microservices - Not a new concept!
Unix Philosophy
 develop small, capable software
 Do one thing well
 Play well with other programs
 Use standard interfaces
Shaun Abram 10
Disadvantages of microservices
Monolith Microservice
Operational complexity
 Deployment, monitoring & problem detection
Shaun Abram 11
Disadvantages of microservices
Monolith Microservice
Refactoring across service boundaries
Shaun Abram 12
Disadvantages of microservices
Monolith Microservice
Interface changes are hard
May require versioning…
Shaun Abram 13
Disadvantages of microservices
Monolith Microservice
Distributed architectures are hard!
Shaun Abram 15
Microservices: better practices
 Separate codebases
 Use monitoring
 Built in health checks
 Provide standard templates
 Security…
 Versioning…
Shaun Abram 16
Microservice Security
 Secure Perimeter
 HTTP(S) Basic Authentication
 Client Certificates
 HMAC
 And beyond…
Shaun Abram 17
Microservices Versioning
Backwards compatibility
Tolerant Reader and Postel's Law
Consumer-driven contracts
Semantic Versioning
Co-existing endpoints…
Shaun Abram 18
Microservice versioning: coexisting endpoints
Shaun Abram 19
Microservice versioning: coexisting endpoints
Shaun Abram 20
Microservice versioning: coexisting endpoints
Shaun Abram 21
Microservice versioning: coexisting endpoints
An example of “expand and contract”
Shaun Abram 22
Microservices Versioning
Backwards compatibility
Tolerant Reader and Postel's Law
Consumer-driven contracts
Semantic Versioning
Co-existing endpoints
Co-existing servers…
Shaun Abram 23
Microservice versioning: coexisting servers
- Duplicated code & fixes
- Directing to the right service
- Data versioning?
+ Blue Green Deployments
Shaun Abram 24
Microservices or Monoliths?
Start with monoliths; Migrate slowly
Shaun Abram 25
REST
Representational State Transfer
Shaun Abram 26
A brief History of the WWW
HTTP URI HTML
Shaun Abram 27
REST: Lessons learned
Roy Fielding
packaged the lessons learned
Architectural Styles and the Design of Network-based Software Architectures
REST
Shaun Abram 28
REST
So, what is REST
Well…
Theoretical vs Practical
Shaun Abram 29
REST Constraints
A set of constraints. Typically with Http.
Shaun Abram 30
REST Constraints
A set of constraints. Typically with Http.
1. Client Server
Shaun Abram 31
REST Constraints
1. Client Server
2. Stateless
Shaun Abram 32
REST Constraints
1. Client Server
2. Stateless
3. Cache
Shaun Abram 33
REST Constraints
1. Client Server
2. Stateless
3. Cache
4. Uniform Interface
Shaun Abram 34
REST Constraints
1. Client Server
2. Stateless
3. Cache
4. Uniform Interface
5. Code-On-Demand
Shaun Abram 35
REST Constraints
1. Client Server
2. Stateless
3. Cache
4. Uniform Interface
5. Code-On-Demand
6. Layered System
Shaun Abram 42
REST
So, what is REST, really?
Shaun Abram 43
REST
Resources
Uniform interfaces
Standard methods
Shaun Abram 44
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-
envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-
encoding">
<soap:Header>
<m:Trans xmlns:m="http://www.w3.com/transaction/"
soap:mustUnderstand="1">234
</m:Trans>
</soap:Header>
<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPrice>
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>
</soap:Envelope>
Shaun Abram 45
myservice.com/customers/33245
Shaun Abram 46
HTTP Request
GET
myservice.com/customers/33245
HTTP/1.1
Host: www.example.com
Shaun Abram 47
Is it “RESTful” enough?
Richardson Maturity Model
 Level 0 – Http tunnelling, POX, SOAP
 e.g. all requests to myhospital.com
 Level 1 – Resources
 e.g. requests to hospital.com/drs/sabram
 Level 2 - HTTP Verbs
 GET hospital.com/drs/sabram/slots
 Level 3 - Hypermedia Controls
Shaun Abram 48
Is it RESTful enough?
Shaun Abram 49
HTTP
Idempotent
Shaun Abram 51
HTTP Methods
Common
 GET
 DELETE
 PUT
 POST
Uncommon
 HEAD
 OPTIONS
 TRACE
 CONNECT
 PATCH
Shaun Abram 52
Rules of thumb
 POST
 Create with the server deciding on the URI
 PUT
 Update a resource
 Store the supplied entity under the supplied URI
– If exists, update; else create with that URI
 PATCH
 Partial updates
Use you best judgment – or your corp standards!
Shaun Abram 53
Uncommon HTTP Methods
 HEAD
 Like GET but without the body
 Used for obtaining meta-information about the entity
 Useful for testing links, e.g. for validity, accessibility
 OPTIONS
 Request about the capabilities of a server
 e.g. request a list of supported HTTP methods
 Possible response:
200 OK; Allow: HEAD,GET,PUT,DELETE
 Useful but not widely supported
Shaun Abram 54
Uncommon HTTP Methods
 TRACE
 Used to invoke a remote loop-back of the request
 Plain English: Echoes back request to see what
changes have been made by intermediate servers
 Often disabled for security
 CONNECT
 For use with a proxy that can dynamically switch to
being a tunnel
 Typically for tunneling HTTPS through HTTP
connection
Shaun Abram 55
HTTP response codes
Code Meaning Plain English
(From user
perspective)
1xx Informational; indicates a
provisional response,
e.g. 100
OK so far and client
should continue with the
request
2xx Successful All good
3xx Redirection Something moved
4xx Client Error You messed up
5xx Server Error We messed up
Shaun Abram 56
Hypermedia as the engine of application state (HATEOAS)
What is Hypermedia?
 URI and URL
 Hypertext
 Multimedia
 Hypermedia
Shaun Abram 57
Hypermedia as the engine of application state (HATEOAS)
Clients know fixed entry points to the app
Transition (states) by using those links + more
If you think of Hypermedia as simply links, then HATEOAS
is simply using the links you discover to navigate (or
transition state) through the application.
Applies to human or software users
Shaun Abram 58
Hypermedia as the engine of application state (HATEOAS)
Example
Hypermedia controls used on an album listing
<album>
<name>Give Blood</name>
<link rel="/artist" href="/artist/theBrakes" />
<description>
Awesome, short, brutish, funny and loud. Must buy!
</description>
<link rel="/instantpurchase" href="/instantPurchase/1234" />
</album>
Shaun Abram 59
Wrapping up Microservices & REST
Microservices:
 A small, focused, loosely coupled service
 Can be developed, deployed, upgraded
independently
How to communicate with and between
Microservices?
REST & HTTP!
REST:
 Proven architectural style inspired by www
 Resources accessed via uniform interfaces and
HTTP
Privileged and Confidential 60
Recommended reading
Domain Driven Design
Freeman & Pryce
Building Microservices
Sam Newman
REST in Practice
Webber, Parastatidis, Robinson
Privileged and Confidential 61
Recommended reading
Microservices: http://martinfowler.com/articles/microservices.html
Architectural Styles and the Design of Network-based Software
https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
Http API Design: https://github.com/interagent/http-api-design
ParallelChange (aka expand and contract):
http://martinfowler.com/bliki/ParallelChange.html
Blue-Green Deployment: http://docs.pivotal.io/pivotalcf/devguide/deploy-
apps/blue-green.html
Richardson Maturity Model:
http://martinfowler.com/articles/richardsonMaturityModel.html
Shaun Abram
RESTful Microservices
Questions?

Más contenido relacionado

La actualidad más candente

Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and WhenPaul Gower
 
How to become a testing expert
How to become a testing expertHow to become a testing expert
How to become a testing expertgaoliang641
 
How to improve code quality for iOS apps?
How to improve code quality for iOS apps?How to improve code quality for iOS apps?
How to improve code quality for iOS apps?Kate Semizhon
 
Rapid software testing and conformance with static code analysis
Rapid software testing and conformance with static code analysisRapid software testing and conformance with static code analysis
Rapid software testing and conformance with static code analysisRogue Wave Software
 
Code Review
Code ReviewCode Review
Code ReviewDivante
 
Seeding a Tree in a Gherkin
Seeding a Tree in a GherkinSeeding a Tree in a Gherkin
Seeding a Tree in a GherkinPaul Rohorzka
 
Code Review
Code ReviewCode Review
Code Reviewrantav
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiFlorent Batard
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentShawn Jones
 
Testing Superpowers: Using CLion to Add Tests Easily
Testing Superpowers: Using CLion to Add Tests EasilyTesting Superpowers: Using CLion to Add Tests Easily
Testing Superpowers: Using CLion to Add Tests EasilyClare Macrae
 
Quickly and Effectively Testing Legacy c++ Code with Approval Tests mu cpp
Quickly and Effectively Testing Legacy c++ Code with Approval Tests   mu cppQuickly and Effectively Testing Legacy c++ Code with Approval Tests   mu cpp
Quickly and Effectively Testing Legacy c++ Code with Approval Tests mu cppClare Macrae
 
Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and WhenPaul Gower
 
Top 10 static code analysis tool
Top 10 static code analysis toolTop 10 static code analysis tool
Top 10 static code analysis toolscmGalaxy Inc
 
Java Code Review Checklist
Java Code Review ChecklistJava Code Review Checklist
Java Code Review ChecklistMahesh Chopker
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven DevelopmentPablo Villar
 

La actualidad más candente (18)

Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and When
 
How to become a testing expert
How to become a testing expertHow to become a testing expert
How to become a testing expert
 
How to improve code quality for iOS apps?
How to improve code quality for iOS apps?How to improve code quality for iOS apps?
How to improve code quality for iOS apps?
 
PHPUnit - Unit testing
PHPUnit - Unit testingPHPUnit - Unit testing
PHPUnit - Unit testing
 
Rapid software testing and conformance with static code analysis
Rapid software testing and conformance with static code analysisRapid software testing and conformance with static code analysis
Rapid software testing and conformance with static code analysis
 
Code Review
Code ReviewCode Review
Code Review
 
Code Review
Code ReviewCode Review
Code Review
 
Seeding a Tree in a Gherkin
Seeding a Tree in a GherkinSeeding a Tree in a Gherkin
Seeding a Tree in a Gherkin
 
Code Review
Code ReviewCode Review
Code Review
 
Codeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansaiCodeception Testing Framework -- English #phpkansai
Codeception Testing Framework -- English #phpkansai
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven Development
 
Testing Superpowers: Using CLion to Add Tests Easily
Testing Superpowers: Using CLion to Add Tests EasilyTesting Superpowers: Using CLion to Add Tests Easily
Testing Superpowers: Using CLion to Add Tests Easily
 
Robot framework
Robot frameworkRobot framework
Robot framework
 
Quickly and Effectively Testing Legacy c++ Code with Approval Tests mu cpp
Quickly and Effectively Testing Legacy c++ Code with Approval Tests   mu cppQuickly and Effectively Testing Legacy c++ Code with Approval Tests   mu cpp
Quickly and Effectively Testing Legacy c++ Code with Approval Tests mu cpp
 
Code Review: How and When
Code Review: How and WhenCode Review: How and When
Code Review: How and When
 
Top 10 static code analysis tool
Top 10 static code analysis toolTop 10 static code analysis tool
Top 10 static code analysis tool
 
Java Code Review Checklist
Java Code Review ChecklistJava Code Review Checklist
Java Code Review Checklist
 
iOS Test-Driven Development
iOS Test-Driven DevelopmentiOS Test-Driven Development
iOS Test-Driven Development
 

Destacado

REST and Microservices
REST and MicroservicesREST and Microservices
REST and MicroservicesShaun Abram
 
Unit testing - the hard parts
Unit testing - the hard partsUnit testing - the hard parts
Unit testing - the hard partsShaun Abram
 
Beyond Software Craftsmanship - Johnny's Road to Remarkable Career
Beyond Software Craftsmanship - Johnny's Road to Remarkable CareerBeyond Software Craftsmanship - Johnny's Road to Remarkable Career
Beyond Software Craftsmanship - Johnny's Road to Remarkable CareerEduards Sizovs
 
Java micro-services
Java micro-servicesJava micro-services
Java micro-servicesJames Lewis
 
Productivity Tips for Java EE and Spring Developers
 Productivity Tips for Java EE and Spring Developers Productivity Tips for Java EE and Spring Developers
Productivity Tips for Java EE and Spring DevelopersSimon Maple
 
J2EE Technology Mapping-21-may-2014
J2EE Technology Mapping-21-may-2014J2EE Technology Mapping-21-may-2014
J2EE Technology Mapping-21-may-2014Nguyen Tung
 
5 normal forms in relational database theory
5 normal forms in relational database theory5 normal forms in relational database theory
5 normal forms in relational database theoryPankamol Srikaew
 
The Hardest Part of Microservices: Your Data - Christian Posta, Red Hat
The Hardest Part of Microservices: Your Data - Christian Posta, Red HatThe Hardest Part of Microservices: Your Data - Christian Posta, Red Hat
The Hardest Part of Microservices: Your Data - Christian Posta, Red HatAmbassador Labs
 
Batch file programming
Batch file programmingBatch file programming
Batch file programmingalan moreno
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice ArchitectureNguyen Tung
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service ArchitectureEduards Sizovs
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitecturePaul Mooney
 
Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocitySam Newman
 

Destacado (14)

REST and Microservices
REST and MicroservicesREST and Microservices
REST and Microservices
 
Unit testing - the hard parts
Unit testing - the hard partsUnit testing - the hard parts
Unit testing - the hard parts
 
Beyond Software Craftsmanship - Johnny's Road to Remarkable Career
Beyond Software Craftsmanship - Johnny's Road to Remarkable CareerBeyond Software Craftsmanship - Johnny's Road to Remarkable Career
Beyond Software Craftsmanship - Johnny's Road to Remarkable Career
 
Java micro-services
Java micro-servicesJava micro-services
Java micro-services
 
Productivity Tips for Java EE and Spring Developers
 Productivity Tips for Java EE and Spring Developers Productivity Tips for Java EE and Spring Developers
Productivity Tips for Java EE and Spring Developers
 
J2EE Technology Mapping-21-may-2014
J2EE Technology Mapping-21-may-2014J2EE Technology Mapping-21-may-2014
J2EE Technology Mapping-21-may-2014
 
5 normal forms in relational database theory
5 normal forms in relational database theory5 normal forms in relational database theory
5 normal forms in relational database theory
 
The Hardest Part of Microservices: Your Data - Christian Posta, Red Hat
The Hardest Part of Microservices: Your Data - Christian Posta, Red HatThe Hardest Part of Microservices: Your Data - Christian Posta, Red Hat
The Hardest Part of Microservices: Your Data - Christian Posta, Red Hat
 
Batch file programming
Batch file programmingBatch file programming
Batch file programming
 
Batch
BatchBatch
Batch
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service Architecture
 
Microservice vs. Monolithic Architecture
Microservice vs. Monolithic ArchitectureMicroservice vs. Monolithic Architecture
Microservice vs. Monolithic Architecture
 
Principles of microservices velocity
Principles of microservices   velocityPrinciples of microservices   velocity
Principles of microservices velocity
 

Similar a RESTful Microservices

Rest and Microservices at the Las Vegas Dot Net Group
Rest and Microservices at the Las Vegas Dot Net GroupRest and Microservices at the Las Vegas Dot Net Group
Rest and Microservices at the Las Vegas Dot Net GroupShaun Abram
 
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Session on Selenium 4 : What’s coming our way? by Hitesh PrajapatiSession on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Session on Selenium 4 : What’s coming our way? by Hitesh PrajapatiAgile Testing Alliance
 
Selenium 4 - What's coming our way - v1.0.pptx
Selenium 4 - What's coming our way - v1.0.pptxSelenium 4 - What's coming our way - v1.0.pptx
Selenium 4 - What's coming our way - v1.0.pptxHitesh Prajapati
 
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)Yunong Xiao
 
Starting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for OpsStarting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for OpsDynatrace
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...Amazon Web Services
 
Securing Servers in Public and Hybrid Clouds
Securing Servers in Public and Hybrid CloudsSecuring Servers in Public and Hybrid Clouds
Securing Servers in Public and Hybrid CloudsRightScale
 
VAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxVAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxkarthikvcyber
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Rick Hightower
 
20141210 - Microservice Container
20141210 - Microservice Container20141210 - Microservice Container
20141210 - Microservice ContainerJamie (Taka) Wang
 
Load runner 8.0
Load runner 8.0Load runner 8.0
Load runner 8.0medsherb
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsFederico Michele Facca
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsRonny López
 
LoadRunner Performance Testing
LoadRunner Performance TestingLoadRunner Performance Testing
LoadRunner Performance TestingAtul Pant
 
Move fast and make things with microservices
Move fast and make things with microservicesMove fast and make things with microservices
Move fast and make things with microservicesMithun Arunan
 
Microservices and docker
Microservices and dockerMicroservices and docker
Microservices and dockerAlex Ivy
 
Tef con2016 (1)
Tef con2016 (1)Tef con2016 (1)
Tef con2016 (1)ggarber
 
Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesSteve Speicher
 
Devoxx university - Kafka de haut en bas
Devoxx university - Kafka de haut en basDevoxx university - Kafka de haut en bas
Devoxx university - Kafka de haut en basFlorent Ramiere
 

Similar a RESTful Microservices (20)

Rest and Microservices at the Las Vegas Dot Net Group
Rest and Microservices at the Las Vegas Dot Net GroupRest and Microservices at the Las Vegas Dot Net Group
Rest and Microservices at the Las Vegas Dot Net Group
 
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Session on Selenium 4 : What’s coming our way? by Hitesh PrajapatiSession on Selenium 4 : What’s coming our way? by Hitesh Prajapati
Session on Selenium 4 : What’s coming our way? by Hitesh Prajapati
 
Selenium 4 - What's coming our way - v1.0.pptx
Selenium 4 - What's coming our way - v1.0.pptxSelenium 4 - What's coming our way - v1.0.pptx
Selenium 4 - What's coming our way - v1.0.pptx
 
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)
The Paved PaaS to Microservices at Netflix (IAS2017 Nanjing)
 
Starting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for OpsStarting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for Ops
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
Securing Servers in Public and Hybrid Clouds
Securing Servers in Public and Hybrid CloudsSecuring Servers in Public and Hybrid Clouds
Securing Servers in Public and Hybrid Clouds
 
VAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptxVAPT_FINAL SLIDES.pptx
VAPT_FINAL SLIDES.pptx
 
Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)Service Mesh CTO Forum (Draft 3)
Service Mesh CTO Forum (Draft 3)
 
20141210 - Microservice Container
20141210 - Microservice Container20141210 - Microservice Container
20141210 - Microservice Container
 
Load runner 8.0
Load runner 8.0Load runner 8.0
Load runner 8.0
 
Docker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platformsDocker Swarm secrets for creating great FIWARE platforms
Docker Swarm secrets for creating great FIWARE platforms
 
Adding Real-time Features to PHP Applications
Adding Real-time Features to PHP ApplicationsAdding Real-time Features to PHP Applications
Adding Real-time Features to PHP Applications
 
LoadRunner Performance Testing
LoadRunner Performance TestingLoadRunner Performance Testing
LoadRunner Performance Testing
 
Move fast and make things with microservices
Move fast and make things with microservicesMove fast and make things with microservices
Move fast and make things with microservices
 
Rudder 3.0 and beyond
Rudder 3.0 and beyondRudder 3.0 and beyond
Rudder 3.0 and beyond
 
Microservices and docker
Microservices and dockerMicroservices and docker
Microservices and docker
 
Tef con2016 (1)
Tef con2016 (1)Tef con2016 (1)
Tef con2016 (1)
 
Innovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open InterfacesInnovate2014 Better Integrations Through Open Interfaces
Innovate2014 Better Integrations Through Open Interfaces
 
Devoxx university - Kafka de haut en bas
Devoxx university - Kafka de haut en basDevoxx university - Kafka de haut en bas
Devoxx university - Kafka de haut en bas
 

Último

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfVishalKumarJha10
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxalwaysnagaraju26
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedDelhi Call girls
 

Último (20)

introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptxBUS PASS MANGEMENT SYSTEM USING PHP.pptx
BUS PASS MANGEMENT SYSTEM USING PHP.pptx
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verifiedSector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
Sector 18, Noida Call girls :8448380779 Model Escorts | 100% verified
 

RESTful Microservices

  • 1. Shaun Abram Shaun Abram RESTful Microservices October 3rd, 2015
  • 3. Monolith Deployed as a single artifact Scaled by replicating monolith on multiple servers Single codebase Adapted from http://martinfowler.com/articles/microservices.html
  • 6. Shaun Abram 6 monoliths force everyone into the same decisions
  • 7. Shaun Abram 7 What is a microservice? Small Focused Independent
  • 8. Monolith Deployed as a single artifact Scaled by replicating monolith on multiple servers All functionality in a single process Microservices Deployed independentlyEach functional element as a separate service Scaled by replicating only as needed Java Scala Groovy v11 v3 v1 + resilient
  • 9. Shaun Abram 9 Microservices - Not a new concept! Unix Philosophy  develop small, capable software  Do one thing well  Play well with other programs  Use standard interfaces
  • 10. Shaun Abram 10 Disadvantages of microservices Monolith Microservice Operational complexity  Deployment, monitoring & problem detection
  • 11. Shaun Abram 11 Disadvantages of microservices Monolith Microservice Refactoring across service boundaries
  • 12. Shaun Abram 12 Disadvantages of microservices Monolith Microservice Interface changes are hard May require versioning…
  • 13. Shaun Abram 13 Disadvantages of microservices Monolith Microservice Distributed architectures are hard!
  • 14. Shaun Abram 15 Microservices: better practices  Separate codebases  Use monitoring  Built in health checks  Provide standard templates  Security…  Versioning…
  • 15. Shaun Abram 16 Microservice Security  Secure Perimeter  HTTP(S) Basic Authentication  Client Certificates  HMAC  And beyond…
  • 16. Shaun Abram 17 Microservices Versioning Backwards compatibility Tolerant Reader and Postel's Law Consumer-driven contracts Semantic Versioning Co-existing endpoints…
  • 17. Shaun Abram 18 Microservice versioning: coexisting endpoints
  • 18. Shaun Abram 19 Microservice versioning: coexisting endpoints
  • 19. Shaun Abram 20 Microservice versioning: coexisting endpoints
  • 20. Shaun Abram 21 Microservice versioning: coexisting endpoints An example of “expand and contract”
  • 21. Shaun Abram 22 Microservices Versioning Backwards compatibility Tolerant Reader and Postel's Law Consumer-driven contracts Semantic Versioning Co-existing endpoints Co-existing servers…
  • 22. Shaun Abram 23 Microservice versioning: coexisting servers - Duplicated code & fixes - Directing to the right service - Data versioning? + Blue Green Deployments
  • 23. Shaun Abram 24 Microservices or Monoliths? Start with monoliths; Migrate slowly
  • 25. Shaun Abram 26 A brief History of the WWW HTTP URI HTML
  • 26. Shaun Abram 27 REST: Lessons learned Roy Fielding packaged the lessons learned Architectural Styles and the Design of Network-based Software Architectures REST
  • 27. Shaun Abram 28 REST So, what is REST Well… Theoretical vs Practical
  • 28. Shaun Abram 29 REST Constraints A set of constraints. Typically with Http.
  • 29. Shaun Abram 30 REST Constraints A set of constraints. Typically with Http. 1. Client Server
  • 30. Shaun Abram 31 REST Constraints 1. Client Server 2. Stateless
  • 31. Shaun Abram 32 REST Constraints 1. Client Server 2. Stateless 3. Cache
  • 32. Shaun Abram 33 REST Constraints 1. Client Server 2. Stateless 3. Cache 4. Uniform Interface
  • 33. Shaun Abram 34 REST Constraints 1. Client Server 2. Stateless 3. Cache 4. Uniform Interface 5. Code-On-Demand
  • 34. Shaun Abram 35 REST Constraints 1. Client Server 2. Stateless 3. Cache 4. Uniform Interface 5. Code-On-Demand 6. Layered System
  • 35. Shaun Abram 42 REST So, what is REST, really?
  • 36. Shaun Abram 43 REST Resources Uniform interfaces Standard methods
  • 37. Shaun Abram 44 <soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soap- envelope" soap:encodingStyle="http://www.w3.org/2001/12/soap- encoding"> <soap:Header> <m:Trans xmlns:m="http://www.w3.com/transaction/" soap:mustUnderstand="1">234 </m:Trans> </soap:Header> <soap:Body xmlns:m="http://www.example.org/stock"> <m:GetStockPrice> <m:StockName>IBM</m:StockName> </m:GetStockPrice> </soap:Body> </soap:Envelope>
  • 39. Shaun Abram 46 HTTP Request GET myservice.com/customers/33245 HTTP/1.1 Host: www.example.com
  • 40. Shaun Abram 47 Is it “RESTful” enough? Richardson Maturity Model  Level 0 – Http tunnelling, POX, SOAP  e.g. all requests to myhospital.com  Level 1 – Resources  e.g. requests to hospital.com/drs/sabram  Level 2 - HTTP Verbs  GET hospital.com/drs/sabram/slots  Level 3 - Hypermedia Controls
  • 41. Shaun Abram 48 Is it RESTful enough?
  • 43. Shaun Abram 51 HTTP Methods Common  GET  DELETE  PUT  POST Uncommon  HEAD  OPTIONS  TRACE  CONNECT  PATCH
  • 44. Shaun Abram 52 Rules of thumb  POST  Create with the server deciding on the URI  PUT  Update a resource  Store the supplied entity under the supplied URI – If exists, update; else create with that URI  PATCH  Partial updates Use you best judgment – or your corp standards!
  • 45. Shaun Abram 53 Uncommon HTTP Methods  HEAD  Like GET but without the body  Used for obtaining meta-information about the entity  Useful for testing links, e.g. for validity, accessibility  OPTIONS  Request about the capabilities of a server  e.g. request a list of supported HTTP methods  Possible response: 200 OK; Allow: HEAD,GET,PUT,DELETE  Useful but not widely supported
  • 46. Shaun Abram 54 Uncommon HTTP Methods  TRACE  Used to invoke a remote loop-back of the request  Plain English: Echoes back request to see what changes have been made by intermediate servers  Often disabled for security  CONNECT  For use with a proxy that can dynamically switch to being a tunnel  Typically for tunneling HTTPS through HTTP connection
  • 47. Shaun Abram 55 HTTP response codes Code Meaning Plain English (From user perspective) 1xx Informational; indicates a provisional response, e.g. 100 OK so far and client should continue with the request 2xx Successful All good 3xx Redirection Something moved 4xx Client Error You messed up 5xx Server Error We messed up
  • 48. Shaun Abram 56 Hypermedia as the engine of application state (HATEOAS) What is Hypermedia?  URI and URL  Hypertext  Multimedia  Hypermedia
  • 49. Shaun Abram 57 Hypermedia as the engine of application state (HATEOAS) Clients know fixed entry points to the app Transition (states) by using those links + more If you think of Hypermedia as simply links, then HATEOAS is simply using the links you discover to navigate (or transition state) through the application. Applies to human or software users
  • 50. Shaun Abram 58 Hypermedia as the engine of application state (HATEOAS) Example Hypermedia controls used on an album listing <album> <name>Give Blood</name> <link rel="/artist" href="/artist/theBrakes" /> <description> Awesome, short, brutish, funny and loud. Must buy! </description> <link rel="/instantpurchase" href="/instantPurchase/1234" /> </album>
  • 51. Shaun Abram 59 Wrapping up Microservices & REST Microservices:  A small, focused, loosely coupled service  Can be developed, deployed, upgraded independently How to communicate with and between Microservices? REST & HTTP! REST:  Proven architectural style inspired by www  Resources accessed via uniform interfaces and HTTP
  • 52. Privileged and Confidential 60 Recommended reading Domain Driven Design Freeman & Pryce Building Microservices Sam Newman REST in Practice Webber, Parastatidis, Robinson
  • 53. Privileged and Confidential 61 Recommended reading Microservices: http://martinfowler.com/articles/microservices.html Architectural Styles and the Design of Network-based Software https://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm Http API Design: https://github.com/interagent/http-api-design ParallelChange (aka expand and contract): http://martinfowler.com/bliki/ParallelChange.html Blue-Green Deployment: http://docs.pivotal.io/pivotalcf/devguide/deploy- apps/blue-green.html Richardson Maturity Model: http://martinfowler.com/articles/richardsonMaturityModel.html

Notas del editor

  1. You probably don't know what should be a Microservice until you've built a monolith.
  2. Separating UI from the server and data storage allows them to evolve independently Http: A client server protocol e.g. browser<->server, IoT
  3. Separating UI from the server and data storage allows them to evolve independently Http: A client server protocol e.g. browser<->server, IoT
  4. No state on server Each request must contain all required info reliability (failure recovery), scalability HTTP: A stateless protocol Can circumvent by using cookies, sessions, but…
  5. Reduce latency and network traffic responses can be labeled as cacheable or not Which Http supports
  6. Resources a thing that the service itself knows about Server creates different representations e.g. JSON External representations decoupled from internal Uniform interfaces A URI identifies exactly one resource Standard methods GET, POST etc