All Articles

Pattern: Database Wrapping Service

Sam Newman (2019), Monolith to Microservices, O′Reilly.

Pattern: Database Wrapping Service

With this pattern, we hide the database behind a service that acts as a thin wrapper, moving dataabase dependencies to become service dependencies.

Wrapping svc 1

Ultimately you can encourage teams to split ownership and consider main data source as someone else’s, and encourage them to store their own data locally.

Wrapping svc 2

This pattern works really well where the underlying schema is too hard to consider pulling apart. By placing a wrapper around the schema, and making it clear that the data can be accessed only through that schema, you at the very least can put a brake on the database growing any further.