News for hackers. Stuff that matters.
Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by SuddsMcDuff on Thursday December 13, 2018 @03:37PM (#18675839)
Usually better to use asynchronous communication between services.
Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by bni on Thursday December 13, 2018 @04:34PM (#18676348)
On its own this is a worthless hand wavy statement.

How do you accomplish this when you have a synchronous client (ie a user waiting in his web browser)? Should the browser poll for the result? How could you possibly implement something like this in the real world?

Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by discreteevent on Thursday December 13, 2018 @05:46PM (#18676844)
If it is synchronous or transactional then don't use microservices. Plenty of things can be done asynchronously provided the use case is ok with eventual consistency or within a non urgent time limit.

BTW now that the browser supports websockets (a bidirectional protocol the rest of the world had since the 70s!), you don't have to poll.

Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by SuddsMcDuff on Friday December 14, 2018 @03:00AM (#18679239)
Your comment seems to be a slightly clumsy way of saying "I don't know much about this area of software design, please tell me more", so I'll respond to it in that spirit.

Firstly my terse hand wavey statement was at least clear on the fact that it was talking about communication between services. It said nothing about web browsers or any other human interface.

But since this relatively narrow context is clearly the one which you can most relate to, I'll stay within it. If you think about it, the HTTP request/response cycle is actually an illusion of synchronous communication on top of a transport mechanism which is fundamentally asynchronous. It's an abstraction layer which shields you from the complexities of asynchronous communication. Broadly speaking this is known as the [request/response](https://en.wikipedia.org/wiki/Request%E2%80%93response) pattern.

HTTP by no means the only implementation of the request/response pattern. Even in asychronous messaging systems it's not unusual to see it implemented - https://www.enterpriseintegrationpatterns.com/patterns/messa....

But request/reply is just one of the patterns which exists in the realm of asynchronous communication. There are other, much more common patterns such as send/receive and publish/subscribe. Exploring these patterns opens up whole new approaches to software design.

I wholeheartedly recommend the book [Enterprise Integration Patterns](https://www.enterpriseintegrationpatterns.com/) by Gregor Hohpe and Bobby Woolf. It's quite old now but is still the best and most complete introduction to asynchronous design.

An alternative perspective is from the viewpoint of [Command Query Separation](https://en.wikipedia.org/wiki/Command%E2%80%93query_separati...), and it's relative at the architural level, [Command Query Responsibility Segregation](https://martinfowler.com/bliki/CQRS.html).

Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by discreteevent on Thursday December 13, 2018 @04:15PM (#18676186)
With a good old fashioned message broker for guaranteed eventual delivery, decoupling, discovery and elasticity (if you can fit it in to your setup)
Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by sigmonsays on Thursday December 13, 2018 @04:28PM (#18676313)
I can't tell if this is a joke or not.
Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by discreteevent on Thursday December 13, 2018 @05:40PM (#18676804)
I'm not joking. Just to be clear, I'm taking asynchronous to mean a call that is not transactional. Where you are ok with eventual consistency. If something is transactional then keep it in one service. Make it an action not a transaction and save yourself a lot of grief.

So if something is asynchronous then why not back it up with a message broker and get the properties I listed (in earnest).

Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by SuddsMcDuff on Saturday December 15, 2018 @11:35PM (#18691751)
I'd be interested to know if anyone's had success with distributed transactions in a microservice architecture. I've gotten into a world of pain every time I've tried.

We did have some success at one of my previous companies (wiggle.co.uk), but that was mainly due to pretty tight integration between MSMQ, MSDTC and MS Sql Server. Even then, we tried to avoid distributed transactions as much as possible.

Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by sagichmal on Thursday December 13, 2018 @05:17PM (#18676642)
It is almost never better to use async communication between services. The failure modes are strictly more, and finding and fixing problems is substantially harder.

https://programmingisterrible.com/post/162346490883/how-do-y...

Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by discreteevent on Thursday December 13, 2018 @06:10PM (#18676992)
Part of that article seems to be saying: I don't see any point in having suspension in vehicles. When I overload my truck it handles like shit.
Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by SuddsMcDuff on Saturday December 15, 2018 @11:44PM (#18691774)
Are you basing that on personal experience, or just on that blog post?
Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by sagichmal on Tuesday December 18, 2018 @10:27PM (#18712781)
The blog post elegantly reflects my own experiences.
Re:Microservices Circuit-Breaker Pattern Implementation: Ist... by SuddsMcDuff on Monday December 31, 2018 @09:03AM (#18794499)
I found the blog post to be awful, the rationalization of a man stuck in a particular mindset who failed to adapt to a new paradigm. The line "You have publish-subscribe, but you really want request-response." says it all. He simply cannot imagine a software design which doesn't depend on synchronous request/response.