Thanks for reading systemdesign.one newsletter. If you're not yet subscribed, let me help you with that:
Service Discovery Write Workflow
The service provider shares its IP address and port number for registration with the service registry. A periodic heartbeat signal is utilized to indicate the current status of a service instance. Typically, well-behaving service instances will voluntarily deregister upon shutdown. However, if a service abruptly shuts down and no heartbeat signal is detected for an extended duration, the system will automatically classify the instance as inactive.
Service Discovery Read Workflow
By employing the publish-subscribe pattern, reliable service discovery can be implemented. In this approach, service consumers are advised to subscribe to the desired service providers listed in the service registry. As any modifications occur in the service providers, the service registry proactively notifies the subscribed service consumers of these changes.
This domain is what my team is responsible for in Meta's infrastructure. You described the essence of the space pretty well. Though there are many ways to do this and you have described one possible way here.
Also something to consider is the scale of reads >> scale of writes which makes this an extremely read heavy system.