SchemaBridge.EF is a lightweight helper library for migrating data between databases when splitting a monolithic system into microservices. It provides a structured, resumable transfer pipeline based on Entity Framework, including table transport, optional change-tracking via cache tables, and post-transfer validation. The library focuses on safe data migration without one-off scripts, using explicit transporters and checkers instead. 9.0.0 – Initial release.
$ dotnet add package SchemaBridge.EFSchemaBridge.EF is a lightweight helper library designed to simplify and standardize data migration when splitting a monolithic database into multiple databases or microservices.
It focuses on controlled, resumable, and verifiable data transfer between databases with identical or similar schemas, potentially using different database engines.
When migrating from a monolith to a microservice architecture, it is often necessary to extract parts of an existing database into new services.
Writing one-off migration scripts for each case is time-consuming and error-prone. SchemaBridge.EF provides a structured pipeline and reusable abstractions to speed up and standardize this process.
With SchemaBridge.EF, you only need to implement:
The library handles discovery, execution order, batching, retries, and logging.
The default transfer pipeline is executed in the following order:
Each stage is automatically discovered and executed using reflection.
During long-running migrations, data in the source database may continue to change. To avoid losing updates or deletions, SchemaBridge.EF supports cache-based tracking.
There are two cache types:
These cache tables are optional.
If you do not need to track concurrent changes during migration, you may safely skip cache transporters entirely.
Before starting the transfer process, you should:
Once the migration is complete:
All required abstractions are defined in the SchemaBridge.EF.Interfaces namespace.
You implement these interfaces to describe how your data should be transferred and validated.
The project contains a full integration test demonstrating the complete transfer pipeline, including table transport, cache handling, and validation.
See:
TransferServiceTests
This test uses in-memory databases and can be used as a reference implementation.
SchemaBridge.EF helps you:
The library is intentionally minimal and focused on migration logic only.