07. Who Owns the Data?
Establishing authority without breaking the monolith.
In the last few installments, ZibiWorks has been working toward extracting Fulfillment from the monolith. We’ve identified the business boundary, established a seam through which the old and new implementations can operate, and worked through which responsibilities belong in the new service.
But there’s something we haven’t addressed yet. The data.
Fulfillment’s operational state still lives in the monolith’s SQL Server database, alongside the order information that the rest of the business depends on. And while we’ve established how the new service will take responsibility for Fulfillment, moving that responsibility is not as simple as moving the tables.
The monolith still needs that information. Its screens, reports, and background processes depend on it, and the business isn’t prepared to rewrite those components just to accommodate the extraction.
There’s another complication. Until the new service has proven itself, the business expects a way to fall back to the legacy implementation. That means the legacy system needs more than access to Fulfillment’s information. It needs enough current, meaningful state to resume operations if necessary.
So how do we give Fulfillment ownership of its data without forcing the rest of the monolith to change along with it?
And how do we preserve a usable fallback when the new service is eventually going to support capabilities the legacy implementation never had?
The problem we’ve inherited
Section titled “The problem we’ve inherited”The Orders table did not become shared by accident. When ZibiWorks shipped from a
single warehouse, an order was one shipment and the path from placed to shipped was
close to linear, so keeping everything about the order on one record was the
simplest thing that worked. Anyone who needed to know where an order stood read one
row, and a change in how orders moved through the warehouse meant adding a column to
a table every part of the application already understood.
Installment 04 described how that
convenience accumulated into a record shared by several business capabilities. The
slice that matters here is the one Fulfillment cares about.
erDiagram
ORDERS ||--o{ SHIPMENTS : "ships as"
ORDERS {
int OrderId PK "Order Management"
int CustomerId FK "Order Management"
date OrderDate "Order Management"
string OrderStatus "Order Management"
money TotalAmount "Order Management"
string PickStatus "Fulfillment"
string PackStatus "Fulfillment"
string ShipStatus "Fulfillment"
}
SHIPMENTS {
int ShipmentId PK "Fulfillment"
int OrderId FK "Fulfillment"
}
A reduced view of the legacy model from Installment 04. Inventory’s columns share the same row and are left out, as are the other columns on the shipment records.
Order Management and Fulfillment are separate business responsibilities, and
nothing in this schema reflects that. OrderStatus belongs to Order Management: it
records what the business has done with the order. PickStatus, PackStatus, and
ShipStatus belong to Fulfillment: they record how far the warehouse work has
progressed, yet they sit on the same row and are saved together with it. The
shipment records hang off the order and belong to Fulfillment as well. The diagram
is not here for its columns. It shows two responsibilities that are physically one
thing, and the rest of this installment follows from that.
For years this was fine. It is becoming a constraint because the business is asking more of Fulfillment than a handful of status fields can hold. Partial shipments already turn some orders into several deliveries, and the business expects more of them. It also expects split fulfillment, where one order is filled from more than one warehouse, and additional carriers for the accessories and other products that Handle With Care, the robot-shipping specialist, does not carry, which is the flexibility Installment 06 gave Fulfillment room to grow into.
Each of these brings state that does not fit on the order row. Three order-level columns can report that an order is packed or shipped. They cannot report that two of three packages are with the carrier, one is waiting on a backorder, and a second warehouse has not started picking. The shipment records can carry some of that detail, but the code the rest of the business depends on reads the order-level columns. So the business wants Fulfillment to evolve on its own schedule, with a data model shaped like fulfillment rather than like an order, and it wants the monolith to carry on as though nothing had changed.
Location is not ownership
Section titled “Location is not ownership”It is tempting to treat giving Fulfillment its data as a single act, moving the tables. In practice that phrase bundles together three different things, and they can be decided independently of one another. Before deciding how to migrate anything, we need to separate where the data lives, who has authority to change it, and how other components access it.
| Concern | Before | After |
|---|---|---|
| Location | Fulfillment state resides in the monolith SQL Server alongside Ordering data. | Fulfillment’s database holds the authoritative state. The legacy tables temporarily retain synchronized copies. |
| Ownership | The legacy implementation is authoritative. Several code paths, some in Ordering, write the Fulfillment columns. | The extracted Fulfillment service is authoritative. The monolith cannot independently modify Fulfillment-owned state. |
| Access | Existing components query the monolith’s tables directly. | New consumers use Fulfillment’s API or appropriate read models. Existing legacy consumers may temporarily read the synchronized legacy tables. |
The first row is the one that gets the attention, and it is the least important of
the three. A database can move to a new server, or a new schema, and leave
everything about ownership untouched. If the code paths in Ordering that write
ShipStatus today are still free to write it tomorrow, wherever it lives, then
Fulfillment does not own that state. It shares it with whoever else can change it,
and it still cannot evolve its model without checking who might be affected. A
service owns its data when it is the only thing with the authority to change it.
Moving data does not establish ownership. Authority does.
Single authority does not mean single copy. The monolith will go on needing Fulfillment information in the shape it has always had, which means a copy of that information will exist in the legacy tables for some time. A copy is not a second source of truth merely because it exists. It becomes one only when someone can change it and have that change count, so that the system has two places to look and no way to decide which to believe when they disagree. Installment 03 described the target as dual presence, single authority: the data is present in both places, and only one side is the source of truth. Keeping it that way is most of the work ahead.
What happens to work already in progress?
Section titled “What happens to work already in progress?”Authority cannot transfer in the abstract. On the day it does, ZibiWorks will have fulfillment requests in flight in the monolith: orders being picked, parcels packed but not yet collected, shipments handed to carriers and awaiting delivery, orders held for a backorder. Whatever the new service does about those requests is a decision, and there are two reasonable ways to make it.
The first is to drain. The legacy implementation finishes everything it has already accepted, while new requests go to the Fulfillment service. It is an attractive answer because nothing has to be migrated and no request ever changes hands midway. Each request is handled by one implementation from start to finish, which makes the ownership question easy to answer. The trouble is how long draining takes. Open requests do not close on a schedule, and an order waiting on a backorder can stay open for weeks. Until the last one closes, the monolith is still carrying Fulfillment, two implementations each own part of the work, and the extraction has not delivered the independence it was supposed to.
The second is to migrate. The active requests, and the history Fulfillment needs in order to operate correctly, are copied into Fulfillment’s database and validated, and authority switches at a controlled boundary. This costs a migration to build and check, and a short pause in writes while the switch happens, but it lets the new service take over without waiting for the slowest request. It is also consistent with the Strangler Fig approach chosen in Installment 03, where responsibility moves a piece at a time while the old system keeps running.
ZibiWorks chooses to migrate. The deciding fact is the calendar. Peak season is approaching, Fulfillment is the capability under the most pressure, and an extraction that waits for every open order to complete could slip past the point where it was supposed to help. So ZibiWorks migrates open requests and the history Fulfillment needs, and leaves older history in the legacy database until someone has a business reason to move it. A company whose requests close in a day or two, or whose deadline is further away, could reasonably drain instead and avoid writing a migration at all. The decision is about ZibiWorks’ calendar and the length of its open requests, and the same analysis with different inputs would come out the other way.
Whichever approach is chosen, authority has to move deliberately, and the principle under it does not change. At any moment exactly one implementation owns the state, and the transfer from one to the other is an explicit event that the legacy side is told about, not something that happens as a side effect of routing requests somewhere else.
| Phase | Authority and behavior |
|---|---|
| Before cutover | Legacy is authoritative while the new database is seeded and validated. |
| During cutover | Legacy writes are stopped, final changes are transferred, and validation completes. Authority has not yet transferred. |
| Successful cutover | Fulfillment becomes authoritative and the legacy representation is maintained through synchronization. |
| Failed cutover | Legacy resumes as the authoritative implementation without an incomplete ownership transfer. |
| Deliberate fallback | Authority returns to legacy through an explicit, controlled procedure after the necessary state has been reconciled. |
ZibiWorks chooses a single, controlled transfer of authority. Until that transfer is complete, the legacy implementation remains responsible for Fulfillment. Afterward, the new service takes over. There is no period where both implementations independently own the same work.
The mechanics of making that transition safely are important, but we’ll address those later in the series.
The monolith isn’t going away
Section titled “The monolith isn’t going away”The migration decision settles who owns the data. It says nothing yet about what happens to everything that still reads it, and this is the part of the problem that most strongly shapes the architecture. Three requirements apply, and each one constrains the others.
The first is continued legacy operation. The status screens, the reports, the Inventory process, and the shipment confirmations depend on Fulfillment information today, and they must keep working as authority transfers to the new service. None of them has been touched by the extraction so far, and most of them belong to teams who have other things to do this quarter.
The second is a usable fallback. The business needs to be able to resume processing
through the legacy implementation if the new service runs into a serious problem while
it is still earning trust. Installment 05 made
that reversible at the application boundary, where pointing Ordering back at
LegacyFulfillmentService is a single change, but a change of routing is only the first
half of a fallback. The legacy implementation also needs state that is current enough and
meaningful enough to resume from. Falling back onto stale tables risks losing track of
work already performed, and a configuration change is all it takes to trigger the problem.
These dependencies are not all alike, and the useful way to see the difference is to ask what each one needs and what it costs when the data is wrong.
Legacy Dependency and Compatibility Matrix
Section titled “Legacy Dependency and Compatibility Matrix”For each component that reads the data being moved, record what it needs, what stale or missing data would cost, and therefore what it must be able to rely on. The last column is the output. It turns a vague worry that the monolith depends on this data into a requirement an approach can be tested against, and the same four questions apply to any extraction. These are ZibiWorks’ dependencies, assessed qualitatively.
| Legacy dependency | What it needs | Consequence of stale data | Compatibility requirement |
|---|---|---|---|
| Order status screens | Current fulfillment status | Shows an earlier status than the real one | Short delay acceptable. Status reasonably current. |
| Operations and finance reports | Complete fulfillment activity | Totals incomplete or inconsistent until corrected | Complete and consistent when relied on. Delay acceptable. |
| Inventory processing | Whether reserved units have left, or the order was cancelled | Stock released or committed wrongly, such as released for a parcel that already shipped | Handoffs and cancellations reflected promptly, never silently missed |
| Shipment confirmations | Which shipments have reached carriers | Customer told the wrong status, such as still packing after it shipped | Handoffs reflected promptly and accurately |
| Legacy fallback | Complete, meaningful state for the work the business agreed to resume | Work resumes on a parcel already with a carrier, or work in progress is lost | Reconciled state before authority returns. Work the legacy model cannot represent is not resumed. |
Nothing in the matrix requires every consumer to see the data at the same instant. What differs is the cost of a wrong or missing answer, which is small for a status screen and considerable for Inventory or a fallback. ZibiWorks has to understand those costs before it chooses how to keep the legacy side informed.
The third requirement is the one this design leans on hardest: the impact on legacy functionality should be as small as possible. Every row in the matrix is a component some team would have to change if it had to read from Fulfillment instead, and each change carries implementation effort, regression testing, and operational risk on parts of the system that are working. The point of extracting Fulfillment is to modernize one capability without a rewrite of everything around it. Ideally the monolith stays largely unaware that authority has moved, and where some awareness is unavoidable, it lives in temporary migration scaffolding and not in permanent changes to legacy business logic. That makes this an architectural constraint in its own right, because it determines which options are even candidates.
What a fallback can promise
Section titled “What a fallback can promise”There is a limit to what a fallback can promise, and it is easy to underestimate. As Fulfillment evolves it will support capabilities the legacy implementation was never designed to handle, such as richer partial shipments and fulfillment split across more than one warehouse. Returning to the legacy implementation may preserve basic order processing, but it can restore only a subset of what the new service does. That makes fallback a business decision and not an automatic technical response, and the sensible way to treat it is to decide in advance which situations call for which response.
Fallback Decision Matrix
Section titled “Fallback Decision Matrix”Not every problem with the new Fulfillment service calls for a fallback. A brief outage might be worth waiting out, while a more serious failure could justify returning to the legacy implementation, even with reduced capabilities. Each response comes with its own costs and risks, and the right choice depends on what the business can tolerate. The following matrix shows how ZibiWorks might approach those decisions.
| Situation | Potential response | Business tradeoff |
|---|---|---|
| A short outage of the new service | Wait for recovery | A brief disruption, against the cost and risk of transferring authority twice |
| A defect that affects a limited workflow | Tolerate it, with a workaround or by restricting that workflow, while a fix is prepared | Continued reduced quality or manual effort, against the disruption of a full fallback |
| A critical outage where the new service cannot support critical operations | Transfer authority back through a controlled procedure, once the legacy state has been reconciled, and resume the agreed subset of operations | Continuity, against reduced capability and the effort of reconciliation |
| Work the legacy implementation cannot represent, such as an order already split across warehouses | Hold it until the new service recovers. Do not process it in the legacy implementation. | Delayed fulfillment for those orders, against the risk of processing them incorrectly |
Two technical boundaries hold whichever response the business picks. Authority cannot safely return to the legacy implementation until its state has been reconciled and is meaningful enough to resume from, because routing alone is not a fallback. And the legacy data model can only represent what it was built to represent, so work beyond it must never be processed as though it fit.
Who chooses matters as much as what the options are. The architecture team can explain what is feasible, what each option would cost, how long it would take, and what risk would remain. The business decides which of those tradeoffs it can accept, weighing the financial impact of an outage against the damage to customer relationships and reputation. Those boundaries are worth agreeing before an incident, because an incident is a poor time to discover them.
Peak season makes the time cost real. Fulfillment has to be ready before demand arrives, and every additional safeguard competes for time with the capabilities the business is trying to deliver. A more sophisticated fallback is not necessarily a better one if it costs more than the risk it addresses or arrives after the opportunity it was meant to protect. The goal is the resilience the business needs, in the time available, with the remaining risks understood and explicitly accepted.
Fallback can reduce capabilities. It cannot compromise data integrity.
A compatibility projection
Section titled “A compatibility projection”Put the three requirements together and a shape emerges. If legacy consumers must keep reading the tables they have always read, and those tables must stay accurate enough to support a fallback, then the legacy tables need to keep holding Fulfillment information even after Fulfillment owns it. The way to square that with single authority is to treat what the legacy tables hold as a synchronized representation of Fulfillment’s state, maintained by something other than the legacy code, and to let the existing consumers go on reading it as though nothing had happened. We will call that representation the compatibility projection.
%%{init: {"flowchart": {"rankSpacing": 28, "nodeSpacing": 30, "wrappingWidth": 360}, "themeVariables": {"edgeLabelBackground": "#12232a", "textColor": "#f4fafb", "nodeTextColor": "#f4fafb", "tertiaryTextColor": "#f4fafb"}}}%%
flowchart TD
F["Fulfillment service<br/>Authoritative owner"] --> D[("Fulfillment database<br/>Source of truth")]
D -->|"State synchronization"| P[("Compatibility projection<br/>Legacy SQL Server representation<br/>Read-only to legacy code for Fulfillment-owned state<br/>Not a second source of truth")]
P -->|"read by"| C["Existing monolith consumers<br/>Screens, Reports, Inventory,<br/>Shipment confirmations"]
classDef box fill:#12232a,stroke:#4fb3c7,stroke-width:1.5px,color:#f4fafb;
classDef derived fill:#16303a,stroke:#8fc4d0,stroke-width:1.5px,color:#f4fafb,stroke-dasharray:4 3;
class F,D,C box;
class P derived;
linkStyle default stroke:#4fb3c7,stroke-width:1.5px;
The extracted Fulfillment service owns the authoritative state. A synchronized compatibility projection lets existing legacy consumers continue using familiar data structures without becoming a second source of truth.
The name carries four commitments. Fulfillment remains the authoritative owner. The legacy representation exists for compatibility, so that existing consumers can keep using familiar structures while the new service takes over. The monolith cannot independently modify Fulfillment-owned state, since a projection that legacy code can write to is a second authority under another name. And the projection is temporary migration infrastructure, which means it is built with its removal in mind.
It is also a different thing from the read projections people usually have in mind when they talk about Command Query Responsibility Segregation (CQRS). Those are purpose-built views of authoritative data for new consumers, shaped around the questions those consumers ask, and ZibiWorks will want them. They keep Fulfillment free of the screens that read it. A compatibility projection serves the opposite audience. It exists to feed consumers that cannot change, in a shape Fulfillment would not choose for itself, and it goes away when they do. New consumers ask Fulfillment through its API or a read model and never touch the legacy tables. Everything that follows is about the legacy readers, and about keeping their projection true.
Where this leaves ZibiWorks
Section titled “Where this leaves ZibiWorks”The opening asked two questions. The first was how Fulfillment can own its data without the rest of the monolith changing along with it. ZibiWorks migrates its open work and moves authority at a single controlled boundary, and the monolith keeps reading a compatibility projection that it cannot write to. The second was what has to remain true about the legacy data if the business goes back. The projection must preserve enough meaningful state for the legacy implementation to resume safely. That includes knowing which shipments have already been handed to carriers, because losing track of work already performed is not an acceptable consequence of fallback.
What this does not settle is how the projection stays trustworthy, and that turns out to be less a question about technology than about how much inconsistency and failure the business can tolerate. Describing a synchronized copy takes a sentence. Deciding how current it must be for each kind of reader is a separate and harder decision, and the answers differ for a status screen and for an Inventory process acting on a shipment handoff.
That is where the next installment picks up. It has to work out how fresh the projection needs to be for each reader, what happens when it falls behind, how anyone would know that an update was missed or a record is wrong, what has to be trustworthy before a fallback is even considered, and how confidence is restored through reconciliation and recovery after a synchronization failure. Those answers have to come first. The mechanism that delivers them, whether capturing database changes, polling an API, publishing events, or some combination, is the decision that follows.
Join the Discussion
Architecture is about tradeoffs, and reasonable architects can arrive at different conclusions.
Would you have made the same decision? What would you have done differently?
Discuss this installment on LinkedInZibiWorks is fictional. The ideas and opinions expressed throughout the series are my own and do not represent the views, positions, or practices of my employer.