blog.suje.sh

Spring Boot

Distributed Locks and Fencing Tokens — Handling Concurrency Safely in Microservices

Over the last few years, I worked mostly on building microservices using Spring Boot, but I never really had a chance to work directly with distributed locking systems like Redis, ZooKeeper, or etcd. Still, I kept coming across these topics whenever I read about system design, schedulers, or how large systems avoid inconsistent updates. I always wanted to understand how distributed locks actually work and what could go wrong when multiple service instances try to modify the same shared resource.

Circuit Breakers, Retries, Backoff, and Timeouts — Making Microservices Resilient

In microservice architectures, things don’t always fail cleanly. Sometimes a service goes down, but more often it just gets slow, times out, or behaves inconsistently. If we don’t handle these failures properly, a small outage in one service can quickly turn into a cascading failure across the whole system. That’s where timeouts, retries, backoff, and circuit breakers come in — four reliability patterns that make microservices resilient instead of fragile.

Understanding Idempotency — Building Reliable APIs and Microservices

For the last few years, I have been working on building Java microservices using Spring Boot. In day-to-day development, I often come across terms like retries, transactions, and duplicate requests, especially when building APIs that interact with other services or databases. While working on one such service recently, I came across the concept of idempotency. It’s one of those ideas that look simple on the surface but play a big role in making systems reliable. I decided to explore it in a bit more detail and write down what I learned here.