Skip to content

nats as service registry is redundant #1409

Open

Description

@butonic

When we started the codebase we adhered to how go micro encapsulated a service registry because we thougth we would need that. As it turns out, we don't. We can rely on dns to be our service registry:

  • bare metal we can use localhost:port
  • in docker we can use container:port and docker will route the requests
  • in kubernetes we can use `service.namespace(.srv.cluster.local):port´ and kubernetes will route our requests. with grpc the native go client can even use a headless service and handle connection failures and retries natively

We should remove any service registry related code and stick to urls. the grpc client can then handle unix:// dns:// or kubernetes:// prefixes. for kubernetes we alredy integrate with the kubernetes control plane to pick up new pods when scaling up.

We still need to retry requests when scaling down.

Using dns as our service registry would significantly reduce the complexity:

  • we can delete the nats-js-kv registry obsolete
  • reva services don't have to manually be registered
  • requests can be made without implementin our own service lookup code with go micro selectors etc
  • drop dozens of env vars
  • less dependency on go micro

The latter will unify how reva and opencloud make http and grpc requests.

We can already prevent nats from being used by using dns:// urls in the endpoints. I tested this and there are a few points where service names have been hardcoded: requests to the settings service and search IIRC. They will need to be made configurable, but IMO it is already a bug that they cannot be configured.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type:Maintenance

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions