News for hackers. Stuff that matters.
Re:The Death of Microservice Madness in 2018 by dvt on Sunday January 21, 2018 @06:05PM (#16200624)
> That's plainly wrong. I get the gist of what you are saying and I more or less agree with it but you expressed it poorly.

I'm not sure what you think side effects are, but I'm using the standard computer science definition you can look up on Wikipedia. If you have a microservice that modifies, e.g. some hidden state, it's a disaster waiting to happen. Having multiple microservices that have database side-effects will almost always end up with a race condition somewhere. Have fun debugging that.

Re:The Death of Microservice Madness in 2018 by friendly_chap on Sunday January 21, 2018 @06:29PM (#16200738)
I'm using the same definition. Writing data to a database is a side effect. If there is no side effect then what's the point of calling a service? So it does computation? Then who saves the result of that computation, thus doing a side effecting operation?

If no one then what's the point of that service's existence?

Re:The Death of Microservice Madness in 2018 by dvt on Sunday January 21, 2018 @06:34PM (#16200756)
A side effect is by definition some mutation that's out of the scope of the function -- if the purpose of the microservice is to put stuff in a database, then (by definition) it's not a side effect. Switching a flag on top of doing some work, on the other hand (e.g. flip "processed" to true in a global database) is a side effect.
Re:The Death of Microservice Madness in 2018 by friendly_chap on Sunday January 21, 2018 @06:45PM (#16200801)
Modifying data in a database is a side effect. Since you brought up the wikipedia definition, here it is:

> In computer science, a function or expression is said to have a side effect if it modifies some state outside its scope or has an observable interaction with its calling functions or the outside world besides returning a value. For example, a particular function might modify a global variable or static variable, modify one of its arguments, raise an exception, write data to a display or file, read data, or call other side-effecting functions.

Note "write data to a display or file". I think we agree that writing to a database falls under this definition, hence using terms like "side effecting" when talking about microservices is misleading.

Re:The Death of Microservice Madness in 2018 by dvt on Sunday January 21, 2018 @06:55PM (#16200831)
Yeah, I stand corrected. I am indeed conflating scope with purpose. Should've been clearer in my OP.
Re:The Death of Microservice Madness in 2018 by Retric on Sunday January 21, 2018 @08:48PM (#16201322)
Technically it depends on if anything outside the service can see the database and if the state is saved after the service returns. It might seem useless to call a DB if you're not going to save state, but a Rube Goldberg architecture could do so for the lulz.
Re:The Death of Microservice Madness in 2018 by brucephillips on Sunday January 21, 2018 @06:40PM (#16200782)
If a function writes to a DB, yes, that's a side effect. I think you're conflating "scope" and "purpose".
Re:The Death of Microservice Madness in 2018 by dvt on Sunday January 21, 2018 @06:55PM (#16200834)
Correct, my bad.
Re:The Death of Microservice Madness in 2018 by openasocket on Sunday January 21, 2018 @06:30PM (#16200742)
So, according to your advice, we shouldn't use micro-services that write to a database, ever? That doesn't make any sense to me. Multiple services writing to the same database can be bad, but a single service storing persistent state in a database is perfectly fine. Just because we're micro- doesn't mean we have to cut out 90% of what a service is.
Re:The Death of Microservice Madness in 2018 by Double_a_92 on Monday January 22, 2018 @04:48AM (#16203169)
How would services such as "sign up", "login", "edit profile", and others that need auth be split?
Re:The Death of Microservice Madness in 2018 by bonesss on Monday January 22, 2018 @07:15AM (#16203804)
Just like all the other authenticated APIs in the world: you get a token when you log on, and use that token to authenticate yourself on future calls to the services. That's a lot of what OAuth and its ilk handle.

This management of API boundaries is likely handled for you by an app, though, so from a user perspective the story is still "open netflix, enter password, watch movie".

Re:The Death of Microservice Madness in 2018 by Double_a_92 on Friday January 26, 2018 @06:44AM (#16238424)
But how is the data shared? E.g. when you sign up you store your data. But to edit it, or to just display it you need to access it again, but that data only belongs to the sign-up microservice...?