All case studies

Integrations

Events with no loss and no duplicates

Queues connected services with each other and with external systems, and heavy background jobs went through them too. A lost or repeated message meant mismatched data.

  • Integrations
  • Message queues
  • Backend

Under NDA

This case study combines several projects with a similar problem. The companies’ names and logos are under NDA, and we left out the details that could identify them.


Order
events for one object are processed one after another
Repeats
delivering a message twice does not change the data
Background
heavy jobs do not hold up the user’s request

The problem

The exchange had to survive failures: no message is lost or processed twice, and where order matters, events are handled one after another.


What we did


  1. 01We described the message format in a shared contract that both sides work with.

  2. 02The message key is the object’s id, so its events stay in order, and handlers are idempotent: a duplicate creates no extra records.

  3. 03Messages that fail are set aside in a separate queue, an alert fires, and after a fix they can be replayed.

  4. 04Heavy operations moved out of the user’s request into background queues.

Result

The order of events is kept, there are no duplicates, and failed messages are not lost. Users don’t wait for heavy operations to finish.


Technologies

  • Kafka
  • NATS JetStream
  • PostgreSQL

Have a similar problem?

Write to us about what is going on. We reply within 2 business days.

Write to us


More case studies