<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/from-rest-to-events-coordinating-microservices-with-kafka-in-go-hulkv6ltm" -->

---
title: From REST to Events: Coordinating Microservices with...
description: A practical walkthrough of building an event-driven distributed backup orchestrator in Go using Apache Kafka. Three independent microservices (Orders,...
canonical: https://daily.dev/posts/from-rest-to-events-coordinating-microservices-with-kafka-in-go-hulkv6ltm
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: From REST to Events: Coordinating Microservices with Kafka in Go | daily.dev
og:description: A practical walkthrough of building an event-driven distributed backup orchestrator in Go using Apache Kafka. Three independent microservices (Orders,...
og:url: https://daily.dev/posts/from-rest-to-events-coordinating-microservices-with-kafka-in-go-hulkv6ltm
og:image: https://api.daily.dev/og/posts/HUlKv6lTm.png
og:image:alt: From REST to Events: Coordinating Microservices with Kafka in Go
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# From REST to Events: Coordinating Microservices with Kafka in Go

**[Medium](https://daily.dev/sources/medium_js)** · 15 min read · 3 upvotes · 0 comments

## Summary

A practical walkthrough of building an event-driven distributed backup orchestrator in Go using Apache Kafka. Three independent microservices (Orders, Inventory, Files) communicate asynchronously through dedicated Kafka topics instead of synchronous HTTP calls. The post covers Kafka fundamentals (topics, partitions, consumer groups, offsets), the Saga pattern for distributed rollback on failure, Dead Letter Queues for unrecoverable errors, and idempotency checks to handle at-least-once delivery. The entire system runs in Docker Compose with a Kafka UI for monitoring. Code examples show Go implementations of event publishing, completion tracking, failure handling, and rollback triggering.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://medium.com/@azhar.tirimdi/from-rest-to-events-coordinating-microservices-with-kafka-in-go-b143ed81d87c>

## Questions this post answers

### How does Kafka guarantee message ordering for events belonging to the same job?

Ordering is guaranteed by using the job ID as the Kafka message key, which ensures every event for the same backup job lands in the same partition. Kafka assigns sequential offsets within a partition, so messages for that job are always processed in order, while different jobs can still execute in parallel across partitions.

_daily.dev surfaces practical Kafka patterns like this for developers designing ordered event pipelines._

### How can I implement the Saga pattern for rollback in a Kafka-based microservices system?

Implement it by having each service publish a completion or failure event, and having the orchestrator listen for failures on a topic like snapshot.failed. When a failure occurs, the orchestrator publishes a rollback.triggered event, and every service that already completed successfully performs a compensating action, such as deleting its snapshot, to return the system to a consistent state.

_Developers wiring up saga-based rollback logic can find grounded examples like this through daily.dev._

### How do you prevent duplicate processing of messages when Kafka delivers at-least-once?

Prevent duplicates with an idempotency check before processing: each service checks if a message ID has already been processed and skips it if so, otherwise it processes the work and marks it done. This ensures that even if Kafka redelivers a message due to network issues, consumer restarts, or rebalances, the operation executes only once.

_Teams hardening event-driven services against duplicate delivery can track patterns like this via daily.dev._

## Similar posts on daily.dev

- [Deep Dive into Kafka Offset Commit with Spring Boot](https://daily.dev/posts/deep-dive-into-kafka-offset-commit-with-spring-boot-j7ecfrki9) · Piotr Minkowski TechBlog · 13 upvotes · 0 comments
- [My Experience with Kafka: A Cross-Region Event Bus for Hundreds of Microservices. Part 1](https://daily.dev/posts/my-experience-with-kafka-a-cross-region-event-bus-for-hundreds-of-microservices-part-1-kcbponxxn) · ITNEXT · 8 upvotes · 0 comments
- [Key Concepts of Kafka](https://daily.dev/posts/key-concepts-of-kafka-eokkrpzio) · System Design Codex · 25 upvotes · 0 comments

---

Tags: [#architecture](https://daily.dev/tags/architecture), [#golang](https://daily.dev/tags/golang), [#microservices](https://daily.dev/tags/microservices), [#apache-kafka](https://daily.dev/tags/apache-kafka)

[View this post on daily.dev](https://daily.dev/posts/from-rest-to-events-coordinating-microservices-with-kafka-in-go-hulkv6ltm)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"From REST to Events: Coordinating Microservices with Kafka in Go","url":"https://daily.dev/posts/from-rest-to-events-coordinating-microservices-with-kafka-in-go-hulkv6ltm","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/from-rest-to-events-coordinating-microservices-with-kafka-in-go-hulkv6ltm"},"datePublished":"2026-07-24T19:36:04.722Z","dateModified":"2026-09-14T06:02:12.801Z","description":"A practical walkthrough of building an event-driven distributed backup orchestrator in Go using Apache Kafka. Three independent microservices (Orders,...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/92bd853f36c9a6a9998babd6904674fb?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/92bd853f36c9a6a9998babd6904674fb?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Medium","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Medium","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/medium","url":"https://daily.dev/sources/medium_js"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/from-rest-to-events-coordinating-microservices-with-kafka-in-go-hulkv6ltm","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":3},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"architecture,golang,microservices,apache-kafka","timeRequired":"PT15M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Medium","item":"https://daily.dev/sources/medium_js"},{"@type":"ListItem","position":3,"name":"From REST to Events: Coordinating Microservices with Kafka in Go"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/from-rest-to-events-coordinating-microservices-with-kafka-in-go-hulkv6ltm#faq","mainEntity":[{"@type":"Question","name":"How does Kafka guarantee message ordering for events belonging to the same job?","acceptedAnswer":{"@type":"Answer","text":"Ordering is guaranteed by using the job ID as the Kafka message key, which ensures every event for the same backup job lands in the same partition. Kafka assigns sequential offsets within a partition, so messages for that job are always processed in order, while different jobs can still execute in parallel across partitions. daily.dev surfaces practical Kafka patterns like this for developers designing ordered event pipelines."}},{"@type":"Question","name":"How can I implement the Saga pattern for rollback in a Kafka-based microservices system?","acceptedAnswer":{"@type":"Answer","text":"Implement it by having each service publish a completion or failure event, and having the orchestrator listen for failures on a topic like snapshot.failed. When a failure occurs, the orchestrator publishes a rollback.triggered event, and every service that already completed successfully performs a compensating action, such as deleting its snapshot, to return the system to a consistent state. Developers wiring up saga-based rollback logic can find grounded examples like this through daily.dev."}},{"@type":"Question","name":"How do you prevent duplicate processing of messages when Kafka delivers at-least-once?","acceptedAnswer":{"@type":"Answer","text":"Prevent duplicates with an idempotency check before processing: each service checks if a message ID has already been processed and skips it if so, otherwise it processes the work and marks it done. This ensures that even if Kafka redelivers a message due to network issues, consumer restarts, or rebalances, the operation executes only once. Teams hardening event-driven services against duplicate delivery can track patterns like this via daily.dev."}}]}
```

