
Ask HN: Why the heck do we now say that functions are microservices - WolfOliver
.. when taking about serverless
======
dragonwriter
Because a function _that is callable over HTTP or triggered by a message
queue_ is conceptually quite a good model for a microservice (or, for old-
schools structured analysis fans, a non-decomposable DFD process bubble, which
amounts to almost the same thing) is, and a primary use (though not the only
use) of such functions is implementing microservices.

~~~
WolfOliver
But would this not lead to a system with very low cohesion. Because I would
for example have one function for creating an user and another for updating
the user.

I'would not say that these two functions are two microservices because they
really on the same database schema. What also means when I change the database
schema I must update these two functions together. So I can't deploy them
separately, what IMO is a must have if they are considered to be two different
microservies.

~~~
dragonwriter
> But would this not lead to a system with very low cohesion. Because I would
> for example have one function for creating an user and another for updating
> the user.

A serverless-architecture network-callable function is just an entry point
which can dispatch to other "private" functions, and the same network-callable
function can be called with different HTTP methods with the method as part of
the arguments passed from the hosting environment to the function.

Functions are (as has frequently been observed in comparisons of impure
functional programming and OOP) isomorphic to objects in the OOP sense, and
it's quite possible in this model to have one function, dispatching on an
argument to subordinate functions (which would not be independently callable
over the network), that handles all operations on a logical object or class of
objects.

------
osipov
Some functions implemented using serverless frameworks (e.g. Lambda or
OpenWhisk) are microservices.

~~~
WolfOliver
When I think of a microservice in context of Domain Driven Design and high
cohesion then I struggle to find examples of function which can be considered
as microservice. I rather would call them nanoservice.

