Posts

Showing posts with the label microservices

00.MicroService - Topics

Image
 Topics Service Oriented Architecture - SOA What is MicroService? Monolithic Architecture Spring cloud Architecture Monolithic vs Microservice Service Discovery | Eureka Microservice vs web service Challenges with Microservice Project Property Description application.properties file and application.yml file Circuit Breaker Pattern - Fault Tolerant Microservices

01.Service Oriented Architecture - SOA

Image
  SOA SOA is a solution for making communicate to each other without human intervention (මැදිහත්වීම). A web service is an implementation of SOA.

02.What is MicroService?

Image
What is MicroService? MicroService යනු තනි application එකක් (Monolithic Application එකක්), එකිනෙක communicate කරගන පුළුවන් වෙන වෙනම deploy වන කුඩා කුඩා independent services වලට කැඩීමයි. Simply it is new way to develop application rather than traditional monolithic application. Companies which are using microservice.   Features of MicroService Architecture Small focused – main aim of microservice is simplicity.it can be rewrite in maintained without extra effort. Loosely coupled – development as well as deployment is quick. Language Neutral – few services can be Java, few is c# few can be python.it can be use depend on the service. Bounded Context – each microservice does not need to understand the implementation of the other microservice.

03.Monolithic Architecture

Image
  Monolithic architecture MONO  - single , LITHIC - stone Monolithic architecture is like a big container where in all the software components of an application are assembled together and tightly packed (coupled). All the component in monolithic application are inter connected and inter depended. It is deployed as single monolithic application. If you want to scale it, you have to create multiple instance (එකම war, ear file එකේ copies කිහිපයක්) and host them and through a load balancer should be mapped to one(Monolithic application වලදී , application එක scale කරන්න නම් එම application එකේ war, ear fileඑක අරන් එකම server එකේ different port වල host කිරීම හෝ විවිද server වල host කර load balancer එකක් though request ඒවාට map කිරීමයි ). ..................................................................................................................................................................... Advantage of monolithic application. Very simple to develop. It is easy to de...

04.Spring cloud

Image
Spring cloud  What is Spring Cloud? Spring cloud provide lot of tools and services to develop microsevices applications quickly. Because microsevices are distributed and spring boot application are complex. So to reduce that complexity and to able to develop application easily spring cloud provide lot of tools. There are hundreds of ways to build microservices. Spring cloud is one way and it is the most robust way to build microservice. Each micro service is spring boot application. Hystrix It is    circuit breaker to stop cascading failure and enabling resilience.  Hysteric is a circuit breaker pattern implementation developed by Netflix. Circuit breaker pattern ඉදිරියේදී වෙනම post එකක් හරහා විස්තර කර ඇත. Zuul – Basically it provides an intelligent routing system.  

05.Architecture.

Image
  Architecture.   It is an architectural type that structure an application as a collection of small autonomous services, modelled around a business domain. In microservoce architecture, each service is self-controlled and implements a single business capability. Large application can be divided in to small unit, component, services but all together can get a large application. The services will communicate each other through API(state less communication between components).Each of this service have separate code base which can developed  by small team. Microservice is small, independent and loosely coupled. Management සහ Service discovery  මගින් කරනු ලබන්නේ සියලුම microservices ටික register කරගැනීම( nodes වල) සහ ඒවා maintain කිරීම සහ අදාළ request අදාළ microservices වලට යැවීම. Management – management component is responsible for placing services on nodes (identifying failure, rebalancing services access node etc.). Service discovery – the task of this c...

06.Monolithic vs Microservice

Image
 Monolithic  vs Microservice  Advantage of monolithic application. Very simple to develop (Low complexity). It is easy to deploy because single file. It is easy to scale, if we want to scale we can create multiple instances and behind a load balancer those can be accessed ( Y axis scaling ) .   Disadvantage of monolithic application. Large and complex application .-if the application is very large, it is very difficult and complex to understand the project and it is very difficult to understand how to correctly implement a change. So quality of application is reduce. Slow development - Application and development team is grow, so difficult to understand and modify the project. Large code may cause to slow the IDE so it wastes the time. Blocks continuous development – when we change the small modification to the system, we have to redeploy the entire project. But changed is very small. When redeploy it there can be lost some dependencies and failed to sta...

07.Service Discovery | Eureka

Image
 Service Discovery  | Eureka In short, Service discovery is micro service calling technique. In the microservices , microservices needs to talk each other. මෙහිදී එක microservice එකක් අනෙත් microservice එකත් සමග communicate කරන්නේ අනෙත් service එකේ IP:PORT හරහා.උදාහරණයක් ලෙස rest service එකක් call කරනවා කියලා හිතන්න.අපි මොකද කරන්නේ rest service එකේ IP:PORT එක හරහා එකට call කරලා data ගන්නවා. Microservices වලත් ඒ වැඩේ එහෙම්ම තමා.එත් URL hardcode කරලා call කරන්නේ නෑ පහත ප්‍රශ්න එන නිසා.   01.Change require code update – URL එක වෙනස් වෙද්දී code එක update කරන්න සිද්ද වෙනවා. 02.Dynamic URL in the cloud – URL එක dynamically ව ලැබෙන්නේ AWS වගේ ඒවා පාවිච්ච් කරද්දී. 03.Load balancing -හිතන්න එකම microservice එකක instance 3ක් server 3 ක තියෙන්නේ කියලා.මෙවිට URL 3 ක්  තියනවා.මෙවිට මොන URL එකද use කරන්නේ කියන එක ප්‍රශ්නයක්.එක URL එකක් දුන්නොත් අනෙත් ඒවා access කරනන් බැ.මෙවිට load balance කරන්නත් බැ. 04.Multiple environment – Development environment එක එකක්, QA ...