2

I'm studying the micro-services concept. I did a small demo & understood the difference between monolith & microservice application. (the architectural difference too. cool!) Demo: Used spring-boot, Eureka, spring-cloud which uses the Client Side Service Discovery.

I also tried to understand the Client-side vs. Server-side service discovery. And later I struggled and found it difficult to understand the technical difference between... the API invocation from a monolith app. and the microservices invocation from another microservice application. (like what actually happens beneath/behind the curtains)

For Instance, Consider the following API from a monolith app. which can be consumed from another monolith app./micorservice

A) GET API: http://127.0.0.1:8080/projects as traditional REST API its what I know & what we expect.

Consider this API which is from a microservice application (say, a Eureka Client)

B-initial) GET API: http://localhost:18082/products that was later transformed into for the service discovery purpose usage

B-new) http://product-info-service:18082/products

So from what I observe, the Eureka Server contains these service names in its service registry. Whenever any registered Eureka client requests for the above microservice with its specific "service-name", the eurekaServer does a lookup, resolve if it finds perfect match & forwards the request, the request gets processed.

My Concern: So Is it, all the same, happening internally here? be it monolith or microservices? I mean, does the discovery server in the microservices internally invokes a specific microservice just like an API? OR does the monolith API invocation differ from the microservice service invocation? Or it's just an abstraction.

PS: still learning, apologies in advance If I've made mistakes while asking anything vague or confused things here. Please correct me. Thanks

My git-hub link: https://github.com/aniketrb-github/microservices Content that I'm following from is JavaBrains

1 Answer 1

1

You're correct, it's really just an abstraction and decoupling of services. The only thing you are introducing is another API request. In A, you have client -> projects whereas in a microservice architecture you have client -> api-gateway -> projects. This means you've now created a distributed system, which has many pros & cons (as does a monolithic architecture).

Overall, it's essentially doing the same thing, returning a list of products. It's just getting the list of products from another service, rather than from inside a monolithic application. Eureka is being used to discover where the other services are, so it knows where the microservice is in respect to your gateway application.

For the future, you'd want to start learning about fault-tolerance and other aspects of running a reliable microservice architecture.

2
  • Thanks for your response @devshawn. Yes, Even I thought of the same initially, but felt to google it / post a question and understand what others perspectives say about it. Its just the architectural concept/abstraction one has to understand and the pros & cons of monolith & microservices & which has to be used in what kind of business scenario. Also thanks for the pointer of future learning as well.
    – Aniket
    Apr 8, 2019 at 10:53
  • Thanks for your inputs earlier. Indeed its a great experience in learning micro-services & all related concepts like ribbon, zuul, hystrix, eureka, spring cloud bus etc. Just out of curiosity, I was wondering, how should I strengthen this learning experience more? Learning Docker & Kubernates for micro-services deployment etc. will be a great addition...isn't it?...Can you provide some opinions/suggestions for the same if possible? Thanks in advance.
    – Aniket
    Feb 28, 2020 at 13:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.