SlideShare a Scribd company logo
Microservices
CS2310 Seminar
Jiaye Zhu
Contents
● What is Microservice
● Why should we use Microservice
● Where should we use Microservice
● When should we use Microservice
● How to use Microservice
● Discussion
● References
What is Microservice
Microservice architecture split Business Logic and Data Access Layer into several small part called Microservices.
Real business logic and Data access are implemented by invoking multiple different microservices distributed on different nodes.
Why should we use Microservice
Scalability —— Distribution
You don’t need to have one very powerful server to run your application. Instead you could use several relatively weaker servers and run different microservices on
each of them. The system will have better IO performance since the tasks are distributed and can be done simultaneously.
By combinng microservice with edge computing, you can take advantage of IOT devices like raspberry pi or arduino to provide service locally for users.
Why should we use Microservice
Scalability —— Non-uniform Scaling
Monolithic Architecture Microservice Architecture
The bottleneck may only exist in some part of the application like request handling. It makes no sense to replicate the whole application for just improving request handling
performance.
In Microservice architecture, we can do non-uniform scaling by deploying multiple instance of particular service so we can get higher utilization with less server resource.
Why should we use Microservice
Scalability —— Portability
Microservice architecture has very good portability by using container technology like Docker
Why should we use Microservice
Scalability —— Portability
Traditional Virtual Machines Containers
Using Docker doesn’t need to waste resource on duplicated Guest operating system. Docker can also run on ARM devices like raspberry pi which is almost
impossible to run virtual machines. By using container technology, microservice can have extremely high utilization of all kind of hardware resources.
Why should we use Microservice
Scalability —— Elasticity
When there are not so many requests, the server load is low, and it can stop those unnecessary replicas of services and shutting down some servers to save power and
reduce the stress of cooling system. When the request increase, the server could automatically deploy new containers to provide service according to the metrics like
response time. When the request number increasing speed hit some threshold or if our machine learning model predicted that there will be a heavy load, the system could
boot some servers for more resource to deploy microservice. vice versa
Why should we use Microservice
Scalability —— Availability
When updating the application, we don’t have to shutdown the whole application and then deploy the new one.
by using microservice architecture, we just need a little bit of extra resource for the service we are going to update.
Why should we use Microservice
Scalability —— Robustness
If one server has hardware failure like hardware broken or power cut. other servers could still provide all the services.
Where should we use Microservice
Do you heavily rely on in-memory state?
monolithic system microservices system
In monolithic system, you can take advantage of in-memory state like storing session in memory and mapping request according to the session record in almost no-
latency using hashmap. But in microservice, because of the distribution, services can not share memory data. All microservice should be designed as stateless functions.
If you heavily rely on in-memory state or can not accept the latency caused by the data sharing in the distributed microservice architecture, you shouldn’t use
microservice here.
Where should we use Microservice
Do you heavily rely on transactions?
monolithic system microservices system
To implement transaction in a microservice system is very hard comparing to a monolithic system.
Where should we use Microservice
Two-phase commit (2pc) pattern
Usually, people use a technique called two-phase commit to simulate transaction in microservice architecture. It has a prepare phase and commit phase to ensure the the
eventual consistency. It will be more complicated if there is some error and cause a rollback. So If you don’t want to deal with the two phase commit in distributed transaction,
you shouldn’t use microservice here. But other parts can still be splited into different microservices.
When should we use Microservice
How to use Microservice
Programming language doesn’t matter
You can use any programming language you want as long as you can provide solid API documentation so other services can communicate with it and
invoke the service properly.
How to use Microservice
In this architecture, Microsoft uses rabbitMQ and AzureService Bus as the eventbus middleware for data/message sharing between all the microservices.
Using message queue can change the business logic from synchronized logic to asynchronized logic and result in a better io performance.
Discussion
Positive
● Very strong scalability
○ Distribution
○ Non-uniform Scaling
○ Portability
○ Elasticity
○ Availability
○ Robustness
● Programming language doesn’t matter, easy to find a developer to build microservices
● For a complex system, microservice architecture has higher productivity
● Easy to learn, even intern developers can also develop functional and bugless
microservice with proper unit test.
● Agile friendly
Discussion
Negative
● The granularity of a microservice architecture is hard to decide
● Microservice need more precise documentation
● Microservice need more experienced System Operator
● Microservice should be integrated with Continuous Integration (CI) and Continuous
Delivery (CD) otherwise it will cost too much human resource in maintenance
Discussion
NO SILVER BULLET
Reference
● Dragoni, N., Lanese, I., Larsen, S. T., Mazzara, M., Mustafin, R., & Safina, L. (2017, June).
Microservices: How to make your application scale. In International Andrei Ershov
Memorial Conference on Perspectives of System Informatics (pp. 95-104). Springer,
Cham.
● Hasselbring, W., & Steinacker, G. (2017, April). Microservice architectures for scalability,
agility and reliability in e-commerce. In 2017 IEEE International Conference on Software
Architecture Workshops (ICSAW) (pp. 243-246). IEEE.
● Anderson, C. (2015). Docker [software engineering]. IEEE Software, 32(3), 102-c3.
● Dragoni, N., Giallorenzo, S., Lafuente, A. L., Mazzara, M., Montesi, F., Mustafin, R., & Safina,
L. (2017). Microservices: yesterday, today, and tomorrow. In Present and ulterior
software engineering (pp. 195-216). Springer, Cham.
Thank you!
If you have any questions about microservice,
please feel free to send me email.

