concept

Encapsulation

Keeping a component's state private, so it can only be changed through operations that maintain its invariants.

modularitystateboundaries

The architectural version of encapsulation is not private keywords. It is: who is allowed to write this data?

A service that owns its database and exposes an API has encapsulated its state — it can enforce that an order never has a negative total, because every write goes through it. Two services sharing a table have encapsulated nothing; either can violate the other's invariants, and neither can be changed safely.

This is why "shared database between services" is the single most damaging integration pattern. The database schema becomes the contract, every consumer couples to it, and no service can guarantee anything about its own data.