What is Eureka service, Eureka Client, Eureka instance and Eureka server
Asked Answered
C

5

60

I'm learning spring cloud Netflix by reading this article, however I started to get confused by different terminology in this article, they are:

  1. Eureka service. To my understand it's an ordinary service (specifically a Microservice) that running on a unique uri (i.e.one service per uri). Say localhost:12000. It is can be registered in the Eureka server.

  2. Eureka Client. Same thing as Eureka service???

  3. Eureka Server. To my understand, it's the server that we can inspect, discover and manage bunch of Microservices we built, normally running on localhost:8761

  4. Eureka Instance. I'm confused by what's it referred to, same thing as the Eureka client?

Also in this article, it mentions eureka.client in config and EurekaClient in Netflix API, are they referring to the same thing?

Please tell me what do these four terms mean and correct me if I'm wrong. Thank you!

==================================UPDATE==================================

In the article it said:

@EnableEurekaClient makes the app into both a Eureka "instance" (i.e. it registers itself) and a "client" (i.e. it can query the registry to locate other services).

So it looks like the Eureka instance is same as Eureka service. While Eureka Client is a special instance that can query for other instances/services.

Curcio answered 11/4, 2016 at 19:32 Comment(1)
Official Netflix Eureka documentation is also worth looking into - github.com/Netflix/eureka/wiki/…Ricardaricardama
C
40

I'd say these terms are used a bit ambiguously, here's what I think they mean in the article:

  • Eureka Client: it can be a microservice that is ready to work so it registers itself to the Eureka server e.g. an API for some app, or some application that goes to the server and asks for directions to a specific microservice.

  • Eureka Instance: a single instance of a microservice (you can add more instances of the same microservice as your load grows i.e. horizontal scaling).

  • Eureka Service: looks like when you register a microservice as an Eureka Client, you obtain an Eureka Service registered by an ID.

  • Eureka Server: a server where microservices can register themselves so others can discover them.


About the update you added:

Eureka Instance should not be confused with Eureka Service. Eureka Service refers to the group of microservice instances registered to the Eureka Server that provide the same service.

About that @EnableEurekaClient annotation, it tells the following to the framework: hi there Spring, I am an instance of microservice X, so please register me to the Eureka Server (with eureka.instance.* properties), and I also want to discover other services, so create the necessary discovery client bean for me (with eureka.client.* properties).

In summary, this annotation named @EnableEurekaClient does both things, maybe that's where the confusion comes from. But Instance and Client are indeed different concepts, even though they are used somewhat interchangeably in the article.

