News for hackers. Stuff that matters.
Re:Microservices Architecture on Google Cloud by latch on Monday November 22, 2021 @12:47AM (#29303211)
I don't think you can have a serious conversation about microservices without talking about poison messages and ordering guarantees (both with respect to each other and not). What does Pub/Sub provider to deal with those?

(If you're interviewing somewhere and they say they have microservices, ask how they deal with poison messages. The answer can be telling).

Re:Microservices Architecture on Google Cloud by thatsamonad on Monday November 22, 2021 @01:42AM (#29303537)
I’m not sure if this fully addresses your comment but, similar to AWS SQS, Google Cloud Pub/Sub supports both message ordering[0] and dead letter topics[1].

[0](https://cloud.google.com/pubsub/docs/ordering#receiving_mess...)

[1](https://cloud.google.com/pubsub/docs/handling-failures#setti...)

Re:Microservices Architecture on Google Cloud by aliswe on Monday November 22, 2021 @01:36AM (#29303501)
Whats a good answer? I want more information ...
Re:Microservices Architecture on Google Cloud by latch on Monday November 22, 2021 @02:03AM (#29303652)
Tongue-in-cheek answer (but really what I believe):

Don't use microservices.

Short answer:

It's extremely difficult and, there isn't always a good solution. Different approaches are used on a _per consumer_ basis. That's the gist of what you want to hear.

Long answer:

In some cases ordering and lost messages don't matter so much, so any failed messages can just be thrown out.

For some queues lost messages matters, but not ordering. So you can put the message at the back of the queue (possibly delayed if that's support), so you don't block other messages.

Partitioning helps isolated poison messages to a vertical (e.g., customer_id).

Always adding id and timestamp to each message can let consumers behave more smartly (e.g. throwing away out of order or already processed messages).

But when none of that helps and ordering and delivery matter (which I think will make up most cases for any non-trivial system)...I'd love to know too. Good alerts to wake up developers?

Then there's how to scale this and making it reliable What's the ordering guarantee across N consumers? What if a consumer nack's a message. What if there's prefetching?