How do you handle shared logic or common code across multiple services without creating tight coupling?
Last updated
Share only stable, non-business code: logging, tracing, auth helpers, contracts/schemas (Protobuf, OpenAPI), and thin generated clients.
Never share domain logic or ORM entities across services. It forces lockstep deploys and leaks one context's model into another.
Publish shared code as small, independently versioned libraries (semantic versioning) so consumers upgrade on their own schedule. Prefer duplication when logic will likely diverge.