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
DescribeSemaphore
withWatchData=true
. In the result, theData
field will contain the current version of the configuration. - When the configuration changes,
OnChanged
is called. In this case, application instances make a similarDescribeSemaphore
call and receive the updated configuration.