Diagnosing a change in one microservice that breaks others: using traces, deployment markers and dependency maps to find hidden coupling through shared databases, shared NuGet libraries, synchronous call chains and message contracts, then mitigating and removing it.
First mitigate: roll back the changed service or turn off its feature flag and confirm the others recover; that also proves the link. Then find how they are coupled. Line up deployment markers with the error spikes, follow distributed traces and the application map from the failing services, and check the four usual hidden couplings: a shared database (others read the changed columns), a shared library (a common NuGet package changed behaviour), synchronous call chains (one slow service times out everything upstream) and message contracts (a renamed field, a new enum value, DLQs filling). The real fix removes the coupling: contract tests, one data owner, thin shared libraries, asynchronous boundaries and timeouts with circuit breakers. The trade-off: decoupling costs effort, so fix the couplings that actually bite first.
"When a change in one service breaks three others, my first job is stopping the damage, not finding the cause. I roll back the changed service, or turn off the feature flag if the change is behind one, and watch whether the other three recover. If they do, I've both mitigated and confirmed the link, and I can investigate without customers waiting.
For example, at [company], a [customer] service released a change that [renamed a column / tightened validation], and within [40 minutes] the [orders, billing and notifications] services were throwing errors. We rolled back and they recovered in [minutes]. Then I put the deployment markers next to the error rates in Application Insights, and followed failing traces back. It turned out to be [two couplings at once]: billing read the customer table directly, and orders and notifications used a shared
Company.CommonNuGet package whose new version changed [a JSON serialiser setting]. Neither showed up in any API contract, which is why nobody saw it coming.So I always check four places. Is there a shared database, and does anyone else read the tables that changed? Is there a shared library, and did its version move? Is there a synchronous chain, where the changed service got slower and everything upstream timed out because nobody had sensible timeouts or circuit breakers? And is there a message contract, where a field was renamed or an enum value added and consumers fail or dead-letter? The lasting fix is removing the coupling, not just being more careful: contract tests, one owner per table, shared libraries limited to plumbing, and timeouts and breakers on every call. The mistake I see is treating it as a one-off bad deploy; three services breaking means the architecture has a hidden dependency."
| Coupling | How it breaks | How you see it | Lasting fix |
|---|---|---|---|
| Shared database | Column renamed, type changed, rows locked | SQL errors in other services; Query Store / sys.dm_exec_sessions by login or Application Name |
One owner; others use API, events or read model |
| Shared library (NuGet) | Behaviour change in serialisation, validation, auth or retry defaults | Failures start when consumers redeploy with new package; diff of package versions | Thin libraries (plumbing only), semantic versioning, no domain logic shared |
| Synchronous chain | Changed service slower or erroring; callers time out, thread pools and connections exhaust | Traces show long spans downstream; rising latency then errors upstream | Timeouts, circuit breakers, fallbacks, async messaging, caching |
| Message contract | Field renamed, enum added, meaning changed | Deserialisation errors, nulls, DLQ growth | Contract tests, tolerant readers, versioned events |
Others worth checking: shared configuration (one Key Vault secret or App Configuration key used by many), shared infrastructure (a Redis key format, a cache all services use), and shared identity (a token audience or scope change).
A change in a [customer] service caused errors in three services for 35 minutes; ~4% of checkouts failed. After rollback, the cause was a shared table read by billing and a shared NuGet package that switched PropertyNamingPolicy. Moving billing to a CustomerUpdated read model and stripping the shared package down to logging and telemetry setup removed both couplings; the next six customer-service schema changes shipped with no cross-service impact.
Checks structured incident handling and the ability to find coupling that isn't visible in APIs.
Green flags
Red flags
APIs are visible: they have routes, OpenAPI documents and maybe contract tests. Hidden couplings don't. A SELECT from another service's table, a shared DLL, a shared Redis key or a timeout chain only shows up at runtime. The changing team can't see them in their own repo, so they ship confidently.
deploy v2 of Customer service (renames column, bumps Common 3.0)
|
+----------------------------+-------------------------------+
| shared DB | shared NuGet | sync chain
v v v
Billing: SELECT FullName Orders/Notifications: Checkout -> Customer (now 800 ms)
-> SqlException Common 3.0 serialises -> 2 s timeout x retries
"Invalid column" camelCase -> others expect -> thread pool and connection
PascalCase -> nulls pool exhaustion -> 5xx
SqlException number 207 (invalid column) points to the database; JsonException or unexpected nulls to contracts or libraries; TaskCanceledException / TimeoutRejectedException to sync chains.sys.dm_exec_sessions with program_name (from Application Name), Query Store by query text to find who reads a table.dotnet list package --include-transitive before and after; lock files (packages.lock.json) make this exact.Shared database: assign an owner, give other services their own identity with no access, replace reads with events into a local read model or an API (see database per service).
Shared library: keep shared packages to cross-cutting plumbing (logging setup, telemetry, auth handler configuration). Never share domain models or DTOs between services as a library; each consumer defines its own DTO for what it reads. Version with SemVer and treat behaviour changes as major.
Synchronous chains: every outbound call gets a timeout shorter than the caller's own budget, a circuit breaker and a fallback where possible (AddStandardResilienceHandler). Move non-essential work to messages so a slow service doesn't block the request.
Message contracts: contract tests or schema registry checks; additive changes only; tolerant readers.
Application Name=<service> to connection strings and list which services touch each table using sys.dm_exec_sessions and Query Store.dotnet list package --include-transitive across your services and find which share an internal package and at which versions.Two of the fixes: each consumer owns its DTO instead of sharing a library type, and every outbound call has a timeout and a circuit breaker.
// Before: Orders and Notifications both referenced Company.Common.Contracts.CustomerDto from a shared NuGet package.
// A serialiser change in that package broke both at once.
// After: each consumer declares only the fields it reads, with its own serialiser options.
namespace Orders.Integration;
using System.Text.Json;
using Microsoft.Extensions.Http.Resilience;
public sealed record CustomerSummary(Guid Id, string DisplayName, string? Email);
public sealed class CustomerClient(HttpClient http)
{
private static readonly JsonSerializerOptions Json = new(JsonSerializerDefaults.Web); // explicit, not inherited
public Task<CustomerSummary?> GetAsync(Guid id, CancellationToken ct) =>
http.GetFromJsonAsync<CustomerSummary>($"/customers/{id}", Json, ct);
}
public static class CustomerClientRegistration
{
public static IServiceCollection AddCustomerClient(this IServiceCollection services)
{
services.AddHttpClient<CustomerClient>(c => c.BaseAddress = new Uri("https+http://customer"))
.AddServiceDiscovery()
.AddStandardResilienceHandler(o =>
{
// Our own request budget is 2 s, so the dependency gets less than that in total.
o.AttemptTimeout.Timeout = TimeSpan.FromMilliseconds(500);
o.TotalRequestTimeout.Timeout = TimeSpan.FromSeconds(1.5);
o.CircuitBreaker.FailureRatio = 0.2; // open quickly instead of piling up requests
});
return services;
}
}
-- Who else reads the table we want to change? Run while the system is under normal load.
SELECT s.program_name, s.login_name, COUNT(*) AS sessions
FROM sys.dm_exec_sessions AS s
WHERE s.is_user_process = 1
GROUP BY s.program_name, s.login_name;
-- And which queries mention the column (Query Store):
SELECT TOP (20) q.query_id, t.query_sql_text
FROM sys.query_store_query AS q
JOIN sys.query_store_query_text AS t ON t.query_text_id = q.query_text_id
WHERE t.query_sql_text LIKE N'%FullName%';
A cascading break from a small change is a symptom of a distributed monolith: services that deploy separately but are coupled at runtime or through shared artefacts. The senior response is two-speed: fast mitigation and a blameless review, then a prioritised plan to remove the couplings that cause the most incidents, rather than a rewrite.
| Coupling | Cheapest guard | Proper fix | When it's acceptable |
|---|---|---|---|
| Shared database | Separate logins, alerts on foreign access | Data ownership + events/read models | Temporary, during a migration, with an owner and end date |
| Shared library | Lock files, SemVer, changelog | Plumbing-only packages, own DTOs | Logging/telemetry/auth setup |
| Sync chain | Timeouts + breakers | Async messaging, caching, fewer hops | Calls that truly need a live answer |
| Message contract | Contract tests / schema registry | Versioned, additive events | — |
Measure: incidents caused by changes in another service, number of services reading each table, and the depth of synchronous call chains in traces.
Sharing tables couples services through the schema: renaming a column needs both teams to release together, business rules are enforced in two codebases and drift apart, and one service's long transaction or bad query blocks the other. You also lose independent scaling and failover. With database per service, each service is the only writer of its data and others use its API, events or a local read model. To migrate: choose an owner, make the other service read-only with its own login, replace its reads with an API or events, then move and separate the data with expand-and-contract steps. The trade-off: you give up cross-service joins and atomic transactions in exchange for independent change.
Use consumer-driven contract tests: each consumer writes a test that records the requests it makes and only the fields it relies on, producing a pact file (PactNet 5.x, Pact specification v4). The provider's pipeline replays every consumer's pact against the real service, and the Pact Broker's can-i-deploy blocks a release that would break a consumer in that environment. Unlike end-to-end tests, they run in seconds per service without deploying everything. Pair them with compatibility rules: additive changes only (new optional fields, new endpoints), tolerant readers that ignore unknown fields, and a new version plus a deprecation period for anything breaking. The trade-off: contract tests catch shape and semantics you encode, not every behaviour, so keep a few journey-level smoke tests.
A logical boundary decides what code may depend on: a module, an assembly, a namespace, a database schema. A deployment boundary decides what ships and runs together: one App Service, one container, one Function app.
They don't have to match. A modular monolith has many logical boundaries in one deployable. Microservices add deployment boundaries so units can be deployed independently, which only works if contracts stay backward compatible.
The quiet killer is shared libraries: a NuGet package with shared domain models or contracts that every service must upgrade together turns separate deployables back into a distributed monolith.
Monorepo vs polyrepo is about workflow, not architecture: a monorepo makes cross-cutting changes easy; a polyrepo forces versioning. The trade-off is coordination cost vs isolation.
How to tell it (STAR)
**S:** At [company], a release of the [customer] service broke [three] other services within [40 minutes], and about [4%] of checkouts failed. **T:** I was incident lead and then owned the follow-up. **A:** I had the team roll back first, which restored everything and confirmed the link. Then I lined up deployment markers with the errors, followed traces, and checked database sessions and package diffs. We found two hidden couplings: billing read the customer table directly, and two services shared DTOs through a common package whose new version changed JSON naming. I led the fixes: a read model for billing, consumer-owned DTOs, and timeouts and breakers on checkout's calls. **R:** The next [six] customer-service schema changes shipped with no impact on other services, and change-related cross-service incidents dropped [from about one a month to none that quarter].
Last updated 23 Nov 2026.