-
Notifications
You must be signed in to change notification settings - Fork 22
Coordinate
In order to abstract away which physical hosts services run on we need some way to address services. In order to do this Cloudname uses the concept of a "Coordinate". A coordinate is an abstract name for a service that clients can use to look up services and their endpoints.
A Coordinate typically looks like this 3.myservice.borud.xx. A
coordinate consts of 4 parts:
- The instance number. This is an integer from 0 to however many instances you are running of a service. If your service only runs as one instance then you have only instance 0.
- The service name.
- Username of the user that owns the service.
- The "cell" the service belongs to.
Many services run as clusters of server processes. Cloudname uses numbers to denote instance identity. You can define coordinates that have non-consecutive instance numbers if you want to.
A descriptive but short name for your service. For instance if you
have a service called dispatcher then call your service that.
The username has no strict semantics but was mostly added to make administration a bit easier; if you have a lot of services running in a datacenter it can help you figure out who started some service.
A cell is the administrative unit of Cloudname. A cell is usually equivalent to one datacenter. You can have multiple cells in a datacenter, but you wouldn't want cells to span datacenters.
(More precisely, since Cloudname uses ZooKeeper to do its heavy lifting, a cell is defined by a ZooKeeper ensemble)
This means that the coordinate of instance 3 of myservice will be
defined as above no matter which machine the service runs on.
If all we cared about was the ability to look up services we could of course have used a dynamic DNS server, but there are several reasons why we didn't want to do this. One of them being that coordinates are not only used to locate services, but is also used for various coordination tasks that we will cover later.
That being said, the plan is to provide DNS integration that will allow us to expose Cloudname coordinates through a DNS server for interoperability with legacy software and for the sheer convenience.
For this reason the various components in a Cloudname coordinate have to conform to what would be a valid name in DNS. This means that you cannot use special characters, spaces etc in your coordinates.