SlideShare una empresa de Scribd logo
1 de 36
Microservices
What are they, why use them, and how?
Who Am I?
Rob Raisch
Senior Staff Software Engineer @ Yieldbot
Team Lead - Config Services
More than 30 years online experience - "Internet Greybeard"
Overview
What are Microservices?
Definition, History
Why are they desirable?
Characteristics, Drawbacks
How should I organize/define them?
Business Domains
How about a quick example?
What Are Microservices?
What are Microservices? - Definition
An Architectural Design Pattern of:
Small, Autonomous Modular Services
That Are Independently and Automatically Deployable
Using Lightweight Communication Mechanisms
What are Microservices? - Definition
An Architectural Design Pattern of:
Small, Autonomous Modular Services
That Are Independently and Automatically Deployable
Using Lightweight Communication Mechanisms
Do Only One Thing And Do It Well
What are Microservices? - Example
Monolithic Service
Graphic blatently stolen from microservices.io
What are Microservices? - Example
Microservices
Graphic blatently stolen from microservices.io
Microservices - History
A World of Small Interconnected Things
Unix Pipefitting - $> cat file.txt | awk '{print $2}' | sort | uniq > result.txt
Remote Procedure Call (RPC) - ASN.1, CORBA/IDL, etc.
Message Passing and Event Busses - Document Object Model, PubSub, ZeroMQ, etc.
SOA - XML, WSDL, SOAP, etc.
Microservices
Microservices - History
A World of Small Interconnected Things
Unix Pipefitting - $> cat file.txt | awk '{print $2}' | sort | uniq > result.txt
Remote Procedure Call (RPC) - ASN.1, CORBA/IDL, etc.
Message Passing and Event Busses - Document Object Model, PubSub, ZeroMQ, etc.
SOA - XML, WSDL, SOAP, etc.
Everything is deeply intertwingled. - Ted Nelson
Why Are Microservices Desirable?
Why Are Microservices Desirable?
Why Are Microservices Desirable?
Why Are Microservices Desirable?
Increase Cohesion
Reduce Coupling
Improved Resilience
Optimized for Replaceability
Better Alignment With Business Processes
Better Composability
Better Scaling
Technological Heterogeneity
Why Are Microservices Desirable?
Increase Cohesion
Group related functionality together
"Gather together those things that change for the same reason and separate
those things that change for different reasons."
- Robert C. Martin's Single Responsibility Principle
Why Are Microservices Desirable?
Reduce Coupling - Separation of responsibilities
Coupling - the manner and degree of interdependence between software
components.
Connascence - where a change to one software component requires changes
to other components.
Why Are Microservices Desirable?
Improved Resilience
Monolithic systems tend to fail completely.
Design so a failure of one software component will not cause the entire system
to fail, thus improving overall "fault tolerance"
Service boundaries become natural "bulkheads" and so reduce the "cascade"
of failure.
Why Are Microservices Desirable?
Optimized for Replaceability
As long as service contracts remain the same, all components can be easily
replaced.
Lessen technical debt
Reduce costs to replace underlying technologies
Why Are Microservices Desirable?
Better Alignment With Business Processes
Organized around business domains
Reduce development team size
Help focus participation from elsewhere in the organization
Why Are Microservices Desirable?
Better Composability
Monolithic systems cannot be easily reorganized as needs change
Lots of little independent workers that can be organized in different ways
Better software reuse - "DRY it up!"
Why Are Microservices Desirable?
Better Scaling
In Monolithic systems, everything must be scaled together
Using routing, requests can be directed to one of several instances of the
same service (see nginx)
The architecture can be scaled as needed
Why Are Microservices Desirable?
Technological Heterogeneity
Monolithic systems are typically written in a single language.
No requirement that all services be expressed in the same language
Use "the right tool for the right job"
Why Are Microservices Desirable?
Ease of Deployment
New functionality can be easily deployed as needed.
No "BIG" deploys reduce downtime.
"Deliver often" - Continuous Integration/Deployment
What Are The Drawbacks Of Microservices?
Distributed systems can be much more complex than monolithic ones.
The "Big Picture" can be difficult to envision without good documentation.
Operational Overhead
Interactions can be hard to track without copious, centralized logging.
Network latency must be monitored and managed well.
Why Are Microservices Desirable?
Why Are Microservices Desirable?
How Should Microservices Be
Designed?
How Should Microservices Be Designed?
Identify Domains Aligned to Business Units
Authorization
Payments - Deposits, Ledgers, Reconciliation
Billing
Reporting
Support
Not Components! Responsibilities!
How Should Microservices Be Designed?
Identify Stakeholders And Include Them In Design Process
Carve Out Well-Defined Functionality
Keep Martin's Single Responsibility Principle in mind at all times.
How Should Microservices Be Designed?
Identify Stakeholders And Include Them In Design Process
Carve Out Well-Defined Functionality
Keep Martin's Single Responsibility Principle in mind at all times.
"Gather together those things that change for the same reason and separate those
things that change for different reasons."
How Should Microservices Be Designed?
The BIG QUESTION:
How to determine the best size for a microservice?
How Should Microservices Be Designed?
The BIG QUESTION:
How to determine the best size for a microservice?
The BIG ANSWER:
As Small As They Need To Be To Solve A Need
How Should Microservices Be Designed?
The BIG QUESTION:
How to determine the best size for a microservice?
The BIG ANSWER:
As Small As They Need To Be To Solve A Need
BUT NO SMALLER!
Why Are Microservices Desirable?
Why Are Microservices Desirable?
An Example Using Node/Seneca
Microservice in Seneca - Server
const _ = require('lodash');
const SenecaFactory = require('seneca');
const seneca = SenecaFactory();
seneca.add('cmd:sum', (msg, respond) => {
let errs = [];
const left = Number(_.get(msg,'left',0));
const right = Number(_.get(msg,'right',0));
if(_.isNaN(left)) errs.push(new Error('left operand must evaluate to a number'));
if(_.isNaN(right)) errs.push(new Error('right operand must evaluate to a number'));
if(errs.length) {
respond(errs);
}
else {
const result = Math.floor(left) + Math.floor(right);
respond(null, { answer: result });
}
});
Microservice in Seneca - Server Side Call
// To call microservice from the same process…
seneca.act({cmd: 'sum', left: 1, right: 2}, (err, result) => {
if (err) {
console.error(err);
return;
}
console.log(`The result is ${result}`);
});
Summary
Architectural Pattern of Small, Independent Loosely-Coupled Services
Many Useful Benefits For Medium/Large Systems
Though By No Means A Panacea!
Do Only One Thing But Do It Very Well
Organize Around Business Domains
Carve Out Well-Defined Functionality
As Small As Needs Dictate But No Smaller
Summary
Architectural Pattern of Small, Independent Loosely-Coupled Services
Many Useful Benefits For Medium/Large Systems
Though By No Means A Panacea!
Do Only One Thing But Do It Very Well
Organize Around Business Domains
Carve Out Well-Defined Functionality
As Small As Needs Dictate But No Smaller
We Are Hiring!
IT Lead
Engineering Manager, Infrastructure
Front End Software Engineer
Server-side Javascript Engineer
DevOps Engineer
Software Test Engineer - Ad Serving Platform
Platform Software Engineer - Ad Serving
Thanks for your time!
rraisch@yieldbot.com

