Understand:
1. Why Microservice ?
2. What is Microservice ?
3. What do we( Developer,Architect, Business..etc) need ?
4. Technology Comparison
5. Microservice Features
6. Spring Boot Features
7. Microservice Communication
8. Testing
Agenda ● Why Microservice ? ● What is Microservice ? ● What do we( Developer,Architect, Business..etc) need ? ● Technology Comparison ● Microservice Features ● Spring Boot Features ● Microservice Communication ● Testing ● Demo
Problem with Monolithic Architecture ➔ Tightly Coupled ➔ Language dependency ➔ Scalability ➔ Root Cause Analysis ➔ Monitoring ➔ Auditing ➔ Performance Management Integration Layer (Business Logic) Catalog Query Parts Pricing & Availabilit y Quotatio n Order Order Track ORM Database Pricing
What ? “Microservices is a way of breaking large software projects into smaller, independent, and loosely coupled modules. Individual modules are responsible for highly defined and discrete tasks and communicate with other modules through simple, universally accessible APIs.”
Coupling Microservices definitions says that “Microservices is a way of breaking large software projects into smaller, independent, and loosely coupled modules” So, this issue is straightaway solved. Catalog ORM Database Query Parts ORM Database
Language Independent Each service can be developed using different programming language Allows you to take advantage of emerging and latest technologies (framework, programming language , programming practice, etc.). Catalog( Spring Boot ) Spring Data NoSql Query Parts( Apache Karaf ) Hibernate RDBMS
Scalability Since microservices are very small part of the complete software ecosystem, It is very easy to scale the same. Unlike, the monolithic web application, where if we have to do a scaling, first we have to setup the environment ( apache, tomcat ) and then deploy the war/ear files in that.
Scalability with monolithic ... Integration Layer (Business Logic) Catalog Query Parts Pricing & Availabi lity Quotat ion Order Order Track ORM Database Pricing Integration Layer (Business Logic) Catalog Query Parts Pricing & Availabi lity Quotat ion Order Order Track ORM Database
Root Cause Analysis It is always difficult to find the root cause in a Single Large Monolithic system. In microservice, fault isolation would be improved and we can easily identify which service is consuming more memory or cpu and we can scale that service easily and fix the issue ( if any ) later.
Logging Strategy Spring Boot provides us the various way to achieve logging ➔ Using Aspect ➔ Using logback ➔ Annotation based logging ( When an exception occurs )
Monitoring Spring boot comes with it’s own monitoring tool called “Spring Admin Console” We can monitor various aspects like: ➔ Application health ➔ Memory ➔ JVM ➔ Garbage Collection ➔ Metrics etc.. We can also changelog level without restarting of the application. This would help us in debugging any prod issue Sample UI : https://github.com/codecentric/spring-boot-admin
Auditing Auditing would be achieved using AspectJ We can have the information like ➔ Who accessed the URL and from where ➔ How many requests have been successfully served to whom and how many got failed ➔ Which services - How many times - By Whom
Performance Management Until now, We are using several tools to perform this task ● Jconsole ● JvisualVM ● Java Mission Control ( Comes with Java 8 ) ● Logicmonitor (Paid)
Performance Management Every time a new developer/user comes to the environment, we have to educate them to understand each of the tool. Spring Boot gives us a single tool ( Spring Admin Console) to do the performance management as well
Transaction Management Spring gives us various ways to manage the transactions, In which two of them are very popular : ➔ Using Aspects ➔ Annotation Based