back

by WolfOliver·9y ago·view on hn ↗
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.

1 comments
> 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.