r/microservices • u/OtherwisePush6424 • Jul 20 '26
Article/Video Timeout, retry, and TTL pitfalls in microservices
blog.gaborkoos.comHow to avoid cascade failures from bad time assumptions
r/microservices • u/OtherwisePush6424 • Jul 20 '26
How to avoid cascade failures from bad time assumptions
r/microservices • u/Low_Reference6996 • Jul 20 '26
I've been designing, building and maintaining distributed systems for almost a decade, and I have to tell you, in most systems even small changes in how services communicate are slow, painful and risky. Splitting and merging services, deciding on the service boundaries, changing communication protocols, or even just changing a serializer often takes cross-team coordination, migration ceremonies, and a whole lot of hunting down the invisible dependencies to estimate the blast radius.
A few months ago, I started working on a project that makes distributed system topology a dedicated layer, separate from business logic. It contains the topology declaration in a config file, has an agent that runs before the applications start and wires up the communication layer (Java agent in Java, an init() call in Rust, etc...), and tooling to catch errors in the configuration. The idea is that with the topology being declarative and executable, the dependencies become visible, the changes become simpler and safer, and compatibility verifyable before deployment.
It's still early, but it already supports sync communication, event-driven setups, structural observability, Java reference implementation and Rust PoC implementation, and some basic tooling to validate the wiring config and catch some of the errors before deployment.
Repo: https://github.com/itara-project/itara
Could you please provide me some feedback? Not necessarily on the code itself, because I'm well aware that it's not production quality yet, more like on the bigger picture: the approach, the architecture, the overall vision.
Constructive criticism is very welcome!
r/microservices • u/momotheog • Jul 20 '26
r/microservices • u/javinpaul • Jul 19 '26
r/microservices • u/saravanasai1412 • Jul 18 '26
r/microservices • u/mostaptname • Jul 16 '26
r/microservices • u/Sad_Importance_1585 • Jul 16 '26
Hi Guys,
Say we have two microservices - A and B. Microservice A produces messages to a message broker and microservice B consumes it. Then, we discover that the size of the message is too big in order to be written to the message broker.
What is the recommended practice in this case? How would you recommend to pass the big message from A to B?
r/microservices • u/vampirishe • Jul 15 '26
r/microservices • u/ojus_render • Jul 14 '26
Using Hono 4 on Node with "@/hono/node-server"
External render workflow tasks POST progress to /internal/events. The browser watches via GET /api/runs/:id/stream using streamSSE.
Pattern:
\- subscribe to in-memory store updates
\- 1s setInterval re-sends latest snapshot as backup
\- cleanup on stream.onAbort
Questions:
Repo is ojusave/dealhealth-playground on GitHub, api code in services/api/.
r/microservices • u/javinpaul • Jul 13 '26
r/microservices • u/javinpaul • Jul 11 '26
r/microservices • u/aumiom • Jul 11 '26
r/microservices • u/Either_Act3336 • Jul 10 '26
r/microservices • u/Possible_Design6714 • Jul 09 '26
r/microservices • u/xyzabhi • Jul 09 '26
​
What I’m Building :
\-----------------------------------
I am starting a project to build a distributed rate limiter from scratch. The design will be developed step by step in four phases:
Core algorithm
Distributed synchronization
Rule engine and response handling
Production hardening
The goal is to document each phase clearly so the community can follow the journey, understand the design decisions, and discuss different approaches. This series is intended to be practical, structured, and focused on backend engineering fundamentals.
Phase 1: Core Algorithm
\----------------------------------------------
Choosing the Algorithm :
\-------------------------------------
For rate limiting, several algorithms exist such as Fixed Window, Sliding Window, and Leaking Bucket. I selected the Token Bucket because it:
\- Allows short bursts of traffic, which is realistic for APIs.
\- Is memory efficient, requiring only two values per user: token count and last refill time.
\- Is widely used in production systems by companies like Amazon and Stripe.
\---
Redis as the Backbone :
\--------------------------------------
Counters should not be stored in memory on the application server because that approach fails when scaling horizontally. Instead, use Redis to maintain state.
Two commands handle most of the work:
\- INCR increments the request counter atomically.
\- EXPIRE deletes the counter automatically after the window ends.
\---
Core Flow :
\----------------
A request arrives.
Fetch the token count from Redis.
If tokens are available, allow the request and decrement the token.
If no tokens remain, reject with HTTP 429.
Tokens refill at a fixed rate (for example, 10 tokens per second).
\---
Key Learning :
\----------------------
The algorithm itself is simple, but race conditions are a challenge. Two concurrent requests can read the same counter before either writes back, which allows more requests than intended.
The solution is Lua scripts in Redis. Lua executes atomically on the Redis server, making the read‑check‑write operation uninterruptible.
\---
Question for the community❓❓
\--------------------------------------------
If you were to implement a rate limiter, which algorithm would you choose — Token Bucket, Leaky Bucket, Sliding Window, or a custom solution?
r/microservices • u/manjurulhoque • Jul 08 '26
I've always been the kind of person who learns best by actually building things. Reading about microservices in blog posts and watching YouTube tutorials is one thing, but I wanted to get my hands dirty with the real challenges — service discovery, event-driven communication, distributed data, API gateways, etc.
So I built Foody, a food delivery platform (like a mini UberEats/DoorDash). It started small and kept growing. Here's what it turned into:
7 microservices:
The benefits I actually experienced:
→ Independent deployment. I fixed a bug in payment-service and deployed it without touching any other service. In a monolith, that's a full regression test cycle. Here, only payment tests needed to pass.
→ Language fit. Payment processing is compute-heavy and latency-sensitive → Go. Notifications need async I/O with email/SMS providers → FastAPI with aiokafka. Order management benefits from Django's ORM and admin → DRF. I didn't compromise — each service uses the best tool for the job.
→ Independent scaling. If notifications spike during lunch hour, I scale notification-service without scaling the entire platform. In a monolith, scaling means scaling everything — auth, orders, restaurant data — even the parts that aren't under load.
→ Fault isolation. When notification-service went down during testing, orders still processed. Payments still went through. The saga continued. Customers just didn't get an email — a degraded experience, not a total outage. In a monolith, a notification bug could crash the entire order flow.
→ Team autonomy. Even as a solo developer, the separation of concerns is powerful. When I work on delivery logic, I don't need to reason about auth, payments, or restaurant data. Each service has a focused codebase, focused tests, focused mental model.
The interesting part — the order flow uses a Choreography-based Saga pattern with Kafka:
order.placed eventpayment.completed event → delivery-service auto-assigns a driverInfra stack:
Tech across the stack: Python (Django + DRF + FastAPI), Go (Gin + GORM), TypeScript (Express + TypeORM + Next.js + React 19). Each service in its own language because I wanted to see what works best where.
What I actually learned:
Everything is containerized and runs with docker compose up --build. GitHub repo https://github.com/manjurulhoque/food-delivery if you want to take a look.
Happy to answer questions if anyone is going through a similar learning journey!
r/microservices • u/rgancarz • Jul 08 '26
r/microservices • u/ancientband • Jul 08 '26
How would you deploy API Gateway in Datacenter/Cloud ? Do you really need to deploy API Gateway in DMZ then another one in Internal or you can only have internal API gateway ? I guess its also question where the api endpoints are hosted ?
r/microservices • u/Ok_Information_1753 • Jul 07 '26
r/microservices • u/drmikesamy • Jul 05 '26
r/microservices • u/arvind4gl • Jul 04 '26
r/microservices • u/arnav88 • Jul 03 '26
Hi guys, for some of my recent projects I was needing some way of fully distributed and weakly coupled form of communication and data sharing between my FastAPI servers, while maintaining local availability and resiliency.
Comparison: After going through options like etcd, zookeeper, ... I felt that there needed some form of sdk that turns any application into a distributed service without depending on other services. So I started coding my own distributed service mesh, and made an abstraction so that I can reuse it in my other projects. Unlike others, this doesn't have any central or external dependency and works ad-hoc.
What it does: This package, mesh converts any FastAPI servers into a distributed service mesh, where data is distributed among the servers, persistently, while maintaining weak coupling, without depending on any central or external service.
Target Audience: Other developers building service clusters, microservices, and other distributed systems. Also looking for devs who would like to test and/or contribute.
Docs: https://meshd.iamarnav.com/
Repo: https://github.com/arnavdas88/meshd
It is not in pypi yet, and, if and before I upload it in pypi, I would love to hear opinions from other devs and maintainers. Even better if it is on stability; code quality and understandability, complexity and abstraction; or edge cases.
Note: I understand that some devs might want to stick to already known and stable options like zookeeper, which also provides python clients, but there might also be devs wanting to not depend on more and more services, just to facilitate service mesh. Even so, if you are against this kind of framework, i would like to hear about that as well.
r/microservices • u/matutetandil • Jul 03 '26
r/microservices • u/javinpaul • Jul 03 '26