Client-to-microservice communication

Pragya Keshap answered on February 18, 2023 Popularity 3/10 Helpfulness 1/10

Contents


More Related Answers

  • When to choose Microservice?
  • what is microservice
  • What are the ways of testing the security of microservices?
  • How messaging works in microservices
  • In what kind of application we should use microservices?
  • microservices communication types
  • Explain how independent microservices communicate with each other.
  • Explain the working of Microservice Architecture.
  • How messaging works in microservices
  • Write main components of Microservices
  • Explain the way to implement service discovery in microservices architecture.
  • Service discovery and registration in microservices
  • microservices asynchronous communication
  • Microservices Communications
  • Microservices Async Communication Patterns
  • Problem: Direct Client-to-Service Communication
  • Introduction - Microservices architecture
  • Decomposition of Microservices Architecture
  • Breaking Down Application into Microservices
  • Microservices Decomposition Path
  • Problems of Direct-to-Microservices Communication
  • Service-to-Service Communications between Backend Internal Microservices
  • What is the role of service meshes in the communication and coordination of microservices ?
  • What are the points to remember during integration of Microservices?
  • What is the preferred type of communication between Microservices?
  • What is Idempotency of a Microservice operation?
  • THEN WHY MICROSERVICES?
  • understanding the complexities of microservices security
  • securing the communication between microservices
  • Microservices communication 3 different ways

  • Client-to-microservice communication

    0

    When it comes to client-to-microservice communication, an application's client calls each of the microservices directly using the public endpoint (https://serviceName.api.dineshonjava.name) of that microservice. In the case of a clustered microservice, a URL would map to the load balance of a microservice.

    The following diagram illustrates client-to-microservice communication:

    As you can see in the preceding diagram, the mobile and browser clients make requests to each of the services in order to retrieve order details. This approach has many challenges and limitations.

    Drawbacks

    Let's first take a look at the limitations of the client-to-microservice approach:

    Network discrimination: The client has to call several (sometimes hundreds) of microservices in order to render a page. This is possible with a LAN, but in the case of a public network, it could become inefficient. It would also be very difficult when using a mobile network.

    Complex client code: For this approach, we have to write code for numerous REST calls for many microservices, making the client code much more complex.

    Protocol diversity: Some clients might use protocols that are not web-friendly. Suppose one microservice is using Apache Thrift's binary RPC and another is using gRPC or the AMQP messaging protocol. None of these protocols are web-friendly, so a browser cannot use them properly. An application should use protocols such as HTTP and WebSocket outside a firewall.

    Refactoring microservices: Further enhancement of services (such as merging two services or splitting a service into two or more) is extremely difficult because an application's client interacts directly with the services.

    Due to these limitations, we never recommend that a client application takes a direct approach when using microservices. This is especially the case when serving an external client application; in such a case, we have to provide a common interface service to the client, such as Facade design, to interact with all microservices. In the next section, we will discuss how to use an API gateway as an alternative.

    https://medium.com/youngtailors/client-to-microservice-communication-strategy-in-a-nutshell-ff4a41191170

    Popularity 3/10 Helpfulness 1/10 Language whatever
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Feb 18 2023
    Pragya Keshap
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.