Más contenido relacionado

Destacado

4kl ch o_test-2008
4kl ch o_test-20084kl ch o_test-2008
4kl ch o_test-2008Rosislide
 
Data as Currency - OPS
Data as Currency - OPSData as Currency - OPS
Data as Currency - OPSyieldbot
 
Instructions by the symbol ppt
Instructions by the symbol pptInstructions by the symbol ppt
Instructions by the symbol pptkamatchipmu
 
Make Your Own Charting Library with d3
Make Your Own Charting Library with d3Make Your Own Charting Library with d3
Make Your Own Charting Library with d3yieldbot
 
Real-time Intent Beyond Search
Real-time Intent Beyond SearchReal-time Intent Beyond Search
Real-time Intent Beyond Searchyieldbot
 
Bel 4 kl-10_maj_2010-test_klyuchove
Bel 4 kl-10_maj_2010-test_klyuchoveBel 4 kl-10_maj_2010-test_klyuchove
Bel 4 kl-10_maj_2010-test_klyuchoveRosislide
 
Звук и буква Оо, По телефона
Звук и буква Оо, По телефонаЗвук и буква Оо, По телефона
Звук и буква Оо, По телефонаRosislide
 
Building a Lambda Architecture with Elasticsearch at Yieldbot
Building a Lambda Architecture with Elasticsearch at YieldbotBuilding a Lambda Architecture with Elasticsearch at Yieldbot
Building a Lambda Architecture with Elasticsearch at Yieldbotyieldbot
 
Подробен преразказ на разказ
Подробен преразказ на разказПодробен преразказ на разказ
Подробен преразказ на разказRosislide
 

Destacado (11)

4kl ch o_test-2008
4kl ch o_test-20084kl ch o_test-2008
4kl ch o_test-2008
 
Data as Currency - OPS
Data as Currency - OPSData as Currency - OPS
Data as Currency - OPS
 
