News for hackers. Stuff that matters.
Re:“It's The Future” by amelius on Wednesday August 17, 2016 @07:08AM (#12303764)
The problem with microservices is that your state is spread over multiple systems. You completely lose the concept of transactional integrity, so you will have to work around that from the start.

The advantage though is that APIs (system boundaries) are usually better defined.

Perhaps one should use the best of both worlds, and run microservices on a common database, and somehow allow to pass transactions between services (so multiple services can act within the same transaction).

Re:“It's The Future” by alexhornbake on Wednesday August 17, 2016 @07:32AM (#12303860)
One of the big advantages of microservices is scaling/migrating the databases behind each service independently. If you need transactions across multiple services then one could argue that either your API endpoint is doing too much, or your services are doing too little. It's not perfect, and certainly not always convenient, but it's a balance. Microservices with a common DB is asking for trouble. The monolith is a better option in that case IMO.
Re:“It's The Future” by nbevans on Wednesday August 17, 2016 @09:05AM (#12304336)
Idempotency, event sourcing and sagas with compensations are ways to solve your problem.

A shared database is an anti-pattern in distributed systems.

Similarly, distributed transactions (ala. DTC) is an anti-pattern.

Distributed systems aren't hard. They're just different.

Re:“It's The Future” by prodigal_erik on Wednesday August 17, 2016 @02:19PM (#12306968)
Say you sell a widget. You want to update both your cash account and your inventory, and never one without the other. Which is easier to understand and more reliable: doing them atomically, or making sure you have designed in 2^n intermediate states and all the code required to complete work that should happen but hasn't yet?
Re:“It's The Future” by kafkaesq on Wednesday August 17, 2016 @04:39PM (#12308274)
The problem with microservices is that your state is spread over multiple systems.

Then again, sometimes it's advantageous to identify parts of your system where aspects of state can be safely decoupled. And in which having them reside in disparate systems (and yes, sometimes be inconsistent or differently available) might actually be a better overall fit.

You completely lose the concept of transactional integrity, so you will have to work around that from the start.

Then again, sometimes your state changes not only don't need to be transactional; it can be disadvantageous to think of them that way.

Depends, depends, depends.

Re:“It's The Future” by amelius on Thursday August 18, 2016 @03:21AM (#12310898)
> Then again, sometimes your state changes not only don't need to be transactional; it can be disadvantageous to think of them that way.

I'm curious; in what kinds of situation would this apply?

> Depends, depends, depends.

Flexibility is usually an important requirement. Often you cannot freeze your architecture and be done with it. I think a transactional approach could better fit with this.

Re:“It's The Future” by kafkaesq on Thursday August 18, 2016 @07:54PM (#12317101)
I'm curious; in what kinds of situation would this apply?

Any situation where the business value of having your state be 100% consistent does not outweigh the performance or implementation cost of making it so.