"Welcome To Ashok IT" "Spring Boot and MicroServices" Topic : MicroServices Date : 18/01/2025 (Session - 105) _____________________________________________________________________________________________________________________________ ****************************** Introduction To MicroServices ****************************** 1) What is Monolithic Architecture? 2) Examples on Monolithic Architecture Based Applications? 3) Advantages of Monolithic Architecture 4) Disadvantages of Monolithic Architecture Introduction ============ * Project means Collection of different Modules. * Inorder to develop the project traditional we need to following software development model i.e.,Monolithic Architecture/Monolithic Application. * A Monolithic Application is built as a single unit. * All functionailities of a project exists in a single code base/Single WAR File, then that application known as monolithic Application. Example : Banking Application ============================= * Banking Application contains several Modules 1) customer Module :::::: Maintaining the Customer Related Informations 2) Payment Module :::::: Maintaining the Customer Payments Related Information 3) Balance Module :::::: Maintaining the Customer Related Balance Information 4) Insurance Module ::::: Maintaining the Customer Related Insurance Information 5) Transaction Module:::: Maintaining the Customer related Transaction Information 6) Security Module :::::: Authentication & Authorization 7) Loans Module :::::::: Maintaining the Customer Related loans information Advantages of Monolithic Application ==================================== 1) Simple For develop ===================== * At the beginning of a project it is much easier to got with Monolithic Architecture. 2) Simple to Test ================== * You can implement end-to-end testing by simply launching the application and testing application through UI (or) testing application through selenium. 3) Simple to Deploy =================== * One War file only we have to deploy. 4) Easy for Scaling =================== * Simple to scale horizontally by running multiple copies of an application using Load Balancer. Disadvantages of Monolithic Application ======================================= 1) Maintenance ============== * If Application is too large and complex to understand entirely, It is challenging to make changes fast and correctly. 2) The size of application is rapidly increasing will become slow down the start-up time. 3) For any kind of small change happened in particular module definetly we must deploy the entire application. 4) If there is bug in one module,then it leads to entire application will go down. 5) Monolithic application having some difficulty to adopt and adhere new and advanced technologies. 6) Monolithic application development quick releases are not possible. Microservices ============= * Microservices is not a technology * Microservices is not a framework * Microservices is not an API * Microservices is an Architetural Design Pattern. * Microservices design pattern came into market to avoid the problems of Monolithic Architecture. * The Main aim of Microservices architecture is "Divide & Conqure" Model.' Advantages of Microservices =========================== 1) Easy Maintanience ==================== * As we are dividing our project functionality into multiple microservices it is easy to maintain. 2) Faster Releases ================== * As we are developing limited functionality very quickly we can complete development and testing immediately and we can release quickly our microservices. 3) Parallel Development ======================= * Multiple teams can work on multiple micro services development parallely. 4) Adopting the new technology ============================= * There is no rule saying that all microservices should be implemented using same programming language. * We can use different technologies for developing microservices 5) Easy Scaling ================ * We can sale our microservices based projects easily. Micro Service Architecture ========================== * Micro services is an architectural Design pattern used for developing the project as set of loosely coupled services and this can be implemented using Spring Boot + Spring Cloud + Other Tools(R&D Server,API Gateway,Logging&Tracing,Server config etc.,) * Every Module in the project will be developed as seperate microservice in the form of spring rest controller which support of spring boot environment. * Onces the micro Service architecture project is ready and it will be deployed in cloud environment like AWS/GCP/Azure/PCF etc., * After developing each micro service as seperate Spring Rest App/Project it must be published in common place called R & D Server(Registery and Discovery Server) like Netfilx Eureka Server. * One Micro service can find an communicate with another micro service only when it is published in R&D Server. * The Common Properties and with same values of multiple microservices can be placed outside the microservice called config server like GitHub. * If any exception is raised in the execution of one microservices then it has to be informed to admin UI/Dashboard with the support of Circult breaker. * If any microservice is having more demand then we allow to create multiple instances dynamically... In that situation to pick up right instance with less load factor from other microservices we take the support of Load Balancer Clients(LBC) like Ribbon,Feign,Http Load balancers etc., * Microservices can interact with SQL Database Softwares using Spring Data JPA. * Microservices can interact with No SQL Database softwares using Spring Data No SQL modules like spring data mongodb,Spring data Cassendar etc., * To monitor and manage all the Microservices of the project we try to use spring boot admin UI/Dashboard that is created using support of Spring Boot Actuators which are also used providing non-functional features like Health Metrics on projects, memory info,threads info, beans info etc., * Since project contains multiple micro services interacting each other. so we need to perform logging and tracing activity across the multiple micro services as needed with support of distributed logging and tracking tools like slueth and zipkin. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++