Need to decide on Service Discovery
Closed this issue · 2 comments
DanielFroehlich commented
How does a frontend service find out which backend services exist and which endpoints they have?
Example: How does the EventService find out, which musicproviders are avail?
Could be backend-spotify, backend-soundclound, backend-itunes, or non of these.
Ideas:
- Option A: Env Variables
- Option B: some service discovery framework
- Option C: query k8s for existing routes/services
- Option D: Kafka-Topic
Have a topic where each service provider publishes an event with his name, endpoint urls (internal as xxx.svc.local and external via ocp router), versions etc..
The event is published every time a pod is started or every 12 hours. Thus consumers can read the topic -12 hours and know who might be there. To get final confidence, consumer can call the /health endpoint to verify - et voilá. - Option E: Use only async event communications, then the only service needed would be the event bus endpoint, which could be in an env variable.
wrichter commented
Option F: Pub/Sub - Service sends a query message to a Topic that backends listen to - they respond within a time window to be known. Similar to Option D) but less Risk of stale data in dev phase.
DanielFroehlich commented
Let's got with simple Option A for the basic stuff., and maybe later added a more sophisticated stuff like Option D