14.6 Multiple Registries
Ideally, every domain should have a unique registry. All the SData providers should register their endpoints in this registry. The SData consumers can interrogate the domain’s registry to find providers.
But in real life, we will often encounter situations where several registries coexist in a given domain. In a typical small business configuration, there won’t be any central server and every machine that hosts an SData service will have its own registry of local service endpoints.
SData does not address the complex problem of maintaining the registries automatically synchronized when several registries are present in a given domain. Instead, SData relies on manual administration of the registries and only provides a simple protocol to merge two registries together.
A source registry can be merged into a target registry simply by POSTing all the source registry endpoints into the target registry. The target registry will use the endpoint URLs to detect duplicates. After the merge, the source registry should respond to queries with a 301 Moved Permanently response code. This response code instructs the requester to use the target registry’s URL for future requests.
This simple protocol can be used to aggregate multiple local registries into a central one.
At this stage, SData does not provide any protocol to support the discovery of registries. A typical service discovery will involve three steps:
- The user will enter the host name and the port number of the registry that he wishes to interrogate.
The SData consumer will query the registry and return a list of endpoints.
- The user will select one of the endpoints.
Of course, if the administrator has consolidated all the endpoints into a unique registry, he should have the ability to configure the URL of the registry in his SData consumers so that they can interrogate the registry without requiring user input.
SData may provide more advanced discovery mechanisms in the future, and may leverage protocols like Apple’s Bonjour or Microsoft UPnP (SSDP). An alternate solution would be to have a global registry at a fixed address “in the cloud”. This is left for further study.