Mapa capitulo 4 con audio
Mapa capitulo 4 con audioMapa capitulo 4 con audio
Mapa capitulo 4 con audio
 
Instructions by the symbol ppt
Instructions by the symbol pptInstructions by the symbol ppt
Instructions by the symbol ppt
 
Make Your Own Charting Library with d3
Make Your Own Charting Library with d3Make Your Own Charting Library with d3
Make Your Own Charting Library with d3
 
Real-time Intent Beyond Search
Real-time Intent Beyond SearchReal-time Intent Beyond Search
Real-time Intent Beyond Search
 
Bel 4 kl-10_maj_2010-test_klyuchove
Bel 4 kl-10_maj_2010-test_klyuchoveBel 4 kl-10_maj_2010-test_klyuchove
Bel 4 kl-10_maj_2010-test_klyuchove
 
Звук и буква Оо, По телефона
Звук и буква Оо, По телефонаЗвук и буква Оо, По телефона
Звук и буква Оо, По телефона
 
Building a Lambda Architecture with Elasticsearch at Yieldbot
Building a Lambda Architecture with Elasticsearch at YieldbotBuilding a Lambda Architecture with Elasticsearch at Yieldbot
Building a Lambda Architecture with Elasticsearch at Yieldbot
 
Vietnamese cuisine
Vietnamese cuisineVietnamese cuisine
Vietnamese cuisine
 
Подробен преразказ на разказ
Подробен преразказ на разказПодробен преразказ на разказ
Подробен преразказ на разказ
 

Último

AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSrknatarajan
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Christo Ananth
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdfKamal Acharya
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 

Último (20)

Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar  ≼🔝 Delhi door step de...
Call Now ≽ 9953056974 ≼🔝 Call Girls In New Ashok Nagar ≼🔝 Delhi door step de...
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...Call for Papers - International Journal of Intelligent Systems and Applicatio...
Call for Papers - International Journal of Intelligent Systems and Applicatio...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 

