Bad smells in the microservices architecture
Just as there are bad smells in code – issues that hide between methods and classes – there are also problems related to how software components work together in a software architecture. These are recurring patterns or, rather, anti-patterns, and when we see them, we should be suspicious and take action if needed. Let’s take a look at some of the most common ones.
Shared persistence
“Don’t cross the streams,” as the Ghostbusters used to say. It’s a bit like what happens with shared persistence. We talk about shared persistence when two or more microservices share the same persistent data, such as a database, a Redis instance, or a cache. This can cause a few problems. First, if services A and B try to read and write to the same data layer at the same time, synchronization problems can occur. What one service reads might have been written by another, and vice versa.
However, the most...