Q 1- What is microservices?
Microservices Architecture -
Microservices focus on a single business domain that can be implemented as fully independent deployable services and implement them on different technology stacks.
Microservices architectures make applications easier to scale and faster to develop, enabling innovation and accelerating time-to-market for new features.
Definition Of Microservices
it is a framework which consists of small, individually deployable services performing different operations.
Microservices Architecture -
Microservices focus on a single business domain that can be implemented as fully independent deployable services and implement them on different technology stacks.
Microservices architectures make applications easier to scale and faster to develop, enabling innovation and accelerating time-to-market for new features.
Key Concepts Of Microservice Architecture
- Each microservice you design shall concentrate only on one service of the application.
- Ensure that you have designed the application in such a way that each service is individually deployable.
- Make sure that the communication between microservices is done via a stateless server.
- Each service can be furthered refactored into smaller services.
Microservice Architecture should contains following components-
- Clients
- Identity Providers
- API Gateway
- Messaging Formats
- Databases
- Static Content
- Management
- Service Discovery
1. Clients
there could be different kind of clients from various devices which are trying to perform some activities such as searching, build ,configure etc.
2. Identity Providers
authenticate the requests from client and and communicate these requests with api gateway.
3.API Gateway
API Gateway acts as an entry point for the clients to forward requests to appropriate microservices.
advantages of using an API gateway include:
- All the services can be updated without the clients knowing.
- Services can also use messaging protocols that are not web-friendly.
- The API Gateway can perform cross-cutting functions such as providing security, load balancing etc.
4. Messaging Formats
There are two types of messages through which they communicate:
- Synchronous Messages: where clients wait for the responses from a service, Microservices usually tend to use REST (Representational State Transfer) as it relies on a stateless, client-server, and the HTTP protocol. This protocol is used as it is a distributed environment each and every functionality is represented with a resource to carry out operations
- Asynchronous Messages: In the situation where clients do not wait for the responses from a service, Microservices usually tend to use protocols such as AMQP, STOMP, MQTT. These protocols are used in this type of communication since the nature of messages is defined and these messages have to be interoperable between implementations.
5. Data Handling
Well, each Microservice owns a private database to capture their data and implement the respective business functionality.Also, the databases of Microservices are updated through their service API only.
6. Static Content
After the Microservices communicate within themselves, they deploy the static content to a cloud-based storage service that can deliver them directly to the clients via Content Delivery Networks (CDNs).
7. Management
balancing the services on nodes and identifying failures.
8. Service Discovery
Acts as a guide to Microservices to find the route of communication between them as it maintains a list of services on which nodes are located.
Pros and Cons of Microservice Architecture
Refer to the table below.
Pros | Cons |
Users are free to use different technologies | It Increases troubleshooting challenges |
focused on single business capability | Increases delay due to remote calls |
Supports individual deployable units | Increased efforts for configuration and other operations |
Allows frequent software releases | Difficult to maintain transaction safety |
Ensures security of each service | Tough to track data across various service boundaries |
Multiple services are parallelly developed and deployed | Difficult to move code between services |
No comments:
Post a Comment
Note: only a member of this blog may post a comment.