Microservice Architecture
Hadi Rasouli
srbiau.ac.ir
December 2017
1
Agenda
• Introduction
• What is Monolithic?
• What is Microservice?
• Microservice vs Monolithic.
• Why Microservices?
• Challenges in Microservices Architecture
• Are Microservices just SOA?
• Monolithic vs. SOA vs. Microsercices.
• Microservices Architecture Analysis
• Develop and Deployment
• Common questions.
• Monitoring in Microservices
• Implementation
2
Introduction
3
What is Monolithic?
4
What is Microservice?
5
What is Microservice? Contd.
6
Microservice
“Is an architectural style that structures an application as a collection of
loosely coupled services, which implement business capabilities”,
Chris Richardson
What is Microservice? Contd.
• What is micro?
• How big is a micro?
• Common characteristics
• What Capabilities Microservices give us?
• Organization structure in micro services
• ( teams are working on there on task) business organization
7
What is Microservice? Contd.
• What is micro?
• How big is a micro?
• Common characteristics
• What Capabilities Microservices give us?
• Organization structure in micro services
• ( teams are working on there on task) business organization
8
What is Microservice? Contd.
• What is micro?
• How big is a micro?
• Common characteristics
• What Capabilities Microservices give us?
• Organization structure in micro services
• ( teams are working on there on task) business organization
9
What is Microservice? Contd.
• Common characteristics:
1. They encapsulate a customer or business scenario.
2. They are developed by a small development team.
3. They can be written in any programming language and use any framework.
4. OOPS concept is implemented in loosely coupled manner
5. The Codebase is small that are independently versioned, deployed, and scaled.
6. They interact with other Microservices over well-defined interfaces and protocols.
7. They have unique names (URLs) that can be used to resolve their location.
8. Decentarlized data management
10
What is Microservice? Contd.
• What is micro
• How big is a micro?
• Common characteristics
• What Capabilities Microservices give us?
• Organization structure in micro services
• ( teams are working on there on task) business organization
11
What is Microservice? Contd.
• What Capabilities Microservices give us:
1. Develop different services independently
2. Deploy different services independently
3. Test different services independently
12
What is Microservice? Contd.
• What is micro
• How big is a micro?
• Common characteristics
• What Capabilities Microservices give us?
• Organization structure in Microservices
13
Microservices vs Monolithic
14
Why Microservices?
• Evolutionary Design – No need to rewrite your whole application.
• Small Codebase – Each Microservice deals with one concern(SoC) only –easier maintainability.
• Auto Scale – freedom to scale only the loaded service, as that service will handle the bigger load.
• Easy to Deploy – Deploy only the needed codebase, instead of redeploying the entire application.
• System Resilience – If some of the services go down only some features will be affected, not the
entire application.
15
Challenges in Microservices Architecture
• Inter Service Communication – Microservices will rely on each other and they will have to
communicate. A common communication channel needs to be framed using HTTP/ESB etc.
• Health Monitoring – There are more services to monitor which may be developed using different
programming languages.
• Transaction Spanning – Microservices may result in spanning of transactions over multiple
services & database. An issues caused somewhere will result is some other issues somewhere else.
• Distributed logging – Different services will have its own logging mechanism.
• Queries that needs joins and … !?. (in database per service pattern)
16
Are Microservices just SOA?
• Both architectures have similar pros and cons and some differences.
• But: What is SOA?
A Service Oriented Architecture is a software architecture pattern, which application
components provide services to other components via a communications protocol over
a network.
• Microservice is simply an ideal, refined form of SOA.
• In Microservices:
• No ESB
• Fine-grained services
• No shared store
17
Are Microservices just SOA? Contd.
18
Monolithic vs. SOA vs. Microsercices
19
Microservices Architecture Analysis
21
• Agility : High
• Ease of deployment : High
• Testability : High
• Performance : Low
• Scalability : High
• Ease of development : High
Develop and Deployment
• We need to have a basic grasp of the following concepts:
• Object Oriented Programming (OOP) with loose coupling techniques — such DI.
• Web service / API/ REST— a way to expose the functionality of your application to others,
without a user interface.
• Service Oriented Architecture (SOA) — a way of structuring many related applications to
work together, rather than trying to solve all problems in one application.
• Single Responsibility Principle (SRP)—the idea of code with one focus.
• Interface Segregation Principle (ISP)—the idea of code with defined boundaries.
• DevOps Culture- it’s necessary.
• We can use any language/technology for purposes in each micro’s.
22
Monitoring in Microservices
• Monitoring in Microservices is an urgent
23
Monitoring in Microservices is an urgent. Contd.
24
Common questions
• Only one database?
• What if the database is down?
• All services will be hosted in a single server?
• What if I need to upgrade the server?
25
Implementation
26
Conclusion
• Microservices architectural style is an important idea – one worth serious consideration for enterprise applications.
• A Monolithic architecture is useful for simple, lightweight applications. It will be a maintenance nightmare if used for
complex applications.
• The Microservices architecture pattern is the better choice for complex, evolving applications despite the drawbacks and
implementation challenges.
• Microservices is prevalent for a long time and recently we are seeing increase in their popularity. There are a
number of factors that lead to this trend with scalability being probably the most important one.
• Utilization of Microservices by “big guys” like Amazon, NetFlix, eBay, and others, provides enough
confidence that this architectural style is here to stay.
27
Any Quession?
28
Thanks for your attention.
29

