Configuration publication
Let's consider a scenario where we need to publish a small configuration for multiple application instances that should promptly react to its changes.
This scenario can be implemented using semaphores in YDB coordination nodes as follows:
- A semaphore is created (for example, named
my-service-config). - The updated configuration is published through
UpdateSemaphore. - Application instances call
DescribeSemaphorewithWatchData=true. In the result, theDatafield will contain the current version of the configuration. - When the configuration changes,
OnChangedis called. In this case, application instances make a similarDescribeSemaphorecall and receive the updated configuration.
Was the article helpful?
Previous
Next