KEMBAR78
Microservices in a netshell | ODP
Microservices in a nutshell
Pranjut Gogoi
Senior Software Consultant
Knoldus software LLP
Agenda
● What are microservices?
● Why is it important?
● How is it done?
● Orchestration vs Choreography.
● Pitfalls of microservices.
● Demo.
What are microservices?
“Microservices are small, autonomous services that work together.”
Why is it important?
●
Technology Heterogeneity
●
Resilience
●
Scaling
●
Ease of Deployment
●
Organizational Alignment
●
Composability
●
Optimizing for Replaceability
How does it work?
●
Orchestration architecture
●
Choreography architecture
●
Microservice design patterns
Orchestration
Choreography
Orchestration vs Choreography
An orchestration typically ties together lower level
services. It is like a mediator. A choreography
helps reduce coupling even further.
Design patterns –
Aggregator Pattern
Chained Pattern
Asynchronous Messaging
Pitfalls of microservices
●
Team members don't get any idea what's going on the complete application as
they're more focus on their own module.
●
Understanding the what is microservice and how does it work. There was a case
where an engineer had literally wrapped and hosted one microservice within
another because he didn't understand how the services were supposed to
communicate if they were in separate processes (or on separate machines).
●
Common util module configuration or code sharing among the micro services will
help a lot of work easier but again that could be problem too. There was a case
where one person defined a general abstraction to database library, but the
database library wasn't well encapsulated (in fact it had a transitive dependency on
an older version of our web server - Jetty).
Cont...
●
Its more of a solution, so basically in order to communicate
among the services we need to follow a messaging pattern,
where AMQP and CQRS are two choices. However CQRS is a
preferable pattern as AMQP sometime don't work well. However
that will depend on the requirement of the communication.
●
As microservices increases the devOps burden increases as well,
because each microservice will run in a different jvm and need
to deploy them separately.
Thank You

Microservices in a netshell

  • 1.
    Microservices in anutshell Pranjut Gogoi Senior Software Consultant Knoldus software LLP
  • 2.
    Agenda ● What aremicroservices? ● Why is it important? ● How is it done? ● Orchestration vs Choreography. ● Pitfalls of microservices. ● Demo.
  • 3.
    What are microservices? “Microservicesare small, autonomous services that work together.”
  • 5.
    Why is itimportant? ● Technology Heterogeneity ● Resilience ● Scaling ● Ease of Deployment ● Organizational Alignment ● Composability ● Optimizing for Replaceability
  • 6.
    How does itwork? ● Orchestration architecture ● Choreography architecture ● Microservice design patterns
  • 7.
  • 8.
  • 9.
    Orchestration vs Choreography Anorchestration typically ties together lower level services. It is like a mediator. A choreography helps reduce coupling even further.
  • 11.
  • 12.
  • 13.
  • 14.
    Pitfalls of microservices ● Teammembers don't get any idea what's going on the complete application as they're more focus on their own module. ● Understanding the what is microservice and how does it work. There was a case where an engineer had literally wrapped and hosted one microservice within another because he didn't understand how the services were supposed to communicate if they were in separate processes (or on separate machines). ● Common util module configuration or code sharing among the micro services will help a lot of work easier but again that could be problem too. There was a case where one person defined a general abstraction to database library, but the database library wasn't well encapsulated (in fact it had a transitive dependency on an older version of our web server - Jetty).
  • 15.
    Cont... ● Its more ofa solution, so basically in order to communicate among the services we need to follow a messaging pattern, where AMQP and CQRS are two choices. However CQRS is a preferable pattern as AMQP sometime don't work well. However that will depend on the requirement of the communication. ● As microservices increases the devOps burden increases as well, because each microservice will run in a different jvm and need to deploy them separately.
  • 16.

Editor's Notes

  • #4 Monolithic Microservices are special SOA, Service oriented architecture.
  • #5 If you can't make it good, at least make it look good - Bill Gates O'reilly have this bee picture in their book Honey sealing Drone feeding Queen attendants Honeycomb building
  • #6 Resilience:1. If one component of a system fails, but that failure doesn’t cascade, you can isolate the problem and the rest of the system can carry on working. 2. Simian Army - Chaos monkey for failure testing. Composable: Composability means reusability. Resure the same service for different purpose, native application, web application etc.
  • #10 Orchestration is useful when you have control over all the actors in a process - when they're all in one domain of control and you can dictate the flow of activities. This is of course most often when you're specifying a business process that will be enacted inside one organisation that you have control over. Choreography is a way of specifying how two or more parties - none of which has any control over the other parties' processes, or perhaps any visibility of those processes - can coordinate their activities and processes to share information and value. Use choreography when coordination across domains of control/visibility is required. You can think of choreography, in a simple scenario, as like a network protocol. It dictates acceptable patterns of requests and responses between parties.
  • #11 Our application is almost built on this except each servcice each database.
  • #12 Our application is almost built on this except each servcice each database.
  • #13 The key part to remember is that the client is blocked until the complete chain of request/response There are more to it. But I found good quality images for this two only. Proxy pattern – which is almost like the aggregator pattern. Branch Microservice. Shared data microservice. Asynchonous messaging
  • #14 The key part to remember is that the client is blocked until the complete chain of request/response There are more to it. But I found good quality images for this two only. Proxy pattern – which is almost like the aggregator pattern. Branch Microservice. Shared data microservice. Asynchonous messaging
  • #15 Resilience:1. If one component of a system fails, but that failure doesn’t cascade, you can isolate the problem and the rest of the system can carry on working. 2. Simian Army - Chaos monkey for failure testing. Composable: Composability means reusability. Resure the same service for different purpose, native application, web application etc.
  • #16 Resilience:1. If one component of a system fails, but that failure doesn’t cascade, you can isolate the problem and the rest of the system can carry on working. 2. Simian Army - Chaos monkey for failure testing. Composable: Composability means reusability. Resure the same service for different purpose, native application, web application etc.