Colter answered 11/4, 2016 at 20:2 Comment(7)
So is the Eureka Service ID associated with Eureka Instance or Eureka Client?Curcio
The ID is associated with the microservice, not to be confused with the instance. As I understand it, each instance registers with the same ID (e.g. application name) so that the Eureka Server knows which clients belong to each microservice.Colter
That makes sense. I updated my original po, hope it could help a bit :)Curcio
I updated the answer with some comments about your update. Hope they are useful ;)Colter
I totally agree with the Esala. The most confusing part is because there are two scenarios where single microservice, can register its own instance in Eureka Server (which by the way is also a microservice..) to be accessible by others (clients), and second scenario is where microservice wants to communicate with another microservices, that is basically being both accessible by others, and acting as a client (using another micriservices discovered via Eureka Server).Doridoria
Concept with service ID is for easier access (with special Eureka-aware Ribbon You don't need to know service URL, just the ID) and load balancing where You just specify the ID, and get "the best" instance of microservice You wanted.Doridoria
@patrykos91Thank you both! I guess someone need to rewrite that article to make the term consistent :PCurcio
C
42

Definitions


Eureka Server

The discovery server. It contains a registry of services and a REST api that can be used to register a service, deregister a service, and discover the location of other services.

Eureka Service

Any application that can be found in the Eureka Server's registry and is discoverable by others. A service has a logical identifier sometimes called a VIP, sometimes called a "service id", that can refer to one or more instances of the same application.

Eureka Instance

Any application that registers itself with the Eureka Server to be discovered by others

Eureka Client

Any application that can discover services

Questions


How can an application be both a Eureka Instance and a Eureka Client?

Applications often need to make themselves available for use by others (so they are an instance) while at the same time they need to discover other services (so they are a client).

Does a Eureka Client have to be a Eureka Instance?

No. Sometimes an application has nothing to offer and is only a caller of other services. Via configuration (eureka.client.register-with-eureka=false), you can tell it not to register itself as an instance. It is therefore only a Eureka Client as it only discovers other services.

Criswell answered 20/11, 2016 at 16:32 Comment(3)
But why this configuration property (eureka.client.register-with-eureka=false) is part of the eureka.client.* instead eureka.instance.* ?Jeb
Likely because the client is the one doing the registrationCriswell
Now Spring has Eureka Server and Eureka Discovery. What is the difference of them?Scintillation
C
40

I'd say these terms are used a bit ambiguously, here's what I think they mean in the article:

  • Eureka Client: it can be a microservice that is ready to work so it registers itself to the Eureka server e.g. an API for some app, or some application that goes to the server and asks for directions to a specific microservice.

  • Eureka Instance: a single instance of a microservice (you can add more instances of the same microservice as your load grows i.e. horizontal scaling).

  • Eureka Service: looks like when you register a microservice as an Eureka Client, you obtain an Eureka Service registered by an ID.

  • Eureka Server: a server where microservices can register themselves so others can discover them.


About the update you added:

Eureka Instance should not be confused with Eureka Service. Eureka Service refers to the group of microservice instances registered to the Eureka Server that provide the same service.

About that @EnableEurekaClient annotation, it tells the following to the framework: hi there Spring, I am an instance of microservice X, so please register me to the Eureka Server (with eureka.instance.* properties), and I also want to discover other services, so create the necessary discovery client bean for me (with eureka.client.* properties).

In summary, this annotation named @EnableEurekaClient does both things, maybe that's where the confusion comes from. But Instance and Client are indeed different concepts, even though they are used somewhat interchangeably in the article.

Colter answered 11/4, 2016 at 20:2 Comment(7)
So is the Eureka Service ID associated with Eureka Instance or Eureka Client?Curcio
The ID is associated with the microservice, not to be confused with the instance. As I understand it, each instance registers with the same ID (e.g. application name) so that the Eureka Server knows which clients belong to each microservice.Colter
That makes sense. I updated my original po, hope it could help a bit :)Curcio
I updated the answer with some comments about your update. Hope they are useful ;)Colter
I totally agree with the Esala. The most confusing part is because there are two scenarios where single microservice, can register its own instance in Eureka Server (which by the way is also a microservice..) to be accessible by others (clients), and second scenario is where microservice wants to communicate with another microservices, that is basically being both accessible by others, and acting as a client (using another micriservices discovered via Eureka Server).Doridoria
Concept with service ID is for easier access (with special Eureka-aware Ribbon You don't need to know service URL, just the ID) and load balancing where You just specify the ID, and get "the best" instance of microservice You wanted.Doridoria
@patrykos91Thank you both! I guess someone need to rewrite that article to make the term consistent :PCurcio
C
7

enter image description here

I think they look like this pic.

  1. A Eureka client registers to a Eureka Server.
  2. Because a Eureka Instance registers to Eureka Server, so it is a client.
  3. Because a Eureka Service offers api to others, so it can be discovered by others, so it is a Instance.
Cayenne answered 2/11, 2017 at 13:8 Comment(2)
Now Spring has Eureka Server and Eureka Discovery. What is the difference of them?Scintillation
Eureka client is Eureka discoveryRuvalcaba
R
0

Let's take an example.

Spring-cloud-netflix-turbine uses Eureka to aggregate the metrics from individual micro services. It needs to know address of each instance of micro service running at any time in cloud. The number of instances can go up and down.

Eureka Server: Turbine queries Eureka server to get access to registry. Using registry it determines all participating micro services, their end point to reach and more.

Eureka Service: Information provided by Euerka server to turbine (list of participant Micro Services) is the service. A server could provide multiple services.

Eureka Instance All the micro services that want their metrics to be aggregated are Eureka instances. Instances not only can query registry but also register, de-register, provide hear beat to stay registered, etc.

Eureka Client Turbine is the client. It only queries registry to determine running instances of Micro Services.

Reconstructionist answered 12/6, 2017 at 18:23 Comment(0)
P
0

From the official documentation:

Eureka comes with two components - Eureka Client and the Eureka Server. Your architecture which is using Eureka will typically have two applications

  1. Application Client which uses Eureka Client to make requests to the Application Service.
  2. Application Service which receives requests from Application Client and sends a response back.

The setups involve the following

  1. Eureka Server - This keeps a record of all the services which have registered.
  2. Eureka Client for the application client
  3. Eureka Client for the application service

Eureka Instance means a single node of the Application client.

enter image description here

Parceling answered 15/6, 2020 at 12:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.