MICROSERVICES ARCHITECTURE

MICROSERVICES ARCHITECTURE

????????????????????????????????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.

No alt text provided for this image

??????????????????????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

  1. ??????Loosely coupled
  2. ???????Independently deployable
  3. ??????Organized around business capabilities
  4. ???????Owned by a small team
  5. ???????Autonomous

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

  • Decoupling:?Microservices systems are largely decoupled from within which can be easily built, altered, and scaled.
  • ?Componentization:?Microservices can be easily replaced and upgraded as independent components.
  • ?Autonomy:?Developers and teams can work independently without much dependency, thus increasing speed.
  • ?Continuous Delivery:?Microservices is here to update frequently, through systematic automation of software creation, testing, and approval.
  • ?Responsibility:?Microservices is responsible enough to focus on products.
  • ?Decentralized Governance:??Microservices do not have a standardized pattern that makes the developers have the freedom to choose useful tools to solve their problems.
  • ?Agility: Microservice is known for quick adaptation of any new feature and even discard the feature.?

?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:

  • ?Microservices has all the associated complexities of the distributed system.
  • ?There is a higher chance of failure during communication between different services.
  • ?Difficult to manage a large number of services.
  • ?The developer needs to solve the problem, such as network latency and load balancing.
  • ?Complex testing over a distributed environment.

?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.

要查看或添加评论,请登录

Abhijit Majumder的更多文章

  • JVM(Java Virtual Machine)

    JVM(Java Virtual Machine)

    JVM(Java Virtual Machine) is known as the interpreter or the core of Java programming language because it executes Java…

社区洞察