What’s more flexible – Is it simplicity of JSON or Relational model? We would say the superior combination of both. Coupling the simplicity of JSON document model with the Relational model, here comes JSON Relational Duality – a transformative data modelling capability in Oracle database 23ai. Eliminating the “old-fashioned” issue of object-relational mismatch, this data modelling capability treats the same underlying JSON documents or relational tables simultaneously within applications as per needs based on the use case.
JSON Relational Duality within Oracle Database 23ai brings the game-changing flexibility and simplicity for Oracle database developers, turning it to be a breakthrough innovation against the past challenges that developers have encountered when developing applications, either using the relational model or document model.
Let’s hit the solid rocks of JSON Relational Duality while understanding the previous limitations with relational and document models in this insightful article.
What is JSON Relational Duality?
JSON Relational Duality is the modern and innovative data modelling capability, featuring updatable and consistent JSON document views over relational data. This feature allows to access data that’s stored efficiently in relational tables in the form of simple JSON documents. However, JSON Relational Duality Views can be accessed using document APIs such as MongoDB-compatible APIs, REST, and SQL.
Decoupling the access format from the storage format for database-native data, JSON Relational Duality Views serve as a transformative capability that enables applications to interchange data either as JSON documents or as relational tables based on the use case.
Unlike document databases, JSON Relational Duality Views allow the same underlying data to be consistently shared and updated from different document collections.
Limitations with Relational and Document Models for App Developments
Complexity of Relational Approach for Developers
Keeping up the data integrity to eliminate data duplication that’s performed by data normalization, is an efficient and powerful capability of relational model. Though relational operations provide flexibility for modelling and accessing data, it’s not always a cakewalk for developers at certain times:
- Developers highly rely on relational databases while building apps following app-tier language objects. Here the databases store data as tables, rows, and columns. Hence, developing individual app-tier objects lead to accessing multiple tables which is time-consuming.
- To move away from these complexities, developers often use Object Relational Mapping (ORM) frameworks. However, ORMs simplify app-dev, the significant overheads keep on rising because of rotational database visits to manipulate a single app-tier object. As these are inefficient as they don’t leverage the complete capabilities of databases, control over concurrencies is hard to manage, leading to applications using different ORM frameworks for different languages. These are also extremely lack at batch or bulk operations that require modification of app-tier objects.
- Another challenge is app-tier ORMs make the possibility of conflicting semantics across modules and microservices unless all of them has the same mapping information.
Other than ORMs introducing to inefficiencies and other tradeoffs, and accessing data formats leads to significant challenges for developers, the relational database is a very efficient data storage format.
Feet of Clay with JSON Document Bases
When it comes to storing the data in an organized way and based on hierarchy for app-tier language objects, document databases are masters of it. The JSON document model enables the apps to directly map objects into a JSON format with hierarchies, skipping the need for decomposition or reconstitution, and the associated complexities.
- Documents store overlapping data often times, resulting in data duplication that leads to inefficiency and data inconsistency as a single update to shared data may need updating multiple documents simultaneously.
- With the use of references, a few document databases normalize documents, sorting the data duplication. However, normalizing documents completely fails the document model’s simplicity, resulting in a model that’s awful of both worlds!
- Another biggest challenge with document model is handling many-to-many relationships. Any attempts to model the relationships may end up in greater data duplication and potential for more inconsistencies.
Though JSON provides developer-friendly access to data formats, it poses significant limitations as a data storage format. This is why Oracle Database 23ai features Relational duality to revolutionize app developments and here’s how it helps.
Game-Changing App Dev with JSON Relational Duality in Oracle Database 23ai
Now, fusion of Relational and Document universes within a single database is what Oracle Database 23ai has brought for developers, naming the new feature that leverages this capability as JSON Relational Duality View.
The advantage with JSON duality views is that it enables the apps to access highly efficient normalized data stored in relational tables in the form of JSON documents. This helps to developers think in terms of JSON documents while accessing the data using powerful relational model for data storage, providing unmatchable simplicity and efficiency. On top of this, Duality Views detach all the complexities of database level concurrency control from the user and maintaining the document level in a defined set of series.
Moreover, Duality Views can be declared over any number of tables using intuitive GraphQL syntax. Focused to support multiple use cases on the same data, developers can define various Duality Views on the same or overlapping set of relational tables. These Duality Views enhance the flexibility for developers in following ways:
- SQL access to all data – JSON columns with the help of SQL JSON extensions.
- JSON document access to all data – access to data stored in relational tables using Duality Views.
This makes developers to take advantage of JSON documents produced by Duality Views in ways they need, using normal drivers, frameworks, tools, and development methods.
Redefining Simplicity and Flexibility for Developers
- Developers can retrieve and store all the data required for a single app-tier object for a single database operation.
- Applications using Duality Views simplify the document reading from the view, make the any changes needed, and feed it back without concerning about underlying relational structure.
- Duality Views no longer rely on ORM frameworks.
- Document-centric applications can use document APIs, such as Oracle Database API for MongoDB, and Oracle REST Data Services (ORDS), or they can use SQL/JSON document functions.
- Reads and writes Duality Views using familiar HTTP operations such as GET, PUT, and POST.
- Applications that opt an API over HTTP can use Oracle Database API for MongoDB.
- As single database access is needed for developers to fetch and sort all rows needed for an app-tier object, Duality Views for applications are optimally executed inside the database, without any overloads.
6 Differentiators That Made JSON Relational Duality an Innovative Model
- Authenticity of JSON + Relational Efficiency: Combine the ease of JSON with the powerfulness and efficiency of relational model by eliminating all the other trade-offs.
- Extensive Flexible Dominance: Couple JSON APIs, REST, and standard SQL effortlessly depending on your use case.
- Simplify Application Development: JSON Relational Duality Views adopt to the new use cases as they are developed and utilized within Oracle Database 23ai, without relying on new copies of data.
- Gunshots to ORM Mapping: Being the database native and language independent, Duality Views pacify the limitations and inefficiencies caused by induced ORMs.
- Ease of Building RESTful and Mobile Apps: Build impressive and large concurrent applications with lock-free concurrency control enabled for developers.
- Set Document Databases Apar: Leverage the JSON access with all the integrated Oracle Database 23ai features, such as AI Vector Search, Graph, and Spatial.
Key Features of JSON Relational Duality
- Flexibility with Unification: Read and write data either as JSON documents or as relational tables, enhancing complete flexibility for developers.
- Lock-Free Concurrency Control: An optimistic concurrency control mechanism that enables database to read and write consistently without holding locks across accesses.
- Granular-Level Access Rules: Customization of data access and updatable rules are fine-grained for different application modules sharing same data is enabled with Duality Views.
- GraphQL-based Declarations: On top of SQL, define Duality Views using the simple and intuitive GraphQL-based syntax.
- Automatic Code Generation: Use the standard JSON schema to enable automatic generation of REST endpoints, access templates, and application blueprints.
- JSON to Duality Migrator: It analyses stack of JSON documents and recommends the significant set of normalized tables and Duality Views into which these documents can be imported.
Adoption of Oracle Database 23ai with INFOLOB
Leverage the Oracle Database 23ai features, especially JSON Relational Duality to innovate and transform app development scenarios within database. INFOLOB is here to navigate your development needs with these features implementation to simplify and enhance efficiency of your applications.
Along with Oracle Database 23ai, we have also implemented Oracle Exadata database – ExaCC and ExaCS for enterprises to run their applications on-premises as well as on Oracle Cloud to manage their mission-critical workloads seamlessly and drive scalability.
As we advance into the world where digital transformation meets innovative edge, INFOLOB is here to optimize your Oracle and non-Oracle applications led by a team of experts!
To experience the superlative powerfulness and expansive efficiency of Oracle databases, engage us!