Reliability
Multi-step operations across services
One operation changed data in different systems at once, and some ran for a long time. A failure halfway was not allowed to break consistency or throw away work already done.
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.
- Compensation
- every step has an action that reverses it
- Resume
- after a failure, a process does not start over
- Tests
- for all of the coordination logic
The problem
If one service failed, the others had already written their part of the operation. The mismatches had to be found and fixed.
What we did
01We built a service that coordinates distributed operations. Every step has a defined action that reverses it.
02Long processes are described as steps with saved state, so after a failure or a restart they continue where they stopped.
03The coordination logic is covered with tests, because a mistake in it affects every operation.
Result
An operation either completes in every service or is reversed, and long processes survive failures and restarts.
Technologies
- Python
- Go
- Kubernetes
Check your own system
Three questions on this topic. After each one, a short note on why it matters.
If an operation fails halfway, does the data in all services stay consistent?
Why it matters
Otherwise some services have already written their changes and others have not, and that is fixed by hand.
Does every step of an operation have a way to undo it?
Why it matters
Without compensating actions, a distributed operation can only be rolled back by hand.
Will a long process carry on if the service restarts halfway?
Why it matters
Otherwise every deploy or failure starts such processes from scratch or loses them.
Looks like this part is in order
If you want someone to look at the rest of the system from the outside, write to us.
There is something to check
Incidents usually start in places like these. Write to us about how this part of your system works, and we will suggest what to check first.
This is worth looking at first
There are several weak spots, and the rest of the system probably has some too. Write to us, and we will work out what to fix first.
If your mail app did not open, here is the address: hello@infiniteloop.tech
Have a similar problem?
Write to us about what is going on. We reply within 2 business days.
More case studies
- Content Idempotent model calls: no repeat paid for, no call lost
- Subscriptions Paid content for paid subscriptions only
- CI/CD Every release reaches testers the same way, from any machine
- Integrations Events with no loss and no duplicates
- Real time Stream processing in real time
- Content delivery New content without a release: downloaded whole, read offline