Scrivio Interview library
DesignPrincipal6 min read · updated 12 November 2026

Your core relational schema was designed fifteen years ago around many-to-many relationships between customers, accounts and products, and every new product needs schema changes. How do you evaluate a redesign of the data model against the cost of living with it?

I compare the measured cost of living with the schema against a realistic estimate of changing it. First quantify the ongoing cost: lead time for each new product, defects in mapping code, and query complexity. Then find what actually changes most often, usually product types and their attributes, and give only that part flexible structures such as join entities with attributes or typed extension tables, while stable relationships stay normalized with constraints. A full redesign needs parallel running, data migration and dual reads, so it is estimated honestly; most often a partial redesign of the volatile area gives most of the benefit.

Why this question is asked

Old schemas are not bad because they are old; they are a problem when they make every change slow and risky. The temptation at that point is a grand rewrite, which often runs for years and sometimes fails. The opposite temptation is to keep paying the cost forever because no one can justify the change. Interviewers ask this at the most senior level because the answer is about turning frustration into numbers and choosing the smallest change that removes most of the pain. In this answer, we will measure the cost of the current schema, find where change concentrates, design targeted flexible structures, cost a full redesign realistically, and compare the options.

1A Quick Recap of the Situation

The schema links customers, accounts and products with many-to-many tables: customer_account, account_product, and so on. When it was designed there were perhaps five product types, each with fixed columns. Now each new product, such as a savings account with a bonus rate or a card with travel insurance, needs new columns or new link tables, a migration, new JPA mappings and changes to every query that touches products. The cost is real, but so far it is only a feeling, and decisions about large redesigns need more than feelings.

2Quantifying the Cost of Living With It

We collect three kinds of evidence from the last year or two. Lead time: from product approval to launch, how many weeks were schema, mapping and migration work. If the last eight products each spent six of their ten weeks on data changes, that is a striking number. Defects: incidents and bugs traced to mapping code, wrong joins or missing link rows. Query complexity: how many tables the main queries join, how often reports break when a product is added, and how much of the code base is mapping and translation rather than business logic.

Turning these into money is simple and powerful: if data work costs 6 engineer-weeks per product and we launch 10 products a year, that is 60 engineer-weeks a year, plus incident costs. That figure is the budget a redesign is competing against.

3Finding What Actually Changes

Next we look at the migration history. In most such systems, change is very uneven. Customer and account structures, and the relationship between them, may have hardly changed in ten years. Almost every migration touches product types and their attributes: new fee structures, new eligibility rules, new optional features. That tells us where flexibility is worth paying for, and where the normalized model with foreign keys and constraints is doing its job and should be kept.

For the volatile area we have several flexible designs. A join entity with attributes turns account_product into a real entity, AccountProduct, with its own fields such as start date and status, instead of a bare link. Typed extension tables give each product family its own table (card_product_details, savings_product_details) keyed by the product id, so a new family adds a table without touching others. A JSON column for rarely queried, product-specific attributes, validated by a schema in the application, lets new attributes ship without migrations, at the price of weaker database constraints.

Where each structure fits
AreaChangesStructure
Customer to accountrarelykeep normalized, FKs and constraints
Account to product linkgains attributesjoin entity AccountProduct
Product familiesnew family yearlytyped extension table per family
Product-specific optionsevery launchvalidated JSON attributes
Reportingconstantlyread model built from the above
Flexibility goes only where the change history says it is needed.

4Costing a Full Redesign Honestly

A full redesign of a fifteen-year-old core schema is not a migration script. It needs the new model running in parallel with the old one, data migrated and reconciled, often dual writes or change data capture to keep both in step, dual reads to compare results before switching, and every consumer, including reports and partner integrations nobody remembers, moved over. Each of those is months of work for several engineers, and the risk is concentrated in the last phase, when the old model is switched off.

