SlideShare ist ein Scribd-Unternehmen logo
1 von 23
1
Microservice Architecture (MSA) and
Service-Oriented Architecture (SOA)
Sonic Lee
mcsonic@gmail.com
2
1
2
3
4
Service Oriented Architecture
Description and comparison with monolithic architecture
Microservice Architecture
Simple example and key characteristics
MSA vs SOA
Show difference in overall architecture and comm. protocol
MSA Case Study: Netflix
Adrian Cockcroft’s effort in turning legacy system into MSA and
what we can learn
3
Service Oriented Architecture
Definition (from Wikipedia)
• Architectural pattern in computer software design in which application components
provide services to other components via a communications protocol,
typically over a network.
Characteristics
• Service is the basic building block, and is a self-contained unit of functionality.
▪ Ex: View last month’s credit card history.
• Services use loosely-coupled components that can be reused later.
• Components communicate using standards like JSON, XML, SOAP.
• Independent of any vendor, product or technology.
• Must be incremental, and built on current investments.
• SOA is a means, not an end.
Why?
• Adapt applications to changing technologies.
• Easily integrate applications with other systems. (systems are exposed)
• Quickly create a business process from existing services.
4
Service Oriented Architecture – Four Tenets
1. Boundaries are explicit
• Services interact by sending messages across boundaries.
• No assumptions about how other service is made.
2. Services are autonomous
• Services do not depend on other code.
• Deploy and version services independently from clients.
• Contracts (WSDL: Web Services Description Language)
should not be changed once published.
3. Services share schema and contract, not class
• Services communicate by using schema & contracts (WSDL in XML)
• Internal data format should be hidden from consumers.
• Public schema should be immutable.
4. Service compatibility is based upon policy
• Define what (structural) and how to (semantic) communicate.
• Every service provides a description of capabilities & requirements in machine code.
5
Before / After SOA
App A Service AApp A DB A
App A App B App C Service A
6
Microservice Architecture (MSA)
Definition (from Martin Fowler)
• Approach to developing a single application as a suite of small modular services,
each running in its own process and communicating with lightweight
mechanisms, often an HTTP resource API. (REST with JSON, SOAP with XML)
• Each service is independently deployable by fully automated deployment machinery.
Client-side
[JS / HTML]
Server-side
[HTTP request]
Relational DBMS
monolith
[Monolithic]
Client-side
[JS / HTML]
Customer
User DB
[Microservices Architecture]
Product Order
Product DB Order DB
API (Remote call)
URL 1 URL 2 URL 3
REST
RPC AMQP
7
Microservices: Key Characteristics
• Store data in different DB for efficiency. (Polyglot persistence)
• Must keep DB’s in sync. (DB structures / foreign keys)
• Use Master Data Management tool to fix inconsistencies.
✓ Many RDBMSs do these checks, but require too much coupling.
• Immutable Infrastructure Principle
✓ Apply changes to a new service.
• Do separate build for each microservice.
(OK to have different revision level files)
• Servers must be interchangeable and able to scale.
Treat servers like generic cows, not pets
• Each microservice can use its own language / technology.
8
Microservices: Key Characteristics
Small, cross-functional teams with
flat, self / peer-management structure
Can scale and innovate successfully
“It’s not about technology, it’s about people.”
- Asim Aslam from MicroHQ
• Set up comparable teams
• DevOps: respond faster to customer feedback
Just using REST or Docker does not make it MSA
9
Microservices: Key Characteristics
Product-based not project-based
• Project is a one-time development, making it hard to accumulate expertise.
• De-centralized gov. model needs to guarantee developers’ career in some way.
• Service team: Product planning, Development, QA, Operation.
Team as suggested by Amazon
10
Who uses Microservices?
• Netflix: https://www.nginx.com/blog/microservices-at-netflix-architectural-best-
practices/
http://techblog.netflix.com/2016/12/netflix-conductor-microservices.html
• Amazon: http://www.slideshare.net/apigee/i-love-apis-2015-microservices-at-
amazon-54487258
• Ebay: http://www.slideshare.net/kasun04/microservices-at-ebay
• Uber
• Groupon
• Capital One
11
SOA vs Microservice Architecture (MSA)
What is the difference?
• SOA is a broader concept, and refers to architectural pattern.
• Microservices is a fine-grained, more modular “ideal” type of SOA.
SOA
• More dependent ESBs
• Imperative programming
• Large relational DB
MSA
• API Gateways
• Reactive programming
• NoSQL or micro-SQL DB
…But Both Share
• Loosely coupled elements with
bounded contexts
Payment
Service
Cancel
Service
DB DB
12
SOA vs MSA communication protocol
SOA ESB (Enterprise Service Bus)
• Communication backbone to connect various services together.
• Applications can communicate asynchronously and not have to wait.
• Allows loose coupling between applications.
Disadvantages
• Parsing XML messages causes overhead.
• ESB can become single point of failure for the network.
• Often wrongly used to integrate applications. (EAI)
• Vendor-driven
13
SOA vs MSA communication protocol
MSA API Gateway
• Smart endpoints and dumb pipes. (Most operations occur in endpoints)
• REST protocols and lightweight messaging. (RabbitMQ / ZeroMQ)
• Orchestration: Combine multiple services to create new ones. (Buy + membership)
• Cross cutting function handling: Handle common functions. (Auth, logging)
14
MSA disadvantages
Performance
• API call returns results in JSON or XML. (Marshalling overhead / Network latency)
Memory
• Each service is deployed in its own server instance. (# of Service * memory in each)
Testing
• Each service is separated, so integrated testing becomes more difficult.
Guaranteeing consistency may be hard
• HTTP protocol is sync in nature.
• Client -> Server can be sync, but internal microservice comm. must be async.
1. 202 Accepted (Tell client to wait)
2. 200 OK (Final result returned)
15
MSA Case Study: Netflx
Netflix: Adrian Cockcroft
• Key architect: moved Netflix’s own data centers to Amazon’s cloud.
• Implemented public-cloud architecture & open-sourcing Netflix OSS platform. (MSA)
• Changed Monolithic service to hundreds of meshed-up microservices.
• Built on NGINX:
Open source SW for web service, reverse proxy, cache, load balancing
16
MSA Case Study: Netflx
Typical Reaction to Cockcorft’s Netflix talks
“What Netflix is doing
won’t work” – 2010
“It only works for ‘Unicorns’
like Netflix” – 2011
“We’d like to do that but
can’t” – 2012
Lesson learned from time at Netflix
• Speed wins in the marketplace.
• High trust, low process, teams communicate with each other.
• Freedom & responsibility culture.
• Use simple patterns automated by tooling.
• Don’t do your own “undifferentiated heavy lifting.” (특색없는 노동)
• Self-service cloud makes impossible things instant.
17
MSA Case Study: Netflx
Cockcroft’s Philosophy
Common assumption: Process prevents problems (?)
Organizations build up slow complex “Scar tissue” processes
* Scar tissue: 반흔조직
상해되어 죽은 세포와 그 주변부의 비삼투성 보호물질로 형성된 세포로 구성된 조직.
HR Rules Processes Infra Security
18
MSA Case Study: Process Improvement
Hardware Provisioning
Waterfall Product Dev
IaaS (SW Provisioning)
Agile Product Dev
PaaS
Continuous Delivery
SaaSBetter
19
MSA Case Study: Netflx – Agile style
Agile style development
Email / SMS /
Mobile Push / Phone call
(Bit scary)
20
MSA Case Study: Netflx
Development Cycles
• 4 features / 4 weeks VS 2 features / 2 weeks
Work in Progress = 4
Opportunity for bugs = 100% (baseline)
Time to Debug each = 100% (baseline)
Delivery Complexity = 100% (baseline)
Work in Progress = 2
Opportunity for bugs = 50% (baseline)
Time to Debug each = 50% (baseline)
Delivery Complexity = 100 - 25 = 75%
21
Q&A Session
Questions, comments, feedback, analysis, etc
22
References
1. An Introduction to Service-Oriented Architecture from a Java Developer Perspective
http://archive.oreilly.com/pub/a/onjava/2005/01/26/soa-intro.html
2. Microservices - a definition of this new architectural term
http://martinfowler.com/articles/microservices.html
3. What is Microservices Architecture?
https://smartbear.com/learn/api-design/what-are-microservices/
4. Service-oriented architecture (SOA)
http://www.tridens.si/expertise/soa/
5. Vivat SOA diagram
http://hyperty.com/portfolio/2008/04/04/vivat-soa/
6. Pattern: API Gateway
http://microservices.io/patterns/apigateway.html
7. The introduction to Reactive Programming you've been missing
https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
8. Service Oriented Architecture (SOA)
http://tutorials.jenkov.com/soa/soa.html
23
References
9. Adrian Cockcroft Slideshare
http://www.slideshare.net/adriancockcroft
10. How Nginx Works
https://www.atulhost.com/ngin
11. Cockcroft, the Man Behind Netflix’s Move to AWS, Joins AWS
http://www.datacenterknowledge.com/archives/2016/10/25/cockcroft-the-man-behind-
netflixs-move-to-aws-joins-aws/
12. Adopting Microservices at Netflix: Lessons for Architectural Design
https://www.nginx.com/blog/microservices-at-netflix-architectural-best-practices/
13. The Real Success Story of Microservices Architectures
http://blog.christianposta.com/microservices/the-real-success-story-of-microservices-
architectures/
14. An Introduction to Service-Oriented Architecture from a Java Developer Perspective
http://archive.oreilly.com/pub/a/onjava/2005/01/26/soa-intro.html
15. Why Companies Adopt Microservices And How They Succeed
https://medium.com/microhq/why-companies-adopt-microservices-and-how-they-succeed-
2ad32f39c65a#.o6dl9bl0q

Weitere ähnliche Inhalte

Was ist angesagt?

Keynote-Service Orientation – Why is it good for your business
Keynote-Service Orientation – Why is it good for your businessKeynote-Service Orientation – Why is it good for your business
Keynote-Service Orientation – Why is it good for your business
WSO2
 
ESB Evaluation Framework
ESB Evaluation FrameworkESB Evaluation Framework
ESB Evaluation Framework
WSO2
 
Using a private cloud to automate and govern enterprise development
Using a private cloud to automate and govern enterprise developmentUsing a private cloud to automate and govern enterprise development
Using a private cloud to automate and govern enterprise development
WSO2
 
Merging micrservices architecture with SOA Practices
Merging micrservices architecture with SOA Practices Merging micrservices architecture with SOA Practices
Merging micrservices architecture with SOA Practices
WSO2
 
Ss Esb
Ss EsbSs Esb
Ss Esb
WSO2
 

Was ist angesagt? (20)

Microservices for Enterprises
Microservices for Enterprises Microservices for Enterprises
Microservices for Enterprises
 
Eight Miles High: Build Cloud-native and Cloud-aware Systems
Eight Miles High: Build Cloud-native and Cloud-aware SystemsEight Miles High: Build Cloud-native and Cloud-aware Systems
Eight Miles High: Build Cloud-native and Cloud-aware Systems
 
An introduction to Microservices
An introduction to MicroservicesAn introduction to Microservices
An introduction to Microservices
 
Develop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverlessDevelop in ludicrous mode with azure serverless
Develop in ludicrous mode with azure serverless
 
Microservice architecture design principles
Microservice architecture design principlesMicroservice architecture design principles
Microservice architecture design principles
 
Keynote-Service Orientation – Why is it good for your business
Keynote-Service Orientation – Why is it good for your businessKeynote-Service Orientation – Why is it good for your business
Keynote-Service Orientation – Why is it good for your business
 
Microservices: an introduction
Microservices: an introductionMicroservices: an introduction
Microservices: an introduction
 
ESB Evaluation Framework
ESB Evaluation FrameworkESB Evaluation Framework
ESB Evaluation Framework
 
[WSO2Con EU 2017] Microservices for Enterprises
[WSO2Con EU 2017] Microservices for Enterprises[WSO2Con EU 2017] Microservices for Enterprises
[WSO2Con EU 2017] Microservices for Enterprises
 
WSO2Con ASIA 2016: Understanding Microservice Architecture
WSO2Con ASIA 2016: Understanding Microservice ArchitectureWSO2Con ASIA 2016: Understanding Microservice Architecture
WSO2Con ASIA 2016: Understanding Microservice Architecture
 
Lightweight ESB Alternatives
Lightweight ESB AlternativesLightweight ESB Alternatives
Lightweight ESB Alternatives
 
WSO2Con ASIA 2016: Moulding Your Enterprise with Resource Oriented Architecture
WSO2Con ASIA 2016: Moulding Your Enterprise with Resource Oriented ArchitectureWSO2Con ASIA 2016: Moulding Your Enterprise with Resource Oriented Architecture
WSO2Con ASIA 2016: Moulding Your Enterprise with Resource Oriented Architecture
 
Using a private cloud to automate and govern enterprise development
Using a private cloud to automate and govern enterprise developmentUsing a private cloud to automate and govern enterprise development
Using a private cloud to automate and govern enterprise development
 
Merging micrservices architecture with SOA Practices
Merging micrservices architecture with SOA Practices Merging micrservices architecture with SOA Practices
Merging micrservices architecture with SOA Practices
 
Full lifecycle of a microservice
Full lifecycle of a microserviceFull lifecycle of a microservice
Full lifecycle of a microservice
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
Soa Driven Project Management
Soa Driven Project ManagementSoa Driven Project Management
Soa Driven Project Management
 
Enterprise Soa Concept
Enterprise Soa ConceptEnterprise Soa Concept
Enterprise Soa Concept
 
[WSO2Con EU 2017] Creating Composite Services Using Ballerina
[WSO2Con EU 2017] Creating Composite Services Using Ballerina[WSO2Con EU 2017] Creating Composite Services Using Ballerina
[WSO2Con EU 2017] Creating Composite Services Using Ballerina
 
Ss Esb
Ss EsbSs Esb
Ss Esb
 

Andere mochten auch

Software_Architectures_from_SOA_to_MSA
Software_Architectures_from_SOA_to_MSASoftware_Architectures_from_SOA_to_MSA
Software_Architectures_from_SOA_to_MSA
Peter Denev
 

Andere mochten auch (6)

Software_Architectures_from_SOA_to_MSA
Software_Architectures_from_SOA_to_MSASoftware_Architectures_from_SOA_to_MSA
Software_Architectures_from_SOA_to_MSA
 
CWIN17 Rome / Micro services
CWIN17 Rome / Micro servicesCWIN17 Rome / Micro services
CWIN17 Rome / Micro services
 
Pattern Driven Enterprise Architecture
Pattern Driven Enterprise ArchitecturePattern Driven Enterprise Architecture
Pattern Driven Enterprise Architecture
 
Microservice Architecture
Microservice ArchitectureMicroservice Architecture
Microservice Architecture
 
BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...
BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...
BizTalk Mapping Patterns and Best Practices at BizTalk User Group Sweden in G...
 
Microservices, Monoliths, SOA and How We Got Here
Microservices, Monoliths, SOA and How We Got HereMicroservices, Monoliths, SOA and How We Got Here
Microservices, Monoliths, SOA and How We Got Here
 

Ähnlich wie 170215 msa intro

Ähnlich wie 170215 msa intro (20)

Introduction to microservices
Introduction to microservicesIntroduction to microservices
Introduction to microservices
 
Do You Need A Service Mesh?
Do You Need A Service Mesh?Do You Need A Service Mesh?
Do You Need A Service Mesh?
 
Best Practices Building Cloud Scale Apps with Microservices
Best Practices Building Cloud Scale Apps with MicroservicesBest Practices Building Cloud Scale Apps with Microservices
Best Practices Building Cloud Scale Apps with Microservices
 
Microservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration PatternsMicroservices Architecture, Monolith Migration Patterns
Microservices Architecture, Monolith Migration Patterns
 
Stay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolithStay productive_while_slicing_up_the_monolith
Stay productive_while_slicing_up_the_monolith
 
Do I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptxDo I Need A Service Mesh.pptx
Do I Need A Service Mesh.pptx
 
Microservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SREMicroservices Docker Kubernetes Istio Kanban DevOps SRE
Microservices Docker Kubernetes Istio Kanban DevOps SRE
 
Concurrency at Scale: Evolution to Micro-Services
Concurrency at Scale:  Evolution to Micro-ServicesConcurrency at Scale:  Evolution to Micro-Services
Concurrency at Scale: Evolution to Micro-Services
 
Microservice Pattern Launguage
Microservice Pattern LaunguageMicroservice Pattern Launguage
Microservice Pattern Launguage
 
Developing Enterprise Applications for the Cloud, from Monolith to Microservices
Developing Enterprise Applications for the Cloud,from Monolith to MicroservicesDeveloping Enterprise Applications for the Cloud,from Monolith to Microservices
Developing Enterprise Applications for the Cloud, from Monolith to Microservices
 
DevOps and Microservice
DevOps and MicroserviceDevOps and Microservice
DevOps and Microservice
 
Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC  Cloud compiler - Minor Project by students of CBPGEC
Cloud compiler - Minor Project by students of CBPGEC
 
Developing Enterprise Applications for the Cloud, from Monolith to Microservice
Developing Enterprise Applications for the Cloud, from Monolith to MicroserviceDeveloping Enterprise Applications for the Cloud, from Monolith to Microservice
Developing Enterprise Applications for the Cloud, from Monolith to Microservice
 
Cloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a CacheCloud-native Data: Every Microservice Needs a Cache
Cloud-native Data: Every Microservice Needs a Cache
 
Disruptive Trends in Application Development
Disruptive Trends in Application DevelopmentDisruptive Trends in Application Development
Disruptive Trends in Application Development
 
Microservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native AppsMicroservices Architecture - Cloud Native Apps
Microservices Architecture - Cloud Native Apps
 
Microservices: Where do they fit within a rapidly evolving integration archit...
Microservices: Where do they fit within a rapidly evolving integration archit...Microservices: Where do they fit within a rapidly evolving integration archit...
Microservices: Where do they fit within a rapidly evolving integration archit...
 
Designing Microservices
Designing MicroservicesDesigning Microservices
Designing Microservices
 
Software Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuableSoftware Architecture and Architectors: useless VS valuable
Software Architecture and Architectors: useless VS valuable
 
Iot cloud service v2.0
Iot cloud service v2.0Iot cloud service v2.0
Iot cloud service v2.0
 

Kürzlich hochgeladen

VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 
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
ankushspencer015
 

Kürzlich hochgeladen (20)

Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
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
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
(INDIRA) Call Girl Bhosari Call Now 8617697112 Bhosari Escorts 24x7
 
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
 
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
 
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...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
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
 
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
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
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
 
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...
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
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
 

170215 msa intro

  • 1. 1 Microservice Architecture (MSA) and Service-Oriented Architecture (SOA) Sonic Lee mcsonic@gmail.com
  • 2. 2 1 2 3 4 Service Oriented Architecture Description and comparison with monolithic architecture Microservice Architecture Simple example and key characteristics MSA vs SOA Show difference in overall architecture and comm. protocol MSA Case Study: Netflix Adrian Cockcroft’s effort in turning legacy system into MSA and what we can learn
  • 3. 3 Service Oriented Architecture Definition (from Wikipedia) • Architectural pattern in computer software design in which application components provide services to other components via a communications protocol, typically over a network. Characteristics • Service is the basic building block, and is a self-contained unit of functionality. ▪ Ex: View last month’s credit card history. • Services use loosely-coupled components that can be reused later. • Components communicate using standards like JSON, XML, SOAP. • Independent of any vendor, product or technology. • Must be incremental, and built on current investments. • SOA is a means, not an end. Why? • Adapt applications to changing technologies. • Easily integrate applications with other systems. (systems are exposed) • Quickly create a business process from existing services.
  • 4. 4 Service Oriented Architecture – Four Tenets 1. Boundaries are explicit • Services interact by sending messages across boundaries. • No assumptions about how other service is made. 2. Services are autonomous • Services do not depend on other code. • Deploy and version services independently from clients. • Contracts (WSDL: Web Services Description Language) should not be changed once published. 3. Services share schema and contract, not class • Services communicate by using schema & contracts (WSDL in XML) • Internal data format should be hidden from consumers. • Public schema should be immutable. 4. Service compatibility is based upon policy • Define what (structural) and how to (semantic) communicate. • Every service provides a description of capabilities & requirements in machine code.
  • 5. 5 Before / After SOA App A Service AApp A DB A App A App B App C Service A
  • 6. 6 Microservice Architecture (MSA) Definition (from Martin Fowler) • Approach to developing a single application as a suite of small modular services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API. (REST with JSON, SOAP with XML) • Each service is independently deployable by fully automated deployment machinery. Client-side [JS / HTML] Server-side [HTTP request] Relational DBMS monolith [Monolithic] Client-side [JS / HTML] Customer User DB [Microservices Architecture] Product Order Product DB Order DB API (Remote call) URL 1 URL 2 URL 3 REST RPC AMQP
  • 7. 7 Microservices: Key Characteristics • Store data in different DB for efficiency. (Polyglot persistence) • Must keep DB’s in sync. (DB structures / foreign keys) • Use Master Data Management tool to fix inconsistencies. ✓ Many RDBMSs do these checks, but require too much coupling. • Immutable Infrastructure Principle ✓ Apply changes to a new service. • Do separate build for each microservice. (OK to have different revision level files) • Servers must be interchangeable and able to scale. Treat servers like generic cows, not pets • Each microservice can use its own language / technology.
  • 8. 8 Microservices: Key Characteristics Small, cross-functional teams with flat, self / peer-management structure Can scale and innovate successfully “It’s not about technology, it’s about people.” - Asim Aslam from MicroHQ • Set up comparable teams • DevOps: respond faster to customer feedback Just using REST or Docker does not make it MSA
  • 9. 9 Microservices: Key Characteristics Product-based not project-based • Project is a one-time development, making it hard to accumulate expertise. • De-centralized gov. model needs to guarantee developers’ career in some way. • Service team: Product planning, Development, QA, Operation. Team as suggested by Amazon
  • 10. 10 Who uses Microservices? • Netflix: https://www.nginx.com/blog/microservices-at-netflix-architectural-best- practices/ http://techblog.netflix.com/2016/12/netflix-conductor-microservices.html • Amazon: http://www.slideshare.net/apigee/i-love-apis-2015-microservices-at- amazon-54487258 • Ebay: http://www.slideshare.net/kasun04/microservices-at-ebay • Uber • Groupon • Capital One
  • 11. 11 SOA vs Microservice Architecture (MSA) What is the difference? • SOA is a broader concept, and refers to architectural pattern. • Microservices is a fine-grained, more modular “ideal” type of SOA. SOA • More dependent ESBs • Imperative programming • Large relational DB MSA • API Gateways • Reactive programming • NoSQL or micro-SQL DB …But Both Share • Loosely coupled elements with bounded contexts Payment Service Cancel Service DB DB
  • 12. 12 SOA vs MSA communication protocol SOA ESB (Enterprise Service Bus) • Communication backbone to connect various services together. • Applications can communicate asynchronously and not have to wait. • Allows loose coupling between applications. Disadvantages • Parsing XML messages causes overhead. • ESB can become single point of failure for the network. • Often wrongly used to integrate applications. (EAI) • Vendor-driven
  • 13. 13 SOA vs MSA communication protocol MSA API Gateway • Smart endpoints and dumb pipes. (Most operations occur in endpoints) • REST protocols and lightweight messaging. (RabbitMQ / ZeroMQ) • Orchestration: Combine multiple services to create new ones. (Buy + membership) • Cross cutting function handling: Handle common functions. (Auth, logging)
  • 14. 14 MSA disadvantages Performance • API call returns results in JSON or XML. (Marshalling overhead / Network latency) Memory • Each service is deployed in its own server instance. (# of Service * memory in each) Testing • Each service is separated, so integrated testing becomes more difficult. Guaranteeing consistency may be hard • HTTP protocol is sync in nature. • Client -> Server can be sync, but internal microservice comm. must be async. 1. 202 Accepted (Tell client to wait) 2. 200 OK (Final result returned)
  • 15. 15 MSA Case Study: Netflx Netflix: Adrian Cockcroft • Key architect: moved Netflix’s own data centers to Amazon’s cloud. • Implemented public-cloud architecture & open-sourcing Netflix OSS platform. (MSA) • Changed Monolithic service to hundreds of meshed-up microservices. • Built on NGINX: Open source SW for web service, reverse proxy, cache, load balancing
  • 16. 16 MSA Case Study: Netflx Typical Reaction to Cockcorft’s Netflix talks “What Netflix is doing won’t work” – 2010 “It only works for ‘Unicorns’ like Netflix” – 2011 “We’d like to do that but can’t” – 2012 Lesson learned from time at Netflix • Speed wins in the marketplace. • High trust, low process, teams communicate with each other. • Freedom & responsibility culture. • Use simple patterns automated by tooling. • Don’t do your own “undifferentiated heavy lifting.” (특색없는 노동) • Self-service cloud makes impossible things instant.
  • 17. 17 MSA Case Study: Netflx Cockcroft’s Philosophy Common assumption: Process prevents problems (?) Organizations build up slow complex “Scar tissue” processes * Scar tissue: 반흔조직 상해되어 죽은 세포와 그 주변부의 비삼투성 보호물질로 형성된 세포로 구성된 조직. HR Rules Processes Infra Security
  • 18. 18 MSA Case Study: Process Improvement Hardware Provisioning Waterfall Product Dev IaaS (SW Provisioning) Agile Product Dev PaaS Continuous Delivery SaaSBetter
  • 19. 19 MSA Case Study: Netflx – Agile style Agile style development Email / SMS / Mobile Push / Phone call (Bit scary)
  • 20. 20 MSA Case Study: Netflx Development Cycles • 4 features / 4 weeks VS 2 features / 2 weeks Work in Progress = 4 Opportunity for bugs = 100% (baseline) Time to Debug each = 100% (baseline) Delivery Complexity = 100% (baseline) Work in Progress = 2 Opportunity for bugs = 50% (baseline) Time to Debug each = 50% (baseline) Delivery Complexity = 100 - 25 = 75%
  • 21. 21 Q&A Session Questions, comments, feedback, analysis, etc
  • 22. 22 References 1. An Introduction to Service-Oriented Architecture from a Java Developer Perspective http://archive.oreilly.com/pub/a/onjava/2005/01/26/soa-intro.html 2. Microservices - a definition of this new architectural term http://martinfowler.com/articles/microservices.html 3. What is Microservices Architecture? https://smartbear.com/learn/api-design/what-are-microservices/ 4. Service-oriented architecture (SOA) http://www.tridens.si/expertise/soa/ 5. Vivat SOA diagram http://hyperty.com/portfolio/2008/04/04/vivat-soa/ 6. Pattern: API Gateway http://microservices.io/patterns/apigateway.html 7. The introduction to Reactive Programming you've been missing https://gist.github.com/staltz/868e7e9bc2a7b8c1f754 8. Service Oriented Architecture (SOA) http://tutorials.jenkov.com/soa/soa.html
  • 23. 23 References 9. Adrian Cockcroft Slideshare http://www.slideshare.net/adriancockcroft 10. How Nginx Works https://www.atulhost.com/ngin 11. Cockcroft, the Man Behind Netflix’s Move to AWS, Joins AWS http://www.datacenterknowledge.com/archives/2016/10/25/cockcroft-the-man-behind- netflixs-move-to-aws-joins-aws/ 12. Adopting Microservices at Netflix: Lessons for Architectural Design https://www.nginx.com/blog/microservices-at-netflix-architectural-best-practices/ 13. The Real Success Story of Microservices Architectures http://blog.christianposta.com/microservices/the-real-success-story-of-microservices- architectures/ 14. An Introduction to Service-Oriented Architecture from a Java Developer Perspective http://archive.oreilly.com/pub/a/onjava/2005/01/26/soa-intro.html 15. Why Companies Adopt Microservices And How They Succeed https://medium.com/microhq/why-companies-adopt-microservices-and-how-they-succeed- 2ad32f39c65a#.o6dl9bl0q