News for hackers. Stuff that matters.
Re:The Death of Microservice Madness in 2018 by sk5t on Sunday January 21, 2018 @05:35PM (#16200452)
> A microservice should generally not have side effects

I gotta ask, how is this realistic? A salient feature of most of the software I've worked on is that it has useful side effects.

Re:The Death of Microservice Madness in 2018 by endorphone on Sunday January 21, 2018 @06:54PM (#16200828)
It isn't realistic, and borders on absurd gatekeeping.
Re:The Death of Microservice Madness in 2018 by dragonwriter on Sunday January 21, 2018 @11:33PM (#16201949)
I think that it is accurate to say that in a system composed of microservices, a microservice should not effect the state of other microservices in the system other than by consuming them.

Whether it should consume other microservices is less clear, and gets into the choreography vs. orchestration issue; choreography provides lower coupling, but may be less scalable.

Re:The Death of Microservice Madness in 2018 by ozim on Monday January 22, 2018 @04:16AM (#16203033)
Services consuming other services, sounds like recipe for spaghetti. I hope people use layering where you don't call stuff that is in the same layer.
Re:The Death of Microservice Madness in 2018 by bonesss on Monday January 22, 2018 @07:23AM (#16203834)
> Services consuming other services, sounds like recipe for spaghetti.

Can we extend that logic to classes or interfaces? Accessing data operations through a well-established API is generally seen as a good thing and is the exact cure for spaghetti...

Service APIs also entail load balancing and decoupled deployments, so they eliminate unclear architecture that arises at the app level when trying to tune the whole for individual components. Particularly when a shared component exist across multiple systems.

For a generalized microservices architecture: layering is a bit of a misnomer as everything is loosely in the same 'service' layer... I'd also point out that in N-tiered applications application services or domain services calling other services at the same layer is seen as the solely approved channel for re-use, not an anti-pattern.

Re:The Death of Microservice Madness in 2018 by romaniv on Monday January 22, 2018 @01:37PM (#16206697)
>Can we extend that logic to classes or interfaces?

This was one of the main ideas behind the original definition of OOP. The original notion of "object" was very similar to our current notion of "service":

https://www.youtube.com/watch?v=QjJaFG63Hlo

Objects received messages, including messages sent over the network. There was not supposed to be a clear distinction between local and remote services - by design. A lot of inter-computer stuff could be/was handled transparently.

Re:The Death of Microservice Madness in 2018 by dragonwriter on Monday January 22, 2018 @10:00AM (#16204772)
Look, I generally prefer choreography over orchestration, too, but architectural dogma can conflict with pragmatism, and at a minimum Netflix’s argument as to why they found orchestration more usable at scale seems plausible enough for me not to reject it out of hand without experience with the two patterns at anything like Netflix scale.

Just like sometimes, in real-world C, “goto” is the right tool, even though arbitrary jumps of that kind are also a “recipe for spaghetti”.

Re:The Death of Microservice Madness in 2018 by dvt on Sunday January 21, 2018 @05:39PM (#16200488)
A microservice, imo, should just be a simple black box that takes in some input and returns some output (sometimes asynchronously). No side-effects necessary. No fiddling with database flags or global state, and definitely no hitting other microservices. See @CryoLogic's post for a good example. This means that you simply can't build some things using microservices -- like logging in a user -- and you'd be right.
Re:The Death of Microservice Madness in 2018 by joshschreuder on Sunday January 21, 2018 @06:27PM (#16200733)
Aren't you talking about pure functions, more applicable to serverless than the commonly accepted use of microservices?
Re:The Death of Microservice Madness in 2018 by dominotw on Sunday January 21, 2018 @06:19PM (#16200689)
> A microservice, imo, should just be a simple black box that takes in some input and returns some output

I am not quite sure what you mean. A microservice with REST api that has POST method is not a microservice?

Re:The Death of Microservice Madness in 2018 by richardknop on Sunday January 21, 2018 @09:21PM (#16201467)
But that is ridiculous. Fiddling with database flags is silly, I agree, but inserting and updating database is a completely normal side effect of most business logic. So if your microservice handles any kind of ordinary feature of your business solution, it will almost definitely have side effects because it will write to database. There might be services which just do some computation in memory and return result to you but I think those will be a small minority, most of your services dealing with features such as payment, subscriptions, identity etc (just some examples) will have useful side effects.
Re:The Death of Microservice Madness in 2018 by anonytrary on Sunday January 21, 2018 @07:11PM (#16200899)
I agree, mostly. A black box can have internal state, but it should not have shared state with another black box (defeats the purpose calling it a black box). If two black boxes (microservices) shared state, then we'd need to think of the composite as a single black box.

If two black boxes directly contact each other, then that also defeats the purpose. Microservices are not appealing unless talk via message queues. The whole point of microservices was to handle scale independently for independent functions.

Where do you suggest storing that state if it needs to be persistent? The definition of microservices should not assume anything about how long I need to track my data. If two of your microservices are touching the same database fields, then that's the implementor's mistake.

Re:The Death of Microservice Madness in 2018 by duncan-donuts on Sunday January 21, 2018 @07:15PM (#16200910)
Why can't you build a microservice that does a handshake with an API gateway to authenticate a user? When doing microservices you have to have a sane auth strategy, and that generally means you encapsulate authentication/authorization in a service that your gateway will talk to.