Microservices metrowest web developers 2016-09-14

  • 1. Microservices What are they, why use them, and how?
  • 2. Who Am I? Rob Raisch Senior Staff Software Engineer @ Yieldbot Team Lead - Config Services More than 30 years online experience - "Internet Greybeard"
  • 3. Overview What are Microservices? Definition, History Why are they desirable? Characteristics, Drawbacks How should I organize/define them? Business Domains How about a quick example?
  • 5. What are Microservices? - Definition An Architectural Design Pattern of: Small, Autonomous Modular Services That Are Independently and Automatically Deployable Using Lightweight Communication Mechanisms
  • 6. What are Microservices? - Definition An Architectural Design Pattern of: Small, Autonomous Modular Services That Are Independently and Automatically Deployable Using Lightweight Communication Mechanisms Do Only One Thing And Do It Well
  • 7. What are Microservices? - Example Monolithic Service Graphic blatently stolen from microservices.io
  • 8. What are Microservices? - Example Microservices Graphic blatently stolen from microservices.io
  • 9. Microservices - History A World of Small Interconnected Things Unix Pipefitting - $> cat file.txt | awk '{print $2}' | sort | uniq > result.txt Remote Procedure Call (RPC) - ASN.1, CORBA/IDL, etc. Message Passing and Event Busses - Document Object Model, PubSub, ZeroMQ, etc. SOA - XML, WSDL, SOAP, etc. Microservices
  • 10. Microservices - History A World of Small Interconnected Things Unix Pipefitting - $> cat file.txt | awk '{print $2}' | sort | uniq > result.txt Remote Procedure Call (RPC) - ASN.1, CORBA/IDL, etc. Message Passing and Event Busses - Document Object Model, PubSub, ZeroMQ, etc. SOA - XML, WSDL, SOAP, etc. Everything is deeply intertwingled. - Ted Nelson
  • 11. Why Are Microservices Desirable? Why Are Microservices Desirable? Why Are Microservices Desirable?
  • 12. Why Are Microservices Desirable? Increase Cohesion Reduce Coupling Improved Resilience Optimized for Replaceability Better Alignment With Business Processes Better Composability Better Scaling Technological Heterogeneity
  • 13. Why Are Microservices Desirable? Increase Cohesion Group related functionality together "Gather together those things that change for the same reason and separate those things that change for different reasons." - Robert C. Martin's Single Responsibility Principle
  • 14. Why Are Microservices Desirable? Reduce Coupling - Separation of responsibilities Coupling - the manner and degree of interdependence between software components. Connascence - where a change to one software component requires changes to other components.
  • 15. Why Are Microservices Desirable? Improved Resilience Monolithic systems tend to fail completely. Design so a failure of one software component will not cause the entire system to fail, thus improving overall "fault tolerance" Service boundaries become natural "bulkheads" and so reduce the "cascade" of failure.
  • 16. Why Are Microservices Desirable? Optimized for Replaceability As long as service contracts remain the same, all components can be easily replaced. Lessen technical debt Reduce costs to replace underlying technologies
  • 17. Why Are Microservices Desirable? Better Alignment With Business Processes Organized around business domains Reduce development team size Help focus participation from elsewhere in the organization
  • 18. Why Are Microservices Desirable? Better Composability Monolithic systems cannot be easily reorganized as needs change Lots of little independent workers that can be organized in different ways Better software reuse - "DRY it up!"
  • 19. Why Are Microservices Desirable? Better Scaling In Monolithic systems, everything must be scaled together Using routing, requests can be directed to one of several instances of the same service (see nginx) The architecture can be scaled as needed
  • 20. Why Are Microservices Desirable? Technological Heterogeneity Monolithic systems are typically written in a single language. No requirement that all services be expressed in the same language Use "the right tool for the right job"
  • 21. Why Are Microservices Desirable? Ease of Deployment New functionality can be easily deployed as needed. No "BIG" deploys reduce downtime. "Deliver often" - Continuous Integration/Deployment
  • 22. What Are The Drawbacks Of Microservices? Distributed systems can be much more complex than monolithic ones. The "Big Picture" can be difficult to envision without good documentation. Operational Overhead Interactions can be hard to track without copious, centralized logging. Network latency must be monitored and managed well.
  • 23. Why Are Microservices Desirable? Why Are Microservices Desirable? How Should Microservices Be Designed?
  • 24. How Should Microservices Be Designed? Identify Domains Aligned to Business Units Authorization Payments - Deposits, Ledgers, Reconciliation Billing Reporting Support Not Components! Responsibilities!
  • 25. How Should Microservices Be Designed? Identify Stakeholders And Include Them In Design Process Carve Out Well-Defined Functionality Keep Martin's Single Responsibility Principle in mind at all times.
  • 26. How Should Microservices Be Designed? Identify Stakeholders And Include Them In Design Process Carve Out Well-Defined Functionality Keep Martin's Single Responsibility Principle in mind at all times. "Gather together those things that change for the same reason and separate those things that change for different reasons."
  • 27. How Should Microservices Be Designed? The BIG QUESTION: How to determine the best size for a microservice?
  • 28. How Should Microservices Be Designed? The BIG QUESTION: How to determine the best size for a microservice? The BIG ANSWER: As Small As They Need To Be To Solve A Need
  • 29. How Should Microservices Be Designed? The BIG QUESTION: How to determine the best size for a microservice? The BIG ANSWER: As Small As They Need To Be To Solve A Need BUT NO SMALLER!
  • 30. Why Are Microservices Desirable? Why Are Microservices Desirable? An Example Using Node/Seneca
  • 31. Microservice in Seneca - Server const _ = require('lodash'); const SenecaFactory = require('seneca'); const seneca = SenecaFactory(); seneca.add('cmd:sum', (msg, respond) => { let errs = []; const left = Number(_.get(msg,'left',0)); const right = Number(_.get(msg,'right',0)); if(_.isNaN(left)) errs.push(new Error('left operand must evaluate to a number')); if(_.isNaN(right)) errs.push(new Error('right operand must evaluate to a number')); if(errs.length) { respond(errs); } else { const result = Math.floor(left) + Math.floor(right); respond(null, { answer: result }); } });
  • 32. Microservice in Seneca - Server Side Call // To call microservice from the same process… seneca.act({cmd: 'sum', left: 1, right: 2}, (err, result) => { if (err) { console.error(err); return; } console.log(`The result is ${result}`); });
  • 33. Summary Architectural Pattern of Small, Independent Loosely-Coupled Services Many Useful Benefits For Medium/Large Systems Though By No Means A Panacea! Do Only One Thing But Do It Very Well Organize Around Business Domains Carve Out Well-Defined Functionality As Small As Needs Dictate But No Smaller
  • 34. Summary Architectural Pattern of Small, Independent Loosely-Coupled Services Many Useful Benefits For Medium/Large Systems Though By No Means A Panacea! Do Only One Thing But Do It Very Well Organize Around Business Domains Carve Out Well-Defined Functionality As Small As Needs Dictate But No Smaller
  • 35. We Are Hiring! IT Lead Engineering Manager, Infrastructure Front End Software Engineer Server-side Javascript Engineer DevOps Engineer Software Test Engineer - Ad Serving Platform Platform Software Engineer - Ad Serving
  • 36. Thanks for your time! rraisch@yieldbot.com