More Related Content

PDF
A Guide on What Are Microservices: Pros, Cons, Use Cases, and More
PPTX
MicroserviceArchitecture in detail over Monolith.
PPTX
Microservice's in detailed
PDF
Microservices in Practice
PPTX
Software Architectures, Week 3 - Microservice-based Architectures
PDF
Microservices architecture enterprise architecture
PPTX
Microservices
PPTX
AppDev with Microservices
A Guide on What Are Microservices: Pros, Cons, Use Cases, and More
MicroserviceArchitecture in detail over Monolith.
Microservice's in detailed
Microservices in Practice
Software Architectures, Week 3 - Microservice-based Architectures
Microservices architecture enterprise architecture
Microservices
AppDev with Microservices

Similar to About microservices on cloud computing services (20)

PDF
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
PDF
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
PDF
Docebo: history of a journey from legacy to serverless
PPTX
Microsoft Microservices
PPTX
Microservice Architecture Software Architecture Microservice Design Pattern
PDF
Microservices for Application Modernisation
PDF
'How to build efficient backend based on microservice architecture' by Anton ...
PPTX
Micro Services
PPTX
Mykhailo Hryhorash: Архітектура IT-рішень (Частина 1) (UA)
PDF
Basics of Java Microservices: Frameworks, Examples & Use Cases
PDF
Microservices: Detailed Guide
PPTX
Microservice Pattern Launguage
PPTX
اساليب البرمجيات الحديثة Modern Software Development
PDF
Introduction to Microservices.pdf
PDF
Building a High-Performance Reactive Microservices Architecture
PDF
Building microservices on azure
PDF
Pitfalls & Challenges Faced During a Microservices Architecture Implementation
PDF
Microservices Tutorial for Beginners | All You Need to Get Started
PDF
Building Microservices with Ruby on Rails: Maximizing Efficiency and Scalability
PDF
[APIdays Paris 2019] API Management in Service Mesh Using Istio and WSO2 API ...
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
SELECTION MECHANISM OF MICRO-SERVICES ORCHESTRATION VS. CHOREOGRAPHY
Docebo: history of a journey from legacy to serverless
Microsoft Microservices
Microservice Architecture Software Architecture Microservice Design Pattern
Microservices for Application Modernisation
'How to build efficient backend based on microservice architecture' by Anton ...
Micro Services
Mykhailo Hryhorash: Архітектура IT-рішень (Частина 1) (UA)
Basics of Java Microservices: Frameworks, Examples & Use Cases
Microservices: Detailed Guide
Microservice Pattern Launguage
اساليب البرمجيات الحديثة Modern Software Development
Introduction to Microservices.pdf
Building a High-Performance Reactive Microservices Architecture
Building microservices on azure
Pitfalls & Challenges Faced During a Microservices Architecture Implementation
Microservices Tutorial for Beginners | All You Need to Get Started
Building Microservices with Ruby on Rails: Maximizing Efficiency and Scalability
[APIdays Paris 2019] API Management in Service Mesh Using Istio and WSO2 API ...
Ad

Recently uploaded (20)

PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
RMMM.pdf make it easy to upload and study
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Complications of Minimal Access Surgery at WLH
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Presentation on HIE in infants and its manifestations
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
Pharmacology of Heart Failure /Pharmacotherapy of CHF
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
O5-L3 Freight Transport Ops (International) V1.pdf
RMMM.pdf make it easy to upload and study
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Complications of Minimal Access Surgery at WLH
A systematic review of self-coping strategies used by university students to ...
Final Presentation General Medicine 03-08-2024.pptx
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
VCE English Exam - Section C Student Revision Booklet
102 student loan defaulters named and shamed – Is someone you know on the list?
Microbial diseases, their pathogenesis and prophylaxis
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Presentation on HIE in infants and its manifestations
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
Pharmacology of Heart Failure /Pharmacotherapy of CHF
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Ad

About microservices on cloud computing services

  • 2. Contents ● What is Microservice ● Why should we use Microservice ● Where should we use Microservice ● When should we use Microservice ● How to use Microservice ● Discussion ● References
  • 3. What is Microservice Microservice architecture split Business Logic and Data Access Layer into several small part called Microservices. Real business logic and Data access are implemented by invoking multiple different microservices distributed on different nodes.
  • 4. Why should we use Microservice Scalability —— Distribution You don’t need to have one very powerful server to run your application. Instead you could use several relatively weaker servers and run different microservices on each of them. The system will have better IO performance since the tasks are distributed and can be done simultaneously. By combinng microservice with edge computing, you can take advantage of IOT devices like raspberry pi or arduino to provide service locally for users.
  • 5. Why should we use Microservice Scalability —— Non-uniform Scaling Monolithic Architecture Microservice Architecture The bottleneck may only exist in some part of the application like request handling. It makes no sense to replicate the whole application for just improving request handling performance. In Microservice architecture, we can do non-uniform scaling by deploying multiple instance of particular service so we can get higher utilization with less server resource.
  • 6. Why should we use Microservice Scalability —— Portability Microservice architecture has very good portability by using container technology like Docker
  • 7. Why should we use Microservice Scalability —— Portability Traditional Virtual Machines Containers Using Docker doesn’t need to waste resource on duplicated Guest operating system. Docker can also run on ARM devices like raspberry pi which is almost impossible to run virtual machines. By using container technology, microservice can have extremely high utilization of all kind of hardware resources.
  • 8. Why should we use Microservice Scalability —— Elasticity When there are not so many requests, the server load is low, and it can stop those unnecessary replicas of services and shutting down some servers to save power and reduce the stress of cooling system. When the request increase, the server could automatically deploy new containers to provide service according to the metrics like response time. When the request number increasing speed hit some threshold or if our machine learning model predicted that there will be a heavy load, the system could boot some servers for more resource to deploy microservice. vice versa
  • 9. Why should we use Microservice Scalability —— Availability When updating the application, we don’t have to shutdown the whole application and then deploy the new one. by using microservice architecture, we just need a little bit of extra resource for the service we are going to update.
  • 10. Why should we use Microservice Scalability —— Robustness If one server has hardware failure like hardware broken or power cut. other servers could still provide all the services.
  • 11. Where should we use Microservice Do you heavily rely on in-memory state? monolithic system microservices system In monolithic system, you can take advantage of in-memory state like storing session in memory and mapping request according to the session record in almost no- latency using hashmap. But in microservice, because of the distribution, services can not share memory data. All microservice should be designed as stateless functions. If you heavily rely on in-memory state or can not accept the latency caused by the data sharing in the distributed microservice architecture, you shouldn’t use microservice here.
  • 12. Where should we use Microservice Do you heavily rely on transactions? monolithic system microservices system To implement transaction in a microservice system is very hard comparing to a monolithic system.
  • 13. Where should we use Microservice Two-phase commit (2pc) pattern Usually, people use a technique called two-phase commit to simulate transaction in microservice architecture. It has a prepare phase and commit phase to ensure the the eventual consistency. It will be more complicated if there is some error and cause a rollback. So If you don’t want to deal with the two phase commit in distributed transaction, you shouldn’t use microservice here. But other parts can still be splited into different microservices.
  • 14. When should we use Microservice
  • 15. How to use Microservice Programming language doesn’t matter You can use any programming language you want as long as you can provide solid API documentation so other services can communicate with it and invoke the service properly.
  • 16. How to use Microservice In this architecture, Microsoft uses rabbitMQ and AzureService Bus as the eventbus middleware for data/message sharing between all the microservices. Using message queue can change the business logic from synchronized logic to asynchronized logic and result in a better io performance.
  • 17. Discussion Positive ● Very strong scalability ○ Distribution ○ Non-uniform Scaling ○ Portability ○ Elasticity ○ Availability ○ Robustness ● Programming language doesn’t matter, easy to find a developer to build microservices ● For a complex system, microservice architecture has higher productivity ● Easy to learn, even intern developers can also develop functional and bugless microservice with proper unit test. ● Agile friendly
  • 18. Discussion Negative ● The granularity of a microservice architecture is hard to decide ● Microservice need more precise documentation ● Microservice need more experienced System Operator ● Microservice should be integrated with Continuous Integration (CI) and Continuous Delivery (CD) otherwise it will cost too much human resource in maintenance
  • 20. Reference ● Dragoni, N., Lanese, I., Larsen, S. T., Mazzara, M., Mustafin, R., & Safina, L. (2017, June). Microservices: How to make your application scale. In International Andrei Ershov Memorial Conference on Perspectives of System Informatics (pp. 95-104). Springer, Cham. ● Hasselbring, W., & Steinacker, G. (2017, April). Microservice architectures for scalability, agility and reliability in e-commerce. In 2017 IEEE International Conference on Software Architecture Workshops (ICSAW) (pp. 243-246). IEEE. ● Anderson, C. (2015). Docker [software engineering]. IEEE Software, 32(3), 102-c3. ● Dragoni, N., Giallorenzo, S., Lafuente, A. L., Mazzara, M., Montesi, F., Mustafin, R., & Safina, L. (2017). Microservices: yesterday, today, and tomorrow. In Present and ulterior software engineering (pp. 195-216). Springer, Cham.
  • 21. Thank you! If you have any questions about microservice, please feel free to send me email.

Editor's Notes

  • #2: Hello everyone. Today I’m going to talk about microservices
  • #3: In this seminar, I’m going to talk about these things:
  • #4: So, what is microservice? Microservice is a kind of software architecture. To understand it, we need to see the traditional Monolithic Architecture first. In Monolithic Architecture, usually all things are developed in one application including UI components, Business Logic, and Data Access Layer. And usually that application is deploied on one server node. However, microservice architecture split Business Logic and Data Access Layer into several small part called Microservices. Real business logic and Data access are implemented by invoking multiple different microservices distributed on different nodes.
  • #5: So, why should we use Microservice? Comparing to the traditional monolithic architecture, Microservice has much stronger scalability. First, It really benefit from the distributtion. You don’t need to have one very powerful server to run your application anymore. Instead you could use several relatively weaker servers and run different microservices on each of them. The system will have better IO performance since the tasks are distributed and can be done simultaneously. And by combinng microservice with edge computing, you can take advantage of IOT devices like raspberry pi or arduino to provide service locally for users.
  • #6: Microservice is also good because of its ability of non-uniform scaling. For traditional monolithic architecture, if we want to scale the application for whatever reason, we have to scale it as a whole application. But actually the bottleneck may only exist in some part of the application like request handling. It make no sense to replicate the whole application for just improving request handling performance. In Microservice architecture, we can do non-uniform scaling by deploying multiple instance of particular service so we can get higher utilization with less server resource.
  • #7: So one question here is, how are we going to better utilize all the devices we have to provide services? It would be a nightmare if we need to deploy application using different environments or even on different CPU architecture like ARM. Luckily, Microservice architecture has very good portability by using container technology like Docker. Docker is an open platform for developing, shipping, and running applications. Docker enables you to separate your applications from your infrastructure so you can deliver software quickly.
  • #8: Comparing to the traditional Virtual Machines way to utilize server resource, container technology doesn’t need to waste resource on duplicated Guest operating system. but it still provide isolated environment for different application, so complex software environment will never be a problem anymore. Besides, Docker can also run on ARM devices like raspberry pi which is almost impossible to run virtual machines. By using container technology, microservice can have extremely high utilization of all kind of hardware resources.
  • #9: Another benifit of Microservice is it’s elasticity. When there are not so many requests, the server load is low and it can stop those unnecessary replicas of services and shutting down some servers to save power and reduce the stress of cooling system. When the request increase, the server could automatically deploy new containers to provide service according to the metrics like response time. When the request number increasing speed hit some threshold or if our machine learning model predicted that there will be a heavy load, the system could boot some servers for more resource to deploy microservice. vice versa All these scaling can be done automatically, this could help the companies to save a lot of money and help the world to save a lot of power and reduce carbon emission.
  • #10: Because of the scalability, the microservice architecture usually have high availability. An common case in software engineering is updating the application. If we use monolithic architecture, we have to shutdown the whole application and then deploy the new one. Yes we can use a replica of the application to provide all services during the update but that will need double hardware resources. However, by using microservice architecture, we just need a little bit of extra resource for the service we are going to update. If there are multiple services need to be updated, we can update them one by one and still we only need a little bit of extra resource. If we use canary release for updating the service, we can even use zero extra resource.
  • #11: With all the features I’ve talked about before, the microservice architecture is very robust. If one server has hardware failure like hardware broken or power cut. other servers could still provide all the services. All the services exist on the failed server could be automatically re-deployed on the rest servers so the total number of service nodes will keep the same and the performance of the whole system will not be affected.
  • #12: After knowing all these benefit of microservice, we need also know where should we use microservice. In most cases you can always use microservice for the whole system to get a good scalability and performance. But there are two problems you need to be careful with. First problem we need to consider is: Do you heavily rely on in-memory state? In monolithic system, you can take advantage of in-memory state like storing session in memory and mapping request according to the session record in almost no-latency using hashmap. but in microservice, because of the distribution, services can not share memory data. All microservice should be designed as stateless functions. Although different services can share data using middlewares like message queue, there will be some latency. If you heavily rely on in-memory state or can not accept the latency caused by the data sharing in the distributed microservice architecture, you shouldn’t use microservice here.
  • #13: Another big problem is transaction. If your business logic is heavily rely on transactions, you may not use microservice here. To implement transaction in a microservice system is very hard comparing to a monolithic system.
  • #14: Usually, people use a technique called two-phase commit to simulate transaction in microservice architecture. It has a prepare phase and commit phase to ensure the the eventual consistency. It will be more complicated if there is some error and cause a rollback. So If you don’t want to deal with the two phase commit in distributed transaction, you shouldn’t use microservice here. But other parts can still be splited into different microservices.
  • #15: Here comes the question about when should we use Microservice. Comparing to the monolithic architecture, the microservice architecture have lower productivity at first. That’s because microservice need a certain amount of management so it can’t start with relatively high productivity. while monolithic system not quite need those management at the beginning since the system is simple enough so writing it is as simple as writing a simple microservice When the complexity of the system growth and hit some threshold, the productivity of monolithic system and microservice system will become the same. After that, because of the decreased coupling of microservices reduces the attenuation of productivity, but the monolithic system’s productivity will drop rapidly when complexity growth. It’s the time to switch to microservice architecture.
  • #16: In microservice architecture, programming language usually doesn’t matter. You can use any programming language you want as long as you can provide solid API documentation so other services can communicate with it and invoke the service properly. Here is a microservice architecture example given by microsoft. you can see it uses many different languages like C#, JS, Python, Java,signalR,F#, and golang.
  • #17: Here is a overview of an eshop application using microservice architecture also provided by microsoft. you can pause at here and spend some time looking at the diagram and learn this architecture. Notice that in this architecture, microsoft uses rabbitMQ and AzureService Bus as the eventbus middleware for data/message sharing between all the microservices. Using message queue can change the business logic from synchronized logic to asynchronized logic and result in a better io performance.
  • #18: so here is the discussion part. I think microservice architecture has these following advantages: As mentioned before, it has very strong scalability, and the developers can choose whatever language they prefer to build microservices. For a complex system, microservice architecture usually has higher productivity. And writing a microservice is very easy. I think even intern developers can also develop functional and bugless microservice with proper unit test. Also, microservice architecture is agile-friendly. it’s very common to use one or two sprint to develop, evaluate, and improve a microservice.
  • #19: But also microservice architecture has some disadvantages and we need to treat these problems carefully. The biggest problem is the granularity of a microservice architecture is hard to decide. If the granularity is too low, it can not take advantage of the scalability of microservice because it will looks more like a monolithic system. but if the granularity is too high, there will be too many message exchanges happen in the eventbus and cause a large latency. The dependencies will also become much more complex and make it harder to manage. Besides, microservice architecture needs more precise and solid documentation otherwise the invoke chain will be unclear and the whole system may be out of control when its complexity grow. Because of the management is harder than a monolithic system, microservice architecture needs more experienced system operator. And the microservice should be integrated with continuous integration and continuous delivery to do a lot of jobs automatically otherwise it will cost too much human resource in maintenance.
  • #20: In the end, I want to say that there is no silver bullet in software engineering. we can never find an architecture which can meet all the requirement without any weak points and extra cost. Understanding microservice architecture is just giving you another choice when you are designing a software architecture.