Microservice challenges

Even though we have a lot of benefits with the microservices, it also has some challenges. Let's see:

  • Difficulty to achieve strong consistency across services, such as maintaining ACID transactions within multiple processes
  • Because of distributed system, it's harder to debug/trace
  • Greater need for end-to-end testing
  • How applications are developed and deployed
  • Communication across services and service-to-service calls

There are numerous challenges related to the microservice infrastructure. There are multiple processes working together as a single business unit. Because of this distributing nature, the following issues arise:

Difficulty

Solution

How do multiple microservices find each other?

It is service discovery.

How do we decide which instance of a service to use?

It is client-side load balancing.

What happens if a particular microservice is not responding?

It is a fault tolerance.

How do we control the access of a microservice, such as providing security and rate limits?

It is service security.

How do multiple microservices communicate with each other?

It is messaging.

So far, we have seen that there are several challenges with microservices and distributed systems. But Spring Boot makes microservices-based approaches easy to use. And Spring Cloud comes into the picture to provide the solution to all these challenges. Spring Cloud makes the development of distributed microservices quite practical by using leverage capabilities of the auto-configuration.

Spring Boot makes for easy development with the microservices:

  • You can create numerous services by using Spring Boot
  • You can expose resources via RestController
  • You can also consume these remote services using RestTemplate

Spring Cloud leverages capabilities for continuous deployment, rolling upgrades of new versions of code, quick rollback in case of defects, and running multiple versions of the same service at the same time. And more, which we'll discuss in the next section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.58.194