Design Patterns for Micro Service Architecture

lambdatest 327 views 19 slides Nov 12, 2018
Slide 1
Slide 1 of 19
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19

About This Presentation

Imagine breaking down a single function unit into multiple mini-service units. That is exactly what microservices do to the traditional monolithic architecture. But, there is more to it than meets the eye. Microservices are the go-to solution for all the major software development projects.


But ev...


Slide Content

Design Patterns For Micro Service Architecture By - LambdaTest

The first and foremost principle to design microservice architecture is the ability to break down the monolithic architecture into separate individual entities. These entities are known as microservices. Decentralization Principles Used To Design Microservice Architecture

Microservices are built with an aim in mind: Performance and efficiency. In real-world problem solving, expansion and large-scale systems are crucial to the performance of any microservice ecosystem. Scalability is crucial to design microservice architecture. With the possibility of multiple fragments functioning on multiple technologies, working with larger amounts of data can be a challenge. Scalability

Continuous delivery through DevOps Integration Those working in DevOps often receive microservice architecture well because of the ease of accessibility and integration of multiple technologies. To design microservice architecture one needs to focus on increasing performance and efficiency of the system. This motivates DevOps to deliver solutions faster.

The process of ‘decomposing’ a monolithic architecture into a microservice needs to follow certain parameters. These parameters have a different basis. Today we will look at the decomposition of the microservice design patterns which leave a lasting impact. Microservice Design Patterns For Decomposition

With most of the business operations going online, the scale of the operations has massively increased with time. Catering to such a huge scale manually is not feasible, given the expected processing time is also decreasing day by day. This is where the Automation comes into the picture, supporting scalability of operations. APIs have helped to automate processes to increase the scale by many folds than manual processing. API Discovery: Manual vs Automated

Decompose by a Business Capability A microservice is as successful as its combination of high cohesion and loose coupling. Services need to be loosely coupled while keeping the function of similar interests together. To maintain efficiency and foresee growth, the best solution is to decompose the systems using business capability. This includes classification into various business domains which are responsible to generate value in their own capabilities.

Domain Driven Design Despite segregating on the basis of business capabilities, microservices often come up with a greater challenge. What about the common classes among the services? Well, decomposing these classes known as ‘God Classes’ needs intervention. For example, in case of an e-commerce system, the order will be common to several services such as order number, order management, order return, order delivery etc.

Strangler Pattern While we discuss decomposition of a monolithic architecture, we often miss out the struggle of converting a monolithic system to design microservice architecture. Without hampering the working, converting can be extremely tough. And to solve this problem we have the strangler pattern, based on the vine analogy.

Integration patterns are used when you design microservice architecture and focus on collecting data from different microservices to create an output. It is further of three types. Microservice Design Patterns For Integration

Aggregator Pattern With multiple services involved, fetching the output and combining it for the end-user is necessary. For a user to combine the data, will require immense internal knowledge of the system. As we design microservice architecture, breaking down the monolith means the division of the sources of output. Hence, to aggregate this data we make use of the aggregator pattern.

API Gateway Pattern With the microservice architecture, it is very important to extract the data from individual services. But, these may or may not run on common technology. What do we do now? The solution is an Application Programming Interface (API) which acts as the controller between the system and client calls.

Microservice Design Patterns For Database For a microservice architecture, loose coupling is a basic principle. This enables deployment and scalability of independent services. Multiple services might need to access data not stored in their unit. But due to loose coupling, accessing this data can be a challenge. Mainly because different services have different storage requirements and access to data is limited in microservice design.

Individual Database per Service Usually applied in Domain Driven Designs, one database per service articulates the entire database to a specific microservice. Due to the challenges and lack of accessibility, a single database per service needs to be designed. This data is accessible only by the microservice. This database has limited access for any outside microservices. The only way for others to access this data is through microservice API gateways.

Shared Database per Service In Domain Driven Design, a separate database per service is feasible, but in an approach where you decompose a monolithic architecture to microservice, using a single database can be tough. So while the process of decomposition goes on, implementing a shared database for a limited number of service is advisable.

Command Query Responsibility Segregation Based on the CQRS , to query single databases per service model, the application should be divided into two parts: Command and Query. In this model, command handles all requests related to create, update and delete while queries are taken care of through a materialized view. These views are updated through a stream of events.

The bottom line Though not all the design patterns might apply to a given microservice, you can rest assured that most of them will be used everywhere. These design patterns help developers to bring in a standard that is consistent and brings in reliability to the application as a whole. The evaluation, auditing, and implementation and testing microservices of these design patterns are an ongoing process of microservice architecture. Right from the designing phase of the application to the maintenance phase in production, these patterns will help throughout. www.lambdatest.com

HAPPY TESTING!!