Repository navigation
Why JSON Duality Views
One of the primary goals of this project was to evaluate MySQL JSON Duality Views in the context of a realistic business application.
Rather than building a simple technical demonstration, the feature was applied to a quality inspection system containing:
- Inspection cards
- Measurements
- Checklists
- Findings
- Attachments
- REST APIs
- AI-assisted capabilities
This page explains why JSON Duality Views were selected and the value they provided during implementation.
Modern applications frequently operate using JSON documents.
At the same time, enterprise systems often rely on relational databases because they provide:
- Data integrity
- Constraints
- Transactions
- Reporting capabilities
- Proven scalability
This creates a common challenge.
Applications want:
JSON Documents
Databases often store:
Relational Tables
Developers frequently build transformation layers between the two.
Without document-oriented database access, applications often require:
Database Tables
|
v
SQL Queries
|
v
Join Logic
|
v
Object Mapping
|
v
JSON Generation
|
v
API Response
As systems grow, this mapping layer can become increasingly complex.
JSON Duality Views offer an alternative approach.
Instead of manually assembling business documents, relational data can be exposed directly as JSON business objects.
Conceptually:
Relational Tables
|
v
JSON Duality View
|
v
Business Document
The underlying data remains relational while applications interact with documents.
The most important architectural question was:
What should become a business document?
The answer was the Inspection Card.
An inspection naturally contains:
Inspection Card
├── Measurements
├── Checklist Items
├── Findings
└── Attachments
Users think about an inspection as a single business object.
JSON Duality Views align naturally with this mental model.
A major observation during implementation was reduced API complexity.
Instead of assembling multiple result sets and building custom response structures, the API could operate directly on business documents.
Benefits included:
- Cleaner endpoints
- Reduced transformation code
- Easier maintenance
- Faster development
Traditional applications often expose technical structures.
Business users think differently.
For example, a quality engineer thinks about:
Inspection Card
not:
inspection_card
measurement
checklist
finding
attachment
Document-centric design creates a closer relationship between technical implementation and business understanding.
One unexpected benefit was how naturally the resulting documents fit AI use cases.
Generative AI typically works best with:
- Structured context
- Rich business information
- Complete documents
The Inspection Card document already contained most of the information required by AI features.
Examples:
- Explain Inspection Card
- Work Order Report
- Manufacturing Statistics
Minimal transformation was required before sending information to the AI layer.
A common concern with document-oriented development is data duplication.
The project avoided that problem.
Relational tables remained the system of record.
Benefits included:
- Referential integrity
- Transaction consistency
- Constraint enforcement
- Reliable reporting
The document representation was derived from the same underlying data.
Developers could focus more on business entities and less on transformation logic.
Instead of repeatedly asking:
How do I join these tables?
development discussions increasingly focused on:
What should the business document contain?
This produced a cleaner design process.
The project also demonstrated what JSON Duality Views are not intended to replace.
They do not eliminate the need for:
- Good relational modeling
- Constraints
- Indexing
- Security
- Concurrency control
- Testing
Successful implementation still depended on traditional database design principles.
Based on this project, JSON Duality Views are particularly well suited for:
Examples:
- Inspection Cards
- Orders
- Invoices
- Claims
- Case Files
Applications that expose JSON-based services.
Solutions that benefit from document-oriented business context.
Organizations that want document-oriented development without abandoning relational storage.
JSON Duality Views should be applied thoughtfully.
Potential challenges include:
- Poorly defined document boundaries
- Excessively large documents
- Weak relational design
- Unclear ownership of nested entities
Good business modeling remains critical.
The project demonstrated that JSON Duality Views can effectively bridge the gap between relational databases and document-centric applications.
For the Quality Inspection System, the feature helped achieve:
- Relational integrity
- Business-document access
- Simpler APIs
- Cleaner AI integration
- Reduced transformation effort
while maintaining a single source of truth.
The strongest value observed was not simply the generation of JSON.
The real value was enabling development around meaningful business documents while preserving the proven strengths of a relational database.
For this project, the Inspection Card became both:
A Relational Entity
and
A Business Document
without requiring duplicate data models.