Replicating Business Objects with Oracle JSON Relational Duality and GoldenGate Data Streams
Oracle GoldenGate 23ai has introduced replication of full-featured business objects in an event-based, pub/sub architecture. This is implemented by combining two new Oracle technology features: Oracle Database JSON Relational Duality Views and Oracle GoldenGate Data Streams.
Oracle Database 23ai JSON Relational Duality Views enables developers to easily consume relational data as JSON document models. This combines the advantages of JSON documents with those of the relational model, while avoiding the limitations of each. Oracle JSON relational duality view is essentially a SQL view that presents JSON data in a structured, relational format.
Replicating business objects with Oracle JSON Relational Duality and GoldenGate Data Streams prioritizes data products and becomes the single source of truth for applications, transaction fabrics, data/event meshes, and data fabrics by ensuring the uniqueness of data objects.
This topic covers the benefits of using Oracle JSON Relational Duality Views with GoldenGate Data Streams and provides the steps to configure GoldenGate Data Streams with Oracle JSON Relational Duality Views.
Advantages of Using JSON Duality Views with GoldenGate Data Streams
Replicating Business Objects with Oracle JSON Relational Duality and GoldenGate Data Streams prioritizes data products and becomes the single source of truth for applications, transaction fabrics, data/event meshes, and data fabrics by ensuring the uniqueness of the data objects.
The following workflow diagram illustrates the architecture when using JSON Duality Views with Oracle GoldenGate Data Streams:
-
Overcoming impedance mismatch: In JSON Duality Views, data is stored only once, underneath the normalized tables (preserving atomicity), while application objects work with JSON data objects. This way, business objects manage data products in Oracle JSON Duality Views in forms of JSON objects. Oracle GoldenGate captures JSON based data objects from JSON Duality Views and publishes events to AsyncAPI channels to make it available for subscribing data consumers. Integration between JSON Duality Views and Oracle GoldenGate addresses the impedance mismatch by guaranteeing exact once availability of the data products for both data producers and data consumers.
-
Scalable Data Objects: JSON Duality Views provide efficient storage management and data consistency as your application can work natively with JSON docs or with SQL on tables, or with both at the same time. Duality Views can be declared over any number of tables, plus even different duality views can be defined on the same or overlapping set of relational tables. This allows application developers to manage application objects in ways they are familiar and to create complex data products while using their usual drivers, frameworks, tools, and development methods, all while data is stored in a relational database.
-
Atomic updates to event brokers: JSON Duality delivers faster JSON than document databases and delivers better latency for OLTP by providing parallelism and optimization, as data management is done at the relational level with very high efficiency. Oracle GoldenGate Data Streams automates the event-based publication of business objects directly from the data tier, in real-time, as the COMMIT events happen, using standard patterns.
-
ACID compliant data objects with CDC: In JSON Duality Views, Lock-Free Concurrency Control keeps data objects constantly in-sync, while preventing both inconsistencies and stale data. Oracle GoldenGate Data Streams publishes trusted JSON-based data products with high throughput, reduced latency and guaranted exact once availability of the data product for all data consumers.
Parameters Used When Configuring JSON DVs and JCTs
-
TABLE
-
Used by Extract to capture changes from JSON Relational Duality Views and JSON Collection Tables after logical replication is enabled. Wildcards for
TABLE
/MAP
statements are supported.Note:
Although wildcards are supported inTABLE
/MAP
statements,ADD TRANDATA
does not support use of wildcards.The
TABLE HR.*
parameter setting will include base tables and JSON Relational Duality Views underHR
if they are already captured by Extract, to avoid user overhead.See
TABLE | MAP
in Parameters and Functions Reference for Oracle GoldenGate
-
MAP
-
Used by Replicat to apply changes to target JSON Relational Duality Views and JSON Collection Tables. Wildcards are supported. Ensure that the configuration doesn't apply changes to both the JSON DVs and its underlying tables to avoid duplication.
-
KEYCOLS
- Not supported for JSON Relational Duality Views and JSON
Collection Tables because they have a single, predefined key,
_id
.
-
AUTO_CAPTURE
-
Captures changes from JSON Relational Duality Views and JSON Collection Tables with enabled logical replication. See Configure the Auto Capture Mode for Extract and
TRANLOGOPTIONS auto_capture
mode for details.
Configure GoldenGate Data Streams and JSON Relational Duality Views to Deliver Change Data
When you combine the functionality of Data Streams with JSON Relational Duality Views to provide data delivery from the data producer to the data consumer, it requires setting up the JSON Relational Duality Views from Oracle Database 23ai and then creating Extract, the associated trail file, and adding Data Streams from the Oracle GoldenGate web interface. The steps to perform these tasks are as follows:
-
Create JSON Relational Duality Views.
For steps to create the JSON Relational Duality Views, see Creating Duality Views in the JSON-Relational Duality Developer's Guide.
-
Enable table-level supplemental logging for JSON Relational Duality Views and/or JSON Collection Tables. See Enable Supplemental Logging for JSON Relational Duality Views and JSON Collection Tables.
-
Create an Extract and trail file in Oracle GoldenGate.
See Add an Online Extract and Add a Trail.
-
Add a Data Stream from Oracle GoldenGate Distribution Service.
See Add Data Streams.
-
Insert change data to the document for testing.
-
Consume the Change Data from the Data Stream.
For a sample set of cURL commands that would set up GoldenGate Data Streams for Duality Views, see Sample Commands to Configure GoldenGate Data Streams for JSON Relational Duality Views.