MICROSERVICES ARCHITECTURE
Abhijit Majumder
MLOps || DevOps || Software Development || Machine Learning || Artificial Intelligence || DeepLearning || AWS?? || Linux || Python || Openshift || Ansible || Microservices || Java||C++||ARTH3.0 Learner||CSE2024
????????????????????????????????MICROSERVICES ARCHITECTURE
?
?Microservices Architecture is an example of Multi-processor System.
A Multiprocessor is a computer system with two or more central processing units (CPUs) share full access to a common RAM. The main objective of using a multiprocessor is to boost the system’s execution speed, with other objectives being fault tolerance and application matching.
There are two types of multiprocessor system:
1.Tightly Coupled Multiprocessor System:
?It is a type of multiprocessing system in which, There is shared memory. In tightly coupled multiprocessor system, data rate is high rather than loosely coupled multiprocessor system. A example of tightly coupled multiprocessor system is Monolithic Architecture.
2.Loosely Coupled Multiprocessor System:
?It is a type of multiprocessing system in which, There is distributed memory instead of shared memory. In loosely coupled multiprocessor system, data rate is low rather than tightly coupled multiprocessor system. A example of loosely coupled multiprocessor system Microservices Architecture.
Why Microservices Architecture is better than Monolithic Architecture:
Monolithic Architecture:
???A monolithic architecture is tightly coupled, interconnected, and interdependent. It is a single entity application where all functions are managed and served in one place. The successful compilation of code depends on the interdependence and effective working of all the interconnected systems. A monolithic architecture constitutes a database, a client-side user interface, and a server-side application.
?Disadventages of Monolithic Architecture: Monolithic Architectures, all processes are tightly coupled and run as a single service. This means that if one process of the application experiences a spike in demand, the entire architecture must be scaled. Adding or improving a monolithic application’s features becomes more complex as the code base grows. This complexity limits experimentation and makes it difficult to implement new ideas. Monolithic architectures add risk for application availability because many dependent and tightly coupled processes increase the impact of a single process failure.
??????????????????????Breaking a monolithic application into microservices
Microservices Architecture:
A microservices architecture is loosely coupled and independent architecture.Microservices architecture is a type of application architecture where the application is developed as a collection of services. It provides the framework to develop, deploy, and maintain microservices architecture diagrams and services independently.
?Characteristics of Microservices:
1. ?Highly maintainable and testable
How does Microservices Architecture work?
The microservice architecture contains components depending on the business requirements.
API Gateway-??Clients need API Gateway as it is an entry point, which forwards the call to the specific services on the back end. Here API gateway helps in collecting the responses from different services and returns the response to the client.
Microservices-?As the name itself suggests that microservices are the services that help in dividing the service into small services that perform a certain business capability like user registration, current orders, or wish list.
Database-?Microservices can either share the same database or an independent database.
Inter-microservices communication-?REST or Messaging are the protocol to interact with each other.
?Microservices Features
?Adventages of Microservices:
?1.Easy Deployment:
Microservices enable continuous integration and continuous delivery, making it easy to try out new ideas??????and to roll back if something doesn’t work. The low cost of failure enables experimentation, makes it easier to update code, and accelerates time-to-market for new features.???
2.Technological Freedom:
Microservices architectures don’t follow a “one size fits all” approach. Teams have the freedom to choose the best tool to solve their specific problems. As a consequence, teams building microservices can choose the best tool for each job.
3.Reusable Code:
Dividing software into small, well-defined modules enables teams to use functions for multiple purposes. A service written for a certain function can be used as a building block for another feature. This allows an application to bootstrap off itself, as developers can create new capabilities without writing code from scratch.
4.Improved Data Security:
Microservices communicate with one another through secure APIs, which might provide development teams with better data security than the monolithic method. Because teams work somewhat in silos (though microservices always remain connected), there’s more accountability for data security because developers handle specific services. As data safety becomes a greater concern in software development, microservices could provide developers with a reliable security solution.??
5.Scalability:
Microservices are much easier to scale than the?monolithic architecture. Developers can scale specific services rather than an app as a whole and execute bespoke tasks and requests together with greater efficiency. There’s less work involved because developers concentrate on?individual services?rather than the whole app.
?In microservices architecture we are?faceing some disadvantage:
?CONCLUSION:
Microservices architecture?sounds a lot more complicated than it is. In simple terms, the architecture comprises small independent services that work closely together but ultimately fulfill a specific purpose. These services solve various software development problems through unique processes.
A good comparison is a football team, where all players share the same objective: To beat the other team. However, each player has an individual role to play, and they fulfill it without impacting any of the other players. Take a quarterback, for example, who calls the play in the huddle. If the quarterback performs poorly during a game, this performance shouldn’t affect the other team members. The quarterback is independent of the rest of the players but remains part of the team.