So we estimate it the way such projects actually go: list every consumer, estimate migration and verification per consumer, add the parallel-running period, and add contingency for unknowns, which in old systems is large. If the honest estimate is 18 months for a team of eight, about 600 engineer-weeks, against an ongoing cost of 60 engineer-weeks a year, the payback is ten years, which almost no business will accept.

Step throughDeciding between living with it, partial and full redesign
  1. Measure ongoing costlead time, defects, query complexity
  2. Find the volatile areamigration history, product launches
  3. Estimate partial redesignvolatile area only, expand and contract
  4. Estimate full redesignparallel run, migration, dual reads
  5. Payback within 2 to 3 years?
    YesFund it, in phasesNoPick the cheaper option or wait

5 steps in order. Play them, or step through them one at a time.

Both options get the same honest estimate before anyone argues for either.

5Why a Partial Redesign Usually Wins

Because change concentrates in one area, redesigning only that area tends to remove most of the cost for a fraction of the effort. We introduce the new product structures beside the old ones using expand and contract: add the new tables, write new products only to them, migrate existing products family by family, switch readers, and finally drop the old columns. Each step is small and reversible, and value arrives with the first new product launched on the new structure rather than at the end of a long programme.

We measure the result with the same numbers we started with. If the next three product launches spend one week on data work instead of six, the case is proven and the remaining families can follow. If not, we have learned it cheaply. The decision, its numbers and what we chose not to change go into an architecture decision record, so that the next person who feels frustrated with the schema starts from facts.

6Follow-up questions

Isn't a generic entity-attribute-value model the most flexible option?

It is flexible but makes queries, constraints and performance much worse, because every attribute becomes a row and every query a pivot. Typed extension tables or validated JSON give most of the flexibility while keeping the data queryable.

How do JPA mappings cope with typed extension tables?

Either as a @OneToOne from the product to its details entity, often with @MapsId so they share the key, or with JOINED inheritance if the families form a real hierarchy. The choice depends on whether code needs to treat details polymorphically.

What would make you recommend the full redesign anyway?

If the cost is spread across the whole model rather than concentrated, if the old schema blocks a strategic goal such as a new market or regulation, or if the platform under it must be replaced anyway. Then the redesign may pay back much faster than the lead-time numbers alone suggest.

7Conclusion

In this answer, we turned an old, change-resistant schema into a decision with numbers. We quantified lead time, defects and query complexity, found that change concentrates in product types and attributes, and gave only that area flexible structures such as join entities with attributes, typed extension tables or validated JSON, keeping stable relationships normalized. We costed a full redesign honestly, including parallel running, migration and dual reads, and saw why a partial redesign of the volatile area usually gives most of the benefit for a fraction of the risk.

What to say in the interviewAbout 90 seconds aloud

Open with

I'd start by putting numbers on the cost of living with it, because that's the budget any redesign competes against. I'd look at the last couple of years: how many weeks of each product launch went into schema, mapping and migration work, how many defects came from mapping code or wrong joins, and how complex the main queries have become.

Then, if they want more

If data work is six weeks per product and we launch ten products a year, that's sixty engineer-weeks a year. Then I'd look at the migration history to see what actually changes, and it's usually product types and their attributes, while customers, accounts and their relationship barely move.

So I'd keep the stable parts normalized with foreign keys and constraints, and give flexibility only to the volatile part: turn the account-product link into a join entity with its own attributes, use typed extension tables per product family, and maybe validated JSON for options that change every launch.

For a full redesign, I'd estimate it honestly, including parallel running, data migration, dual reads and moving every consumer, which for a core schema can easily be eighteen months.

Usually a partial redesign of the volatile area, done with expand and contract, gives most of the benefit at a fraction of the risk, and I'd measure it with the same lead-time numbers.

About this answer

Last updated
12 November 2026
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Your core relational schema was designed fifteen years ago around many-to-many...": https://scrivio-interview-library.netlify.app/databases/jpa-relationships/7197d96908/