Tony’s Pizza looks simple from the outside. A customer orders a pizza, the pizza is prepared, and a driver delivers it. Unfortunately, though, Tony’s has spent 20 years acquiring regional pizza chains, loyalty programs, delivery services, and online ordering platforms. Answering the question of “Where is my pizza?” is not so simple anymore, requiring data from multiple systems and databases with no clear ownership.
This is exactly the kind of problem the GraphQL semantic layer is uniquely positioned to solve. It allows customers, orders, stores, rewards, and other business concepts to remain stable even as the underlying system, databases, and vendors continuously change. The schema becomes less of a data map and more of a shared business language.
In this guide, learn all about GraphQL: what it is, how it works, the problems it solves, and how to design the perfect schema – one that holds up as systems keep changing.
The problem: one customer, five systems, zero agreement
Behind that simple experience is a fragmented technology landscape built through years of acquisitions, integrations, and legacy system decisions. There’s no unified approach – different systems manage online ordering, loyalty rewards, delivery operations, and in-store point-of-sale (POS) transactions.
Consider one of Tony’s loyal customers, Sarah Johnson. Sarah orders pizza every Friday night and, from her perspective, she’s just another customer.
From the perspective of Tony’s technology ecosystem, however, she may be represented as:
- Customer #1234
- Loyalty Member #9876
- Marketing Contact #4411
- Web User #777
- Delivery Recipient #122
So, while Sarah believes she is just one person, Tony’s databases have developed five different theories!
The traditional integration trap
A traditional integration strategy often exposes these underlying systems directly, with applications becoming tightly coupled to implementation details. Linking the systems together to join orders, loyalty points, delivery status, address, etc, should not require intimate knowledge of every single database.
Similarly, it shouldn’t require working through arcane matching logic to know that five identities are really the same person. Over time, business knowledge becomes inseparable from technology knowledge – and this is exactly where complexity begins to leak through architecture.
Introducing the semantic layer – what it is and how it works
A semantic layer sits between consumers and underlying systems. It retrieves data but its real purpose is to establish a common business language.
Essentially, instead of exposing databases, tables, services, and application programming interfaces (APIs), the semantic layer exposes concepts that the business actually understands.
So, in the case of Tony’s Pizza:
- Customer
- Order
- Pizza
- Store
- Delivery
- Driver
- Reward Account
- Coupon
With this, for example, consumers no longer ask “Which system stores loyalty information?” – instead, it’s “Show me Sarah’s reward account.”
That’s because the semantic layer simply translates business questions into whatever technical operations are required behind the scenes.
How GraphQL solves the semantic layer problem
GraphQL provides the ideal technology for implementing this pattern, as the schema becomes a representation of the business domain rather than a reflection of database structures.
For example, a consumer can query:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
customer(id: "SARAH") { name rewardAccount { pointBalance } orders { orderDate delivery { status } } } |
NOTE: The identifier in this example is deliberately business-facing; the semantic layer is responsible for resolving it to whatever source-system identifiers are required.
This query is written entirely in business language because, of course, the consumer themselves don’t need to know:
- Which database stores customer information
- Which service tracks loyalty points
- Which application manages delivery operations
- Whether the company recently replaced a system
- Whether data comes from one source or ten
And, most importantly, consumers aren’t affected when any of the underlying technologies change.
Put simply, the GraphQL schema becomes the source of truth for business definitions. It’s essentially modeling how the business actually thinks; it’s not just an information store.
The many benefits of a semantic layer
The power of the semantic layer becomes easier to see when we compare how the business views Sarah with how the underlying architecture views her.
From the business perspective:
|
1 2 3 4 5 6 7 8 9 |
Customer | +-- Orders | +-- Reward Account | +-- Coupons | +-- Deliveries |
From the technology perspective:
|
1 2 3 4 5 6 7 8 9 |
CRM Database | Online Ordering Platform | Loyalty System | Marketing Application | Delivery Platform |
Without a semantic layer, every consumer must understand both diagrams. With a semantic layer, consumers only need to understand the first. As mentioned previously, the semantic layer is modeling how the business thinks – rather than just being an information store.
This matters because databases are implementation details, and implementation details change over time. Who knows, Tony’s may replace its loyalty platform next year, or modernize its delivery application. It may even acquire another pizza chain with yet another customer database…
If consumers are directly coupled to those systems, every change becomes a costly integration project. However, if consumers are simply coupled to the semantic layer instead, the underlying systems can evolve while the business contract remains stable.
The biggest benefit of all: the unified business model
Many discussions about GraphQL focus on client performance, query flexibility, or reducing API calls. All useful benefits, yes, but not the most transformative aspect of the technology. The more powerful idea is that GraphQL enables organizations to create a unified business model, one that stands apart from the systems that implement it.
In other words, the goal is to allow the business to speak in terms of customers, orders, pizzas, stores, and deliveries, without requiring anyone to know where those concepts are actually stored. When this works, the semantic layer becomes a shared language for the organization.
Or, as Tony’s eventually concluded: the pizza business has exactly one customer named Sarah, the databases have several opinions, and the semantic layer exists so the rest of the company can stop arguing about it!
Once we accept that GraphQL can serve as a semantic layer, the next design question becomes more important: what should the schema actually model?
Move fast. Govern at scale.
What should the schema actually model? (Design around business concepts, not databases)
One of the most common mistakes teams make when adopting GraphQL is assuming that its schema should mirror the underlying database schema.
And who can blame them? After all, the database already contains tables, columns, keys, and relationships. Exposing all of these structures through GraphQL appears to be a straightforward path to implementation.
Unfortunately, though, this approach eliminates many of the benefits a semantic layer is intended to provide.
When a schema simply reflects storage structures, consumers inherit all of the design decisions, inconsistencies, and historical baggage of the underlying systems. The result is often a GraphQL API that looks modern on the surface but exposes the same complexity as before.
The challenge, then, is to expose the business.
Start with business questions
A useful exercise when designing a semantic layer is to temporarily ignore the databases entirely. For example, instead of asking “what tables do we have?”, ask “what questions does the business need to answer?”
For Tony’s Intercontinental Pizza Group, common questions might include:
- Where is my pizza?
- How many loyalty points do I have?
- Which coupons can I use?
- How many orders has this store fulfilled today?
- Which ingredients are running low?
- Which drivers are currently out on deliveries?
Notice that none of these questions mention tables, databases, APIs, foreign keys, or system names…
Business users naturally think in terms of outcomes and relationships rather than storage structures – and the semantic layer should do the same.
A database-centric design (what to avoid)
Suppose Tony’s began by exposing existing systems exactly as they exist. The resulting schema might look something like this:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
type CustomerMaster { customerId: ID! } type LoyaltyMember { memberId: ID! } type WebUser { userId: ID! } type DeliveryContact { contactId: ID! } |
Technically, this is accurate. Unfortunately, though, it’s practically useless from a business perspective.
This is because a developer attempting to answer a simple question such as “show me Sarah’s available rewards” must first understand which object represents Sarah. Then, how those identifiers relate, and which system owns the information.
This complexity of the underlying architecture leaks directly into the API.
A business-centric design (what to build instead)
Now consider the same scenario designed around business concepts:
|
1 2 3 4 5 6 7 |
type Customer { id: ID! name: String! rewardAccount: RewardAccount orders: [Order!]! activeCoupons: [Coupon!]! } |
The schema now reflects how the business talks about customers. After all, the consumer doesn’t need to know where loyalty data resides, which system stores orders, and whether customer records exist in multiple places. These concerns are hidden behind the semantic layer, where they belong.
So, yes, the underlying architecture may remain complicated – but the consumer experience is dramatically simpler. GraphQL gives an organization a place to define what its business actually means.
Modeling relationships the way the business sees them
Of course, business users rarely think in joins! Rather, they think in relationships: a customer places orders, and the store fulfills the orders. Then, the drivers deliver the orders. There’s also the supplier, providing the ingredients.
These relationships are intuitive because they mirror how people describe the business in everyday conversation. GraphQL is particularly effective because it allows schemas to represent these relationships directly:
|
1 2 3 4 5 6 7 8 9 10 11 |
customer { name orders { orderDate delivery { driver { displayName } } } } |
Reading this query feels remarkably similar to reading an English sentence: Show me a customer, their orders, the delivery associated with each order, and the driver responsible for the delivery.
Again, the schema is the business language.
Why naming matters more than you think
The process of designing a semantic layer often reveals a surprising challenge: agreeing on what things should be called. For example, Tony’s various systems may use terms like customer, member, consumer, account holder, guest…the list goes on. And each system may well have valid reasons for its terminology.
None of them are necessarily wrong. They’re just confidently describing different slices of the same pizza, if you will. Some may even be necessary. However, Tony’s should not have to keep paying for the sins of earlier designs.
The semantic layer forces a different question: what should the business call this concept? Rather than perpetuating every variation, the schema simply establishes a canonical vocabulary. In Tony’s case, the answer might simply be type Customer.
While this may seem like a minor thing, it’s actually one of the most valuable contributions a semantic layer can make. A shared vocabulary reduces confusion, simplifies onboarding, and provides a stable foundation for future development.
Why terminology is really about relationships
The naming problem is not simply choosing between terms like customer, member, guest, contact, etc. The actual problem – the one that needs solving – is how these concepts relate to one another.
At Tony’s, Sarah may appear in several systems under several different names. In one system showing her orders, she’s a customer. In another, for loyalty points, she is a ‘loyalty member’. And when she receives marketing promotions, she’s a ‘marketing contact.’
We could go on, but you get the point: the labels all point to the same person, yet don’t all mean the same thing. For the system, this is confusing. For humans like Sarah – not so much.
All of this matters when designing a semantic layer. If every term is collapsed into a single customer type, for example, the schema may hide important business meaning. Then there’s the source-system terms where, if each term is exposed separately, the schema recreates the confusion it was meant to resolve!
The better approach is to separate the enduring business concept from the roles and relationships attached to that concept.
A customer is just a customer
Ultimately, Sarah is a customer. Yes, she has a rewards account, receives marketing messages, and is definitely the recipient of deliveries – but she’s still just a customer. Her rewards account, marketing preferences, and who receives the deliveries, are different things.
In GraphQL, those distinctions can be modeled directly:
|
1 2 3 4 5 6 7 8 |
type Customer { id: ID! name: String! rewardAccount: RewardAccount orders: [Order!]! deliveryRecipients: [DeliveryRecipient!]! marketingPreferences: MarketingPreferences } |
Not only does this model use cleaner names, it also expresses the relationships the business actually cares about. After all, a customer is not the same thing as a reward account: a reward account belongs to (or is associated with) a customer. And the delivery recipient is not always the same as the person who placed the order. We could go on.
This is where the schema comes in, answering questions like:
- Is a Guest a type of Customer, or is Guest a temporary role before registration?
- Is a Member simply a Customer with a reward account?
- Is a Recipient the same person as the Customer, or a different person associated with a delivery?
- Is Contact a person, a communication method, or a marketing profile?
- Is Account Holder a customer type, an account role, or a billing relationship?
These decisions shape how consumers understand and use the API. The end goal? Define a model that makes business relationships explicit without hiding unnecessary implementation detail. A well-designed semantic layer always asks, “what is this thing, and how does it relate to the rest of the business?”
It’s that last element – the relationship to the business – that’s so important, and this is where GraphQL becomes so powerful. Its graph structure allows the schema to describe both business objects and the relationships between them, creating something that feels natural to consumers since it’s mirroring how the business already thinks.
The business language test: a quick schema sanity check
A useful rule of thumb when reviewing a schema is what we might call the “Business Language Test.” Basically, imagine showing a portion of the schema to a store manager. If the explanation requires a database diagram and an acronym dictionary – followed by an apology! – the schema may be telling the wrong story.
Could they understand what it represents? Consider:
- Customer
- Order
- Store
- Delivery
- RewardAccount
- Coupon
Most business stakeholders can immediately understand these concepts. Now compare those to:
LOY_MEMBERWEB_USERCUST_ACCTORD_HDRDEL_CONTACT
These names reflect existing systems but require institutional knowledge to interpret. That’s where a semantic layer succeeds – it uses meaningful and understandable language outside of the technology department.
The importance of designing for tomorrow’s systems
Perhaps the greatest advantage of designing around business concepts is durability. Technology landscapes are always changing: businesses evolve, companies merge, systems get replaced, and new vendors arrive. What looks like a permanent platform today can become tomorrow’s migration project. That’s why, like many organizations, Tony’s has learned that “temporary” solutions have a curious talent for becoming permanent.
The business concept of a customer, however, tends to persist. Tony’s may replace its loyalty platform in five years, adopt a completely new ordering system in ten, and absorb more databases through future acquisitions. Through all of that change, the business will still need to understand customers, orders, stores, deliveries, rewards, and the relationships between them.
If the schema has been built around current implementation details, each change becomes disruptive because consumers are forced to learn the shape of the latest system. However, if the schema has been built around enduring business concepts, changes can remain largely invisible to consumers.
All of this is what makes up the true value of a semantic layer. It’s a deliberate separation between how the business understands itself and how technology happens to be implemented at any given moment.
For architects and implementation teams, this changes the starting point of schema design without making the conversation purely technical. The first deliverable should always be a shared vocabulary and relationship model, one that all stakeholders can validate together before implementation begins.
As the data team at Tony’s eventually discovered: systems, databases, and vendors all come and go. Customers, orders, and pizzas, on the other hand – they all remain. Design the graph around these concepts, and the business can evolve without dragging every consumer through yet another migration project.
Key takeaways
- A semantic layer sits between consumers and backend systems, translating business questions into technical operations — so “show me Sarah’s rewards” doesn’t require knowing which database owns loyalty data.
- GraphQL is uniquely suited to this pattern because its schema can represent business concepts and relationships directly, rather than reflecting tables, keys, and service boundaries.
- Design schemas around business questions, not database structures. Start with what the business needs to know (“Where is my pizza?”), not what tables already exist.
- Naming is a relationship problem, not a vocabulary problem. The goal isn’t picking one term over another — it’s modeling how concepts like Customer, RewardAccount, and DeliveryRecipient relate to each other.
- Stable schemas survive system change. Systems, vendors, and databases get replaced. Customers, orders, and deliveries don’t. Build the graph around what endures.
In short: the schema isn’t just a data-fetching layer — it’s the durable contract between the business and the technology that serves it. Design it so systems can change behind the scenes without anyone in front of it ever noticing.
Simple Talk is brought to you by Redgate Software
FAQs: Why your schema shouldn't mirror your database (and what to do instead)
1. What is a semantic layer in GraphQL?
A semantic layer is a layer that sits between API consumers and backend systems, exposing business concepts (like Customer or Order) instead of raw database tables or service structures — so consumers interact with stable, business-friendly language rather than shifting technical implementation.
2. How is GraphQL different from a traditional API for this purpose?
Traditional integrations often expose underlying systems directly, coupling consumers to implementation details. GraphQL’s schema-first approach lets you define a business-facing contract (like Customer.rewardAccount) that stays stable even when the systems behind it change.
3. Why shouldn't a GraphQL schema mirror the database schema?
Mirroring the database inherits all its inconsistencies, legacy naming, and structural baggage — producing an API that looks modern but still forces consumers to understand internal system architecture to use it.
4. What is the "Business Language Test"?
It’s a quick schema review method: if you can’t explain a type or field to a non-technical stakeholder (like a store manager) without a database diagram or acronym glossary, the schema likely needs to be redesigned around business concepts.
5. Does a semantic layer eliminate backend complexity?
No — the underlying systems can remain just as complex. A semantic layer hides that complexity from consumers rather than removing it, so teams can replace or merge backend systems without breaking every application built on top.
This document contains proprietary information and is protected by copyright law.
Copyright © 2026 Red Gate Software Limited. All rights reserved
Load comments