官术网_书友最值得收藏!

Service discovery patterns

Microservices-based applications may often scale to such a large number of services that it may not be feasible for each microservice to keep a track of all other active service locations. In such scenarios, the service registry helps in discovering microservices to perform a particular task. There are primarily two patterns for service discovery—client-side discovery and server-side discovery, as shown in the following diagram.

In the client-side discovery pattern, the responsibility for determining the location of services by querying the service registry is on the client. Therefore, the service registry must be accessible to the client to look up the location of the required services. Also, each client must have service discovery implementation built-in for this pattern to work.

On the other hand, in the server-side discovery pattern, the responsibility for connecting with the service registry and looking up the location of services is of a router or a gateway that acts as a load balancer as well. Clients just need to send a request to a router and the router takes care of forwarding the request to the required service. Orchestration tools such as Kubernetes support server-side discovery using proxies.

The server-side discovery pattern must be preferred for a large-scale deployment. It can also be used as a circuit breaker to prevent resource exhaustion by controlling the number of open requests to a service that has encountered consecutive failures or is not available.
主站蜘蛛池模板: 陇西县| 大埔县| 黑水县| 赞皇县| 澄城县| 郁南县| 镇赉县| 沁水县| 那曲县| 九江市| 普洱| 广河县| 临清市| 和政县| 吉林市| 奉节县| 鄂托克前旗| 通州市| 什邡市| 昌都县| 平塘县| 钦州市| 台中市| 克山县| 长兴县| 衡山县| 建水县| 平安县| 吉木萨尔县| 萝北县| 高平市| SHOW| 年辖:市辖区| 通渭县| 衡南县| 乳山市| 彭阳县| 木里| 汉阴县| 崇州市| 武义县|