Microserces Architecture

  • 1.
  • 2.
    Agenda • Introduction • Whatis Monolithic? • What is Microservice? • Microservice vs Monolithic. • Why Microservices? • Challenges in Microservices Architecture • Are Microservices just SOA? • Monolithic vs. SOA vs. Microsercices. • Microservices Architecture Analysis • Develop and Deployment • Common questions. • Monitoring in Microservices • Implementation 2
  • 3.
  • 4.
  • 5.
  • 6.
    What is Microservice?Contd. 6 Microservice “Is an architectural style that structures an application as a collection of loosely coupled services, which implement business capabilities”, Chris Richardson
  • 7.
    What is Microservice?Contd. • What is micro? • How big is a micro? • Common characteristics • What Capabilities Microservices give us? • Organization structure in micro services • ( teams are working on there on task) business organization 7
  • 8.
    What is Microservice?Contd. • What is micro? • How big is a micro? • Common characteristics • What Capabilities Microservices give us? • Organization structure in micro services • ( teams are working on there on task) business organization 8
  • 9.
    What is Microservice?Contd. • What is micro? • How big is a micro? • Common characteristics • What Capabilities Microservices give us? • Organization structure in micro services • ( teams are working on there on task) business organization 9
  • 10.
    What is Microservice?Contd. • Common characteristics: 1. They encapsulate a customer or business scenario. 2. They are developed by a small development team. 3. They can be written in any programming language and use any framework. 4. OOPS concept is implemented in loosely coupled manner 5. The Codebase is small that are independently versioned, deployed, and scaled. 6. They interact with other Microservices over well-defined interfaces and protocols. 7. They have unique names (URLs) that can be used to resolve their location. 8. Decentarlized data management 10
  • 11.
    What is Microservice?Contd. • What is micro • How big is a micro? • Common characteristics • What Capabilities Microservices give us? • Organization structure in micro services • ( teams are working on there on task) business organization 11
  • 12.
    What is Microservice?Contd. • What Capabilities Microservices give us: 1. Develop different services independently 2. Deploy different services independently 3. Test different services independently 12
  • 13.
    What is Microservice?Contd. • What is micro • How big is a micro? • Common characteristics • What Capabilities Microservices give us? • Organization structure in Microservices 13
  • 14.
  • 15.
    Why Microservices? • EvolutionaryDesign – No need to rewrite your whole application. • Small Codebase – Each Microservice deals with one concern(SoC) only –easier maintainability. • Auto Scale – freedom to scale only the loaded service, as that service will handle the bigger load. • Easy to Deploy – Deploy only the needed codebase, instead of redeploying the entire application. • System Resilience – If some of the services go down only some features will be affected, not the entire application. 15
  • 16.
    Challenges in MicroservicesArchitecture • Inter Service Communication – Microservices will rely on each other and they will have to communicate. A common communication channel needs to be framed using HTTP/ESB etc. • Health Monitoring – There are more services to monitor which may be developed using different programming languages. • Transaction Spanning – Microservices may result in spanning of transactions over multiple services & database. An issues caused somewhere will result is some other issues somewhere else. • Distributed logging – Different services will have its own logging mechanism. • Queries that needs joins and … !?. (in database per service pattern) 16
  • 17.
    Are Microservices justSOA? • Both architectures have similar pros and cons and some differences. • But: What is SOA? A Service Oriented Architecture is a software architecture pattern, which application components provide services to other components via a communications protocol over a network. • Microservice is simply an ideal, refined form of SOA. • In Microservices: • No ESB • Fine-grained services • No shared store 17
  • 18.
    Are Microservices justSOA? Contd. 18
  • 19.
    Monolithic vs. SOAvs. Microsercices 19
  • 20.
    Microservices Architecture Analysis 21 •Agility : High • Ease of deployment : High • Testability : High • Performance : Low • Scalability : High • Ease of development : High
  • 21.
    Develop and Deployment •We need to have a basic grasp of the following concepts: • Object Oriented Programming (OOP) with loose coupling techniques — such DI. • Web service / API/ REST— a way to expose the functionality of your application to others, without a user interface. • Service Oriented Architecture (SOA) — a way of structuring many related applications to work together, rather than trying to solve all problems in one application. • Single Responsibility Principle (SRP)—the idea of code with one focus. • Interface Segregation Principle (ISP)—the idea of code with defined boundaries. • DevOps Culture- it’s necessary. • We can use any language/technology for purposes in each micro’s. 22
  • 22.
    Monitoring in Microservices •Monitoring in Microservices is an urgent 23
  • 23.
    Monitoring in Microservicesis an urgent. Contd. 24
  • 24.
    Common questions • Onlyone database? • What if the database is down? • All services will be hosted in a single server? • What if I need to upgrade the server? 25
  • 25.
  • 26.
    Conclusion • Microservices architecturalstyle is an important idea – one worth serious consideration for enterprise applications. • A Monolithic architecture is useful for simple, lightweight applications. It will be a maintenance nightmare if used for complex applications. • The Microservices architecture pattern is the better choice for complex, evolving applications despite the drawbacks and implementation challenges. • Microservices is prevalent for a long time and recently we are seeing increase in their popularity. There are a number of factors that lead to this trend with scalability being probably the most important one. • Utilization of Microservices by “big guys” like Amazon, NetFlix, eBay, and others, provides enough confidence that this architectural style is here to stay. 27
  • 27.
  • 28.
    Thanks for yourattention. 29

Editor's Notes

  • #14 ( teams are working on there on task) business organization
  • #23 Web service / API/ REST—a way to expose the functionality of your application to others, without a user interface https://medium.com/@rasuli.hadi4/the-single-responsibility-principle-31483d431c99
  • #27 long with the SSAL’s threads (RequestGenerator, SLDs, SLS, etc.), the QSLB uses additional threads to implement the coordinator functionality (The Coordinator thread), to receive messages asynchronously from the other QSLBs (Message Receiver thread), to monitor the QoS parameters and estimate the cluster capacity needed to improve the QoS (Benchmark Tracker thread). All the external entities (Model-Controller Service, State Consolidator, Event Notification Service, etc.) the QSLB interacts with are registered with a naming service (RMI Registry) and the QSLB searches in the naming service to get the handles to interact with the external entities.