Scrivio Interview library
LeadershipPrincipal7 min read · updated 12 November 2026

Your company has used auto-increment integers, random UUIDs, composite natural keys and several custom id formats across 20 years of systems, which now makes data integration and mergers painful. What identifier strategy would you set for the next decade?

I would separate internal keys, which each system chooses for storage efficiency, from public identifiers, which are stable, opaque and never reused. New systems get one default, such as UUIDv7, and every cross-system reference uses one documented format that names the entity type and the issuing system. We do not rewrite old keys; we add mapping tables and global ids at the integration points, make identity resolution of customers and products a data capability with a named owner, and write the decision down with its reasons so it can be revisited when standards or databases change.

Why this question is asked

After twenty years and several mergers, a company's identifiers tell its history: auto-increment integers from the first monolith, random UUIDs from the microservices era, composite natural keys from an ERP system and custom formats from acquired companies. Every integration project then spends weeks just matching records. Interviewers ask this of very senior candidates because the right answer is not a favourite id format. It is a strategy that limits future damage without a rewrite nobody will fund. In this answer, we will recap why identifiers become painful, separate the two jobs ids do, choose a default for new systems and a reference format for integration, handle the legacy estate with mappings, give identity resolution an owner, and make the decision durable.

1A Quick Recap: Why Identifiers Hurt Integration

An identifier is a value that names one thing, such as one customer or one order. Problems start when ids from different systems meet. Auto-increment integers collide: customer 1042 exists in both the old and the acquired company's database, meaning two different people. Natural keys, such as an email address or a product code made from region and catalogue number, change when the real world changes, and then every reference breaks. Custom formats need custom parsers. And the same real-world customer often has five ids in five systems, with no record saying they are the same person.

Notice that these are different problems. Collisions and formats are technical; knowing that two records describe the same customer is a data problem. A strategy must address both, or the second will consume the effort spent on the first.

2Separate Internal Keys From Public Identifiers

The most useful principle is that ids do two different jobs. Internally, a key exists to make storage, joins and indexes efficient, and the team that owns the database should choose it, a BIGINT, a UUID or whatever suits. Externally, an identifier is a promise to other systems and to customers: it must be stable for the life of the thing, opaque so nobody builds meaning into it, and never reused for something else.

When one value does both jobs, every storage change becomes a breaking change for partners, and every exposed sequence leaks volume. When they are separate, a team can migrate its database or re-key its tables, and the public identifier does not move.

Step throughIdentifiers in the target state
  1. Customer-facing idsorder numbers, account numbers: stable, opaque, never reused
  2. Cross-system referencesone format: system, entity type, public id
  3. Mapping and resolutionlegacy key -> global id; same-entity links
  4. Public id per entityUUIDv7 by default for new systems
  5. Internal storage keyschosen per system: BIGINT, UUID, composite

5 layers, from the top down. Step through them one at a time.

Only the bottom layer is free to change; everything above it is a contract.

3One Default for New Systems and One Reference Format

For new systems we choose one default public identifier, and today UUIDv7 is a good one: it is an RFC 9562 standard, generated without coordination, sortable by time and supported natively by PostgreSQL and every UUID library. A default is not a ban; a team with a real reason, such as a table of tens of billions of rows, can choose otherwise through the architecture review, but most will not need to.

For references between systems, we document one format that carries the context a bare id lacks. A common pattern is a type-prefixed string that names the issuing system and the entity type.

Java
ref = "<system>:<entity-type>:<id>"
"billing:invoice:0192f3c4-7a1e-7c2b-9f10-3b5d8e2a6c41" // new system, UUIDv7
"legacy-crm:customer:1042" // old auto-increment key, made unambiguous
"acme-erp:product:EU-77812" // acquired company's natural key

Notice that the format makes old keys usable without changing them. Customer 1042 is ambiguous on its own, but legacy-crm:customer:1042 is not. Events, APIs and data exports carry these references, so any consumer can tell where an id came from and which system to ask about it.

4Do Not Rewrite Old Keys; Map Them

It is tempting to announce a migration of every system to the new format. In practice such programmes run for years, touch every integration and partner, and stall halfway, leaving one more format behind. So the rule is that existing internal keys stay. At each integration point, such as the data platform, the API gateway or the event backbone, we keep a mapping table from each legacy reference to a global id, created the first time the record crosses the boundary.

The mapping table also absorbs mergers. When the company buys another, its keys become new prefixes in the reference format, the mapping service assigns global ids as records flow in, and the acquired systems keep running unchanged. Old systems adopt the new public identifier only when they are rebuilt, which they eventually are.

5Identity Resolution Is a Data Capability With an Owner

Mappings solve formats, but not the question of whether billing's customer 1042 and the CRM's customer 88731 are the same person. That is identity resolution, matching records that describe the same real-world entity, and it is never finished: people change names and emails, products are relabelled, companies merge. So it must be a capability with an owner, typically a data or master data team, with clear rules for matching, a process for correcting wrong merges, and the authority to say which system is the source of truth for each attribute.

Without an owner, every project builds its own matching spreadsheet, and the company ends up with several incompatible answers to how many customers we have. With one, integrations call a single service that returns the global id and its linked records.

6Make the Decision Durable

Finally, the strategy goes into a written decision record: the principle of separating internal keys and public ids, the default for new systems, the reference format, the mapping approach and the owner of identity resolution, each with its reasons and the alternatives we rejected. Reasons matter more than rules, because in five years someone will ask why we did not use ULID or Snowflake, and the record answers without a meeting.

We also set a review trigger rather than a fixed date: when a relevant standard changes, when our main databases add native support for something better, or when integration metrics, such as time to onboard a new system or the share of records without a global id, stop improving. That keeps the strategy alive for the decade instead of turning it into a document nobody reads.

7Follow-up questions

Should public identifiers be UUIDs or human-friendly numbers?

It depends on who uses them. Machines are happy with UUIDs, but customers reading an order number over the phone need something short, such as a 10-character code from an alphabet without ambiguous characters. That is a separate display identifier mapped to the entity, which is another reason to keep storage keys, public ids and display codes apart.

How do you get product teams to adopt the reference format?

Make it the easy path: the event schema library, API templates and data platform ingestion all expect it, and the mapping service is a ready dependency. Teams adopt what their tools already do. For the rest, architecture review checks new interfaces against the decision record.

What is the biggest risk in this strategy?

That identity resolution stays unfunded, because it looks like an operational chore. Then mappings exist, but the same customer still has five unlinked global ids, and the integration pain returns. I would tie its funding to a measurable outcome, such as duplicate customer rate or onboarding time for acquired systems.

8Conclusion

In this answer, we built an identifier strategy for the next decade. We separated internal storage keys, chosen freely by each system, from public identifiers that are stable, opaque and never reused. New systems default to UUIDv7, and cross-system references use one documented format that names the system and entity type. Old keys are not rewritten; mapping tables and global ids at integration points absorb them and future mergers. Identity resolution becomes a data capability with an owner, and the whole decision is recorded with reasons and revisited on clear triggers.

What to say in the interviewAbout 90 seconds aloud

Open with

I would not try to pick one id format and migrate everything, because twenty years of systems will never all move, and a half-finished migration just adds another format.

Then, if they want more

Instead I would separate two jobs ids do. Internal keys are for storage and joins, and each team can choose what suits its database. Public identifiers are a contract: stable for the life of the entity, opaque and never reused.

For new systems I would set one default public id, UUIDv7, because it is standardised in RFC 9562, needs no coordination, sorts by time and works with native uuid types.

For anything crossing system boundaries, I would define one reference format that includes the issuing system and the entity type, like billing colon invoice colon the id, so even an old integer key becomes unambiguous.

Old keys stay as they are; at integration points we keep mapping tables from legacy references to global ids, which also handles future acquisitions without touching their systems.

The harder part is identity resolution, knowing that two records are the same customer, and I would make that a data capability with a named owner, matching rules and a correction process, because otherwise every project builds its own spreadsheet.

Finally, I would write it all down as a decision record with reasons and rejected alternatives, and revisit it when standards, databases or integration metrics change.

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 company has used auto-increment integers, random UUIDs, composite natural keys and...": https://scrivio-interview-library.netlify.app/java/types-and-values/1bbb7790bf/