Connect services

Applications composed of many microservices need a infrastructure layer for service to service communication: to control the delivery of service requests to other services, to perform load balancing, and to discover other services.

Although you can code the logic that governs communication directly into the microservices, a Kumori Service Link is the recommended way to connect services in the same deployment environment due to it abstracts and externalizes the services connections configuration.

Kumori Service Links main benefits:

  • Allow developers to focus on adding business value with each service they build, rather than worrying about how each service communicates with all other services.

  • Allow DevOps to setup a service mesh programmatically, an essential feature to deploy applications composed of microservices in their CI/CD pipelines.

1. Create services connections

For easy understanding, in this guide we’ll see how to connect the REST API service deployed in the Deploy a service REST API guide, to the MongoDB service deployed in the Deploy a service database guide.

Open the Developer submenu. Click on Link services.

connect services.01

1.1. Select the environment

First, select the environment on which the services to connect are running. For example, select the tenant Freemium, the account freemium, and the environment freemium.

connect services.03

Specify the list of services to connect and set a service or link name to each of them.

connect services.04

1.3. Connect the services above

Finally, for each connection:

  1. Select the service or link name of the service that will act as client, following the previous example, select the REST API service which is the service that is a client of the database service.

  2. Set the client channel (in the example, in the REST API service) that will be connected to the server channel in the target service.

  3. Select the service or link name of the service that will act as server, following the example, select the database service which will receive the TCP calls from REST API.

  4. Set the server channel (in the example, in the database service) that will be connected to the client channel.

connect services.05

Click Link. This process will take a few minutes.

Go to any of the linked services card in the Runtime Dashboard, for example the REST API service card, and open the card menu.

axebow developer runtime card menu.01

Click on Links option and check both services are connected.

Congratulations, you successfully connected the REST API to the database in just a few minutes.