SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

En vedette

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
 

En vedette (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
 
Подробен преразказ на разказ
Подробен преразказ на разказПодробен преразказ на разказ
Подробен преразказ на разказ
 

Dernier

Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptNANDHAKUMARA10
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXssuser89054b
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network DevicesChandrakantDivate1
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfsmsksolar
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projectssmsksolar
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersMairaAshraf6
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesRAJNEESHKUMAR341697
 

Dernier (20)

Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 

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