3

In a monolith, we just need to either make a function call or method invocation as opposed to inter process communication. Can someone familiar with micro-services architecture help to understand reasons how you can use micro services for developing low latency applications?

I think Chronicle framework claims that you can develop micro-services based products and use chronicle queues to communicate without incurring network hop latency.

GhostCat
  • 137,827
  • 25
  • 176
  • 248
The Roy
  • 2,178
  • 1
  • 17
  • 33
  • 1
    Microservices are not lower latency. You'll always be introducing additional network overhead where communication between relevant services are required. – shinjw Aug 17 '18 at 06:27
  • Microservices can be v low latency. Have a look at reactive architecture. – Apurva Singh Aug 17 '18 at 06:27
  • With microservices you have applications broken down to smaller units. The benefit of this is that you can scale these units independently and address bottlenecks at their source. This being said, a single slow piece in the monolith can bottleneck the entire application. – shinjw Aug 17 '18 at 06:29
  • 1
    @shinjw - I totally get the benefits of microservices vs monolith. My question is specific to usage of it in low latency applications. – The Roy Aug 17 '18 at 06:30
  • @ApurvaSingh reactive architecture is not synonymous with low latency – shinjw Aug 17 '18 at 06:31
  • Secondly... given that all your service lives within the same network. The network overhead would be nominal (~10-50ms). Although large amounts of chatter can cause potential slowdowns. But you'll also want to consider the fact that you can have tons of more services available to do the same work – shinjw Aug 17 '18 at 06:41
  • @shinjw Indeed reactive is meant for low latency. There is no other purpose. Push based architecture/programming using web sockets, messaging, caching, non blocking IO using callbacks of functional combinators are all part of reducing latency. >>Responsiveness<< is the central component of reactive architecture. – Apurva Singh Aug 17 '18 at 06:45

1 Answers1

6

First of all, that comment is fully correct: micro-services by itself do not help with latency. Ideally, they only (well, mainly) communicate with other services by using them as service, thus adding a potential penalty for network/inter-process calls.

But the important thing to understand: the idea is not that a micro-service depends on 15 different services that it needs to do its job. You should rather look at them as independent units, which are designed to allow horizontal scaling (by simply adding "more" instances).

Therefore the key element is to actually define a micro-service architecture. Just turning a monolith into a distributed system of services, while keeping unnecessary coupling will not achieve that.

GhostCat
  • 137,827
  • 25
  • 176
  • 248