dine. a kitchen run by sagas Book a table
Log in with Google (coming soon)

Articles

Tiếng Việt · English

What dine is, and why this site exists

October 14, 2026 · about 7 min read

Microservices, sagas, event-driven: these words show up in a lot of CVs and interviews. But ask "what exactly is a saga, and how do its parts work together?" and the answer often stops at the definition. dine is a small but real, running system built to answer that question by letting you see it for yourself.

Why I built dine

I have met quite a few people who list "microservices" and "saga" on their CV without having built one themselves. Many developers have also asked me: what is a saga, concretely? How does an order move between services? When something fails halfway, who cleans up?

There is no shortage of theory on these topics; the books and articles already exist. What is missing is a system that is actually running and that anyone can open up: which order is where, which service answered when, and how the system reacts when something goes wrong. I believe building such a system yourself is the fastest way to understand it. And once it is built, it might as well be open for everyone to look at.

dine is the result: a simulated restaurant that takes table bookings, running on several real services that talk to each other through Kafka. Every order on the home page really goes through the system (some are placed by a bot, so there is always something to watch), and every order has its own page showing how it travelled through the system.

A restaurant that takes bookings

A guest picks a time, a party size and a few dishes in advance. For one booking to succeed, three things must all happen:

If any one of them fails, the whole booking must be cancelled, and whatever was already done must be undone. It sounds simple, but once the three steps live in three different services, each with its own database, the problem contains almost every hard part of distributed systems.

The services

Each service is its own repository, written in Go, with its own database, deployed on its own.

dine architecture: the browser calls the gateway, which forwards bookings to order; order writes to MySQL and sends commands through Kafka to reservation, kitchen and payment; the three services reply to order through Kafka as well. Browser dine.web gateway + auth (Google) order takes orders, coordinates own MySQL Kafka commands replies reservation holds seats out of 500 own MySQL kitchen deducts ingredients, stock own MySQL payment takes payment (simulated) own MySQL Solid: commands going out. Dashed: replies coming back. The three services never call each other.
Each box is one service, one repository, one database. Guests only talk to order; everything behind it goes through Kafka.
ServiceWhat it does
orderThe center of the system. Guests book through the order API. It records the order, sends commands to the other services through Kafka, collects their replies, and decides whether the order succeeds or has to be cancelled and undone.
reservationHolds seats out of the restaurant's 500. A seat is held from booking until the guest finishes eating and leaves; only then is it free again. A cancelled order releases its seats.
kitchenCooks and manages supplies. Each order deducts ingredients for its dishes. When stock runs low, the kitchen restocks on its own, like a real storeroom. A cancelled order puts the ingredients back.
paymentA simulated payment, no real money. There is no amount limit, and about 5% of charges are randomly declined so there are always failed orders to look at. A cancelled order is refunded.

There are also a few supporting repositories: gateway, the single entry point for every API; auth, which handles Google sign-in; web, the site you are reading; one that checks the data contracts between services; and an Ansible repository that sets up the servers and deploys everything.

The three services reservation, kitchen and payment do not know about each other, and do not know there is a saga at all. Each one listens for commands on Kafka, does its part, and replies. The only one who knows the whole story is order.

Microservices are not just code split into repositories

Splitting an application into four repositories takes an afternoon. The hard part starts right after: everything the database used to handle for you, you now have to do yourself. These are the problems dine had to solve, each with its own article (most of them in Vietnamese for now):

How to explore dine

The whole site is available in English (the EN / VI button in the header switches language); most articles are still in Vietnamese and are being translated. If you are just starting, read the articles in order from the Articles page.

dine is a personal project for learning and sharing, not a real restaurant. No dish is ever cooked, and no real money is ever charged.

Spotted a mistake, or have a question? Write to [email protected].

dine is a personal project about distributed systems, written in Go: orchestrated sagas, transactional outbox, Kafka. More articles.