Domain naming standards for internal services?

Gokhan Karadas
Trendyol Tech
Published in
2 min readJul 28, 2021

Let’s say you have thousands of microservices and you need the access these services by their domain names. How to create these domain names and make them less complicated?

Before starting deep dive I want to tell you why domain naming standardization is useful for your microservices.

  • A domain name should be self-explanatory.
  • If you have many teams in your organization you need to pre-validation the step for registering domains.
  • A domain should be short as match as possible.

How do we register a domain in Trendyol?

We use consul to service discovery and catalog. An application developer can register their microservices easily via Kubernetes. We use the consul-catalog project for registering microservices to the Consul. A service definition is a configuration that looks like the following.

Consul catalog
[
{
"Service": {
"Service": "discovery-team-servicename-service"
}
}
]

What is the domain naming for internal microservices?

We use tribe-team-servicename standardization for our microservices. In this way, application developers can find necessary microservice easily. We have many tribes like discovery, mobile, delivery each tribe contains multiple domain teams. Each microservice represents in this way. For example, you have a favorite service you register with it servicename.ty.com I think that this domain name is not self-explanatory and you don’t know who is responsible for this project. If you use discovery-reco-favorite-service you can easily find a responsible team for this microservice. You can see this project belongs to Discovery tribe and Reco team. Now you know who to contact.

Do you host a microservice for multiple data centers?

When you work with multiple data centers you should access each one easily. Above I talked about microservice naming for internal microservices but how we access each data center. We use tribe-team-service.datacenter it to access microservice for specific data centers.

Conclusion

  • With strong domain naming conventions, you can reduce the effort to find a responsible team.
  • It makes it easy for the onboarding process.

Contributors

Oğuzhan Demir

Emre Savcı

--

--