This is a demo catalog. Create one for your own architecture with a single prompt.

Get started →

Customer data model

The entities behind a customer, how profile and identity are kept apart, and which id you should key on.

Four entities make up the Customer domain’s model. They split cleanly across the two systems — profile data in the Customer Management SystemSystemv1.0.0Customer Management SystemInternal system that is the source of truth for customer profile data. Owns the customer database and publishes customer...Ownercustomer-platformDiagramOpen docs, identity data in the Identity ProviderSystemv1.0.0Identity ProviderThe identity system that authenticates customers. It is the source of truth for credentials and login, verifies sign-in ...Ownercustomer-platformDiagramOpen docs — and that split is deliberate.

Customer profile

Customer ProfileEntityv1.0.0Customer ProfileThe customer details Acme uses for commerce interactions.Ownercustomer-platformOpen docs is the customer as the business sees them: customerId, email, displayName and status. It is an aggregate root, stored in Customer DatabaseContainerv1.0.0Customer DatabasePostgreSQL database that is the system of record for all customer profile data.Ownercustomer-platformDiagramOpen docs and owned by Customer APIServicev1.0.0Customer APIThe public-facing API for customer profiles. Handles commands to register and update customers, serves customer reads, a...Publishescustomer-registered, customer-updatedSubscribesregister-customer, update-customer +1APIsOpenAPIOwnercustomer-platformDiagramRepositoryOpen docs. Key on customerId — it is stable for the life of the customer and is the identifier used on every event and query in this domain. Email is unique but it can change; never use it as a foreign key.

The profile carries personal data and is tagged with a data steward. email and displayName are the fields returned for subject access requests.

Customer address

Customer AddressEntityv1.0.0Customer AddressA saved address attached to a customer profile.Ownercustomer-platformOpen docs is a saved address attached to a profile. A customer has zero or more addresses; each carries an addressId, the owning customerId, an ISO countryCode and a postalCode. Addresses exist to support checkout and fulfilment, but they stay owned by this domain — copy the addressId onto your order rather than the address itself.

Customer account

Customer AccountEntityv1.0.0Customer AccountThe identity account used to authenticate a customer.Ownercustomer-platformOpen docs is the identity used to authenticate a customer. It lives on the Identity Provider side of the boundary in User DirectoryContainerv1.0.0User DirectoryThe directory of customer credentials and identities — the source of truth for authentication.Ownercustomer-platformDiagramOpen docs, links back to a profile through customerId, and records the provider and account lifecycle status. It is an aggregate root for the identity side, and it is not something order, payment or review services should ever query. If you think you need it, you almost certainly need the profile instead.

Authentication session

Authentication SessionEntityv1.0.0Authentication SessionA successful customer authentication session.Ownercustomer-platformOpen docs is a successful sign-in: a sessionId, the accountId it belongs to, and authenticatedAt / expiresAt timestamps. It is what a Customer AuthenticatedEventv1.0.0Customer AuthenticatedPublished when a customer has successfully authenticated. Ownercustomer-platformSchemaDiagramOpen docs event describes. Sessions are short-lived and are not a durable record of the customer.

Why profile and identity are separate

Credentials are the most sensitive thing we hold. Keeping them in a dedicated, regulated-classification store means the Customer Management System never sees a password hash, and a bug in a profile screen cannot leak one. The two systems only meet through customerId. The Customer Management SystemSystemv1.0.0Customer Management SystemInternal system that is the source of truth for customer profile data. Owns the customer database and publishes customer...Ownercustomer-platformDiagramOpen docs delegates authentication to the Identity ProviderSystemv1.0.0Identity ProviderThe identity system that authenticates customers. It is the source of truth for credentials and login, verifies sign-in ...Ownercustomer-platformDiagramOpen docs and never reads the user directory.

Seeing it visually

The entity diagram on this domain shows the relationships and cardinalities between these four entities, with the fields each one owns. The ubiquitous language page defines the domain terms — customer, identity, credential, account status — used throughout.