Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Micro Service vs Nano Service? [closed]

So, what do you call it? A Micro service or a Nano Service?

What differences they have? I came across many blogs on internet and I could not find any satisfactory answer.

Found this quotation from Mark Little on InfoQ:

First things first what actually is a micro service? Well there really isn’t a hard and fast definition but from conversations with various people there seems to be a consensus that a micro service is a simple application that sits around the 10-100 LOC mark.

another one:

Nanoservice is an antipattern where a service is too fine-grained. A nanoservice is a service whose overhead (communications, maintenance, and so on) outweighs its utility. Like Steve and others, Arnon concludes that Microservices is just another name for SOA

I'm looking for an accurate and explainable distinction between a Micro and a Nano Service. I highly appreciate your opinions!

like image 360
Sunny Sharma Avatar asked Dec 07 '16 18:12

Sunny Sharma


People also ask

What is Nano service?

Nanoservice is an antipattern where a service is too fine-grained. A nanoservice is a service whose overhead (communications, maintenance, and so on) outweighs its utility. Like Steve and others, Arnon concludes that Microservices is just another name for SOA.

Are microservices still a thing?

Microservices are still an infrastructure of choice for many SaaS products. They are most popular with data analytics services, with 45% of apps relying on the loose coupling model. But microservices can only bring value to your product if you stick to coherent processes.

When microservices should not be used?

Microservice architecture: breaking one large, monolithic app with lots of functionality into a network of small apps that all communicate with each other. Working on large teams. The team may be building or maintaining several different streams of functionality at once.


2 Answers

While Jeroen's answer gets close to the gist of the differences between SOA, microservices, and nanoservices, I think it goes slightly awry at the end.

So SOA breaks system functionality down according to business capabilities (e.g. Jeroen's OrderService, or perhaps a CustomerService). Services often call other services, so they very much involve the concept of a network of services with dependencies between themselves, and they also embody the concept of service composition, where some services essentially aggregate other services.

Microservices are very similar and potentially align and implement SOA services, which is why people like Mark Little saw them as the same as SOA. However, they also tend to exhibit specific implementation details that were never clearly articulated in the SOA literature. For example, they're frequently scoped or sized to DDD BoundedContexts, they should use their own DB for storage, and they should publish data changes to subscribers.

Nano-services then have a narrower scope than microservices, and are generally at the functional level, along the lines of what's currently being implmented in serverless architectures. You could therefore compose a microservice from nanoservices.

So following the OrderService example:

  • At the top level we have the OrderService, which is the business focused service for handling orders. It is an SOA-level service, but it consists of 3 individual services.

  • OrderManagementService, which is responsible for creating and managing an order's state. It is a microservice and has it's own data store, it could also be considered an SOA service, but it has multiple endpoints (e.g. CreateOrder, CloseOrder etc) and is not a nano-service.

  • CustomerManagementService, which is responsible for handling the customer details. It is a microservice, has it's own data store, and could also be considered an SOA service, but it has multiple endpoints (e.g. RegisterCustomer, DeleteCustomer etc) and is not a nano-service.

  • OrderProcessingService, which is responsible for handling the Order workflow, orchestrating calls to various external services, such as the OrderManagementService and CustomerManagementService, and is also a microservice and an SOA service. It is not a nano-service.

Now to nanoservices. The team implementing the CustomerManagementService decide they need a common method to validate customer email addresses, and they implement it as a ValidateEmailAddressService, which they make available via a RESTful endpoint. This is a nanoservice, and can best be thought of a single function made available as a service.

Whether or not it's a good idea to provide such functions as services is up for debate, although in the above example I think calling it an anti-pattern is understandable. However, there's an argument that says nanoservices have a place in serverless architectures, so the debate might rage on.

like image 100
Ubiguchi Avatar answered Nov 09 '22 01:11

Ubiguchi


A SOA-service is all about componentization on service level (constructed around a business capability). A Microservice is all about functional composition on service level (input -> processing -> output). A Nanoservice is even smaller than a microservice, and therefore doesn't make any sense.

If you would draw a parallel between services and programming, then SOA can be seen as the component, Microservice as the method and a nanoservice as related lines of code in a method.

An OrderService is a SOA-service that is responsible for order handling, basically a state machine for the lifetime of an order. Composing an confirmation e-mail is a microservice. Getting data for the confirmation e-mail is a nanoservice.

like image 38
Jeroen Avatar answered Nov 09 '22 01:11

Jeroen