Need to incorporate JSON documents into existing Oracle database applications? The new native JSON datatype introduced in Oracle 21c makes it simple to store, access, traverse, and filter the complex data often found within JSON documents, often without any application code changes.
Http4s, Doobie and Circe: The Functional Web StackGaryCoady
Http4s, Doobie and Circe together form a nice platform for building web services. This presentations provides an introduction to using them to build your own service.
Spray Json and MongoDB Queries: Insights and Simple Tricks.Andrii Lashchenko
This presentation will cover the history of creation, implementation details and various challenges related to embedded documents querying in MongoDB, along with examples of how to properly create and utilize the extension on top of official MongoDB Scala Driver. This newly introduced extension allows to fully utilize Spray JSON and represents bidirectional serialization for case classes in BSON, as well as flexible DSL for MongoDB query operators, documents and collections.
UKOUG Tech14 - Getting Started With JSON in the DatabaseMarco Gralike
Presentation used during the UKOUG Tech14 conference in Liverpool (UK) discussing possibilities of the use of, and explaining, the new JSON database functionality in the Oracle 12.1.0.2 database
Http4s, Doobie and Circe: The Functional Web StackGaryCoady
Http4s, Doobie and Circe together form a nice platform for building web services. This presentations provides an introduction to using them to build your own service.
Spray Json and MongoDB Queries: Insights and Simple Tricks.Andrii Lashchenko
This presentation will cover the history of creation, implementation details and various challenges related to embedded documents querying in MongoDB, along with examples of how to properly create and utilize the extension on top of official MongoDB Scala Driver. This newly introduced extension allows to fully utilize Spray JSON and represents bidirectional serialization for case classes in BSON, as well as flexible DSL for MongoDB query operators, documents and collections.
UKOUG Tech14 - Getting Started With JSON in the DatabaseMarco Gralike
Presentation used during the UKOUG Tech14 conference in Liverpool (UK) discussing possibilities of the use of, and explaining, the new JSON database functionality in the Oracle 12.1.0.2 database
JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...Jim Czuprynski
JSON is the new XML! It’s everywhere, from NoSQL databases to REST APIs. Let me share with you how Oracle’s Autonomous JSON Database (AJD) makes short work of handling JSON-resident information, especially when paired with robust functions and features of Oracle 19c and 21c.
A story about developing an application for an online store, persisting all the data as JSON.
Gives an overview of JSON functionality in Oracle Database 19c.
JSON support in DB2 for z/OS
1. To illustrate JSON storage model in DB2 for z/OS
2. To introduce JSON SQL APIs features and examples
3. To compare JSON and XML support in DB2 for z/OS
Alongside with all other features SQL 2016 now natively supports JSON – one of the most common formats for data exchange. SQL 2016 now has built-in capabilities to query, analyze, exchange and transform JSON data.
JSON functionality is quite similar to SQL XML support but despite this being one of the most desired additions to SQL 2016 there is a flavour of something missing – the JSON data type.
In this session we will talk about JSON support features, limitations and some tricks to overcome these.
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018Alexander Tokarev
The presentation was prepared for Austria Oracle User group 30 years. It tells us a lot of challenges which Oracle developers face with implementing high-load json processing pipelines.
Introduces the use of JSON-Like data structures within DivConq. Includes how to create and access the structures within Java, as well as how to declare structures in dcSchema for data validation.
This is one of the 15 minute "TED" style talk presented as part of the Database Symposium at the ODTUG Kscope18 conference. In this presentation @SQLMaria coveres topics like what data type you should use to store JSON documents (varchar2, clob or blob) the pro's and con's of using an IS JSON check constraint, and how to load, index, and query JSON documents.
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...Altinity Ltd
JSON is the king of data formats and ClickHouse has a plethora of features to handle it. This webinar covers JSON features from A to Z starting with traditional ways to load and represent JSON data in ClickHouse. Next, we’ll jump into the JSON data type: how it works, how to query data from it, and what works and doesn’t work. JSON data type is one of the most awaited features in the 2022 ClickHouse roadmap, so you won’t want to miss out. Finally, we’ll talk about Jedi master techniques like adding bloom filter indexing on JSON data.
While known for its first-class JSON handling for Java, Jackson is not limited to JSON: with no fewer than 9 supported data formats it can be used for reading and writing data in almost any data format. This talk offers introduction to reading and writing XML and CSV using Jackson.
Mindmap: Oracle to Couchbase for developersKeshav Murthy
This deck provides a high-level comparison between Oracle and Couchbase: Architecture, database objects, types, data model, SQL & N1QL statements, indexing, optimizer, transactions, SDK and deployment options.
Programming the Physical World with Device Shadows and Rules EngineAmazon Web Services
Learn more about how to use AWS IoT's Device Shadows and Rules Engine to build powerful IoT applications. With Device Shadows, you can build applications that interact with your devices by providing always available REST APIs. By taking advantage of AWS IoT's topic-based rules and built-in integrations, you can build IoT applications that gather, process, analyze, and act on data generated by connected devices at global scale, without having to manage any infrastructure.
Modern Oracle DBAs have spent years acquiring extremely valuable skills, even while facing increased responsibility for growing numbers of diverse multi-version databases, demands to transition to public cloud computing Infrastructure, and a never-ending drumbeat for upskilling and relevance in our industry. It’s the perfect time to consider a transition in your career by leveraging your expertise with the Oracle database in a new role as a Data Engineer (DE).
Access Denied: Real-World Use Cases for APEX and Real Application SecurityJim Czuprynski
Limiting users’ access to data is still a thorny issue in many Oracle shops: How do we insure only the right people view - much less change! - only the data they’re allowed to? We’ll show you how we solved those issues for a large government agency with hundreds of external users via Real Application Security (RAS), whether they’re using APEX applications or direct-access tools like SQLcl.
More Related Content
Similar to Going Native: Leveraging the New JSON Native Datatype in Oracle 21c
JSON, A Splash of SODA, and a SQL Chaser: Real-World Use Cases for Autonomous...Jim Czuprynski
JSON is the new XML! It’s everywhere, from NoSQL databases to REST APIs. Let me share with you how Oracle’s Autonomous JSON Database (AJD) makes short work of handling JSON-resident information, especially when paired with robust functions and features of Oracle 19c and 21c.
A story about developing an application for an online store, persisting all the data as JSON.
Gives an overview of JSON functionality in Oracle Database 19c.
JSON support in DB2 for z/OS
1. To illustrate JSON storage model in DB2 for z/OS
2. To introduce JSON SQL APIs features and examples
3. To compare JSON and XML support in DB2 for z/OS
Alongside with all other features SQL 2016 now natively supports JSON – one of the most common formats for data exchange. SQL 2016 now has built-in capabilities to query, analyze, exchange and transform JSON data.
JSON functionality is quite similar to SQL XML support but despite this being one of the most desired additions to SQL 2016 there is a flavour of something missing – the JSON data type.
In this session we will talk about JSON support features, limitations and some tricks to overcome these.
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018Alexander Tokarev
The presentation was prepared for Austria Oracle User group 30 years. It tells us a lot of challenges which Oracle developers face with implementing high-load json processing pipelines.
Introduces the use of JSON-Like data structures within DivConq. Includes how to create and access the structures within Java, as well as how to declare structures in dcSchema for data validation.
This is one of the 15 minute "TED" style talk presented as part of the Database Symposium at the ODTUG Kscope18 conference. In this presentation @SQLMaria coveres topics like what data type you should use to store JSON documents (varchar2, clob or blob) the pro's and con's of using an IS JSON check constraint, and how to load, index, and query JSON documents.
All About JSON and ClickHouse - Tips, Tricks and New Features-2022-07-26-FINA...Altinity Ltd
JSON is the king of data formats and ClickHouse has a plethora of features to handle it. This webinar covers JSON features from A to Z starting with traditional ways to load and represent JSON data in ClickHouse. Next, we’ll jump into the JSON data type: how it works, how to query data from it, and what works and doesn’t work. JSON data type is one of the most awaited features in the 2022 ClickHouse roadmap, so you won’t want to miss out. Finally, we’ll talk about Jedi master techniques like adding bloom filter indexing on JSON data.
While known for its first-class JSON handling for Java, Jackson is not limited to JSON: with no fewer than 9 supported data formats it can be used for reading and writing data in almost any data format. This talk offers introduction to reading and writing XML and CSV using Jackson.
Mindmap: Oracle to Couchbase for developersKeshav Murthy
This deck provides a high-level comparison between Oracle and Couchbase: Architecture, database objects, types, data model, SQL & N1QL statements, indexing, optimizer, transactions, SDK and deployment options.
Programming the Physical World with Device Shadows and Rules EngineAmazon Web Services
Learn more about how to use AWS IoT's Device Shadows and Rules Engine to build powerful IoT applications. With Device Shadows, you can build applications that interact with your devices by providing always available REST APIs. By taking advantage of AWS IoT's topic-based rules and built-in integrations, you can build IoT applications that gather, process, analyze, and act on data generated by connected devices at global scale, without having to manage any infrastructure.
Modern Oracle DBAs have spent years acquiring extremely valuable skills, even while facing increased responsibility for growing numbers of diverse multi-version databases, demands to transition to public cloud computing Infrastructure, and a never-ending drumbeat for upskilling and relevance in our industry. It’s the perfect time to consider a transition in your career by leveraging your expertise with the Oracle database in a new role as a Data Engineer (DE).
Access Denied: Real-World Use Cases for APEX and Real Application SecurityJim Czuprynski
Limiting users’ access to data is still a thorny issue in many Oracle shops: How do we insure only the right people view - much less change! - only the data they’re allowed to? We’ll show you how we solved those issues for a large government agency with hundreds of external users via Real Application Security (RAS), whether they’re using APEX applications or direct-access tools like SQLcl.
Charge Me Up! Using Oracle ML, Analytics, and APEX For Finding Optimal Charge...Jim Czuprynski
Think finding a close parking space is a challenge? Finding the closest charging station for your EV when you’re running short on battery power will be the next nightmare for drivers in Smart Cities. I’ll show how to use existing Oracle Machine Learning, Analytics, and APEX to find the closest charge point while driving, as well as determine where it makes the most sense to placed charge points to benefit utility customers.
Graphing Grifters: Identify & Display Patterns of Corruption With Oracle GraphJim Czuprynski
Uncovering patterns of suspicious behavior is no longer something only an experienced gumshoe or fraud investigator can ferret out. Using Oracle’s powerful Machine Learning algorithms and Property Graph plug-ins, we’ll show how to quickly identify and display potentially suspicious financial transactions.
So an Airline Pilot, a Urologist, and an IT Technologist Walk Into a Bar: Thi...Jim Czuprynski
It’s no joke: The IT industry is undergoing a maelstrom of change – ever-increasing data volumes, horrendous security incursions, the promise / threat of Cloud-based computing, and a gradual loss of its most talented people through age-based attrition. What’s needed more than ever is a revival of professionalism within our ranks, and it’s time for us to rise up as a community to strive towards that goal. Seriously - if you are just doing your IT job and are perfectly satisfied with your status in our industry, please don’t even bother downloading this presentation. (Just kidding!)
Autonomous Transaction Processing (ATP): In Heavy Traffic, Why Drive Stick?Jim Czuprynski
Autonomous Transaction Processing (ATP) - the second in the family of Oracle’s Autonomous Databases – offers Oracle DBAs the ability to apply a force multiplier for their OLTP database application workloads. However, it’s important to understand both the benefits and limitations of ATP before migrating any workloads to that environment. I'll offer a quick but deep dive into how best to take advantage of ATP - including how to load data quickly into the underlying database – and some ideas on how ATP will impact the role of Oracle DBA in the immediate future. (Hint: Think automatic transmission instead of stick-shift.)
Conquer Big Data with Oracle 18c, In-Memory External Tables and Analytic Func...Jim Czuprynski
There’s an onslaught of Big Data coming to our IT shops - zettabytes of it! – but instead of your application developers struggling to learn new languages and techniques to analyze it, why not leverage Oracle Database 18c?
I'll demonstrate how to tackle handling the coming Big Data tidal wave with the best tool ever designed to filter, sort, aggregate, and report information: Structured Query Language. We’ll also take a closer look at using some new Analytic Functions in 19c to make short work of complex analyses and how best to leverage 18c’s latest Database In-Memory features for External Tables. And we’ll even explore how easy it is to leverage External Tables in Autonomous Data Warehouse using the latest features of DBMS_CLOUD.
Vote Early, Vote Often: From Napkin to Canvassing Application in a Single Wee...Jim Czuprynski
The frenetic pace of application development in modern IT organizations means it’s not unusual to demand an application be built with minimal requirement gathering – literally, from a napkin-based sketch – to a working first draft of the app within extremely short time frames – even a weekend! – with production deployment to follow just a few days later.
I'll demonstrate a real-life application development scenario – the creation of a mobile application that gives election canvassers a tool to identify, classify, and inform voters in a huge suburban Chicago voting district – using the latest Oracle application development UI, data modeling tools, and database technology. Along the way, we’ll show how Oracle APEX makes short work of building a working application while the Oracle DBA leverages her newest tools – SQL Developer and Data Modeler – to build a secure, reliable, scalable application for her development team.
What's Your Super-Power? Mine is Machine Learning with Oracle Autonomous DB.Jim Czuprynski
Artificial Intelligence (AI) and Machine Learning (ML) are a lot like preserving the Earth's environment: Almost everyone is talking about what should be done to save it, but very few people have committed to actually doing something about it. I'll demonstrate a few real-life opportunities to discover unseen patterns and relationships within sample financial and election data by leveraging the AI and ML capabilities already built into Oracle Autonomous Database.
An Autonomous Singularity Approaches: Force Multipliers For Overwhelmed DBAsJim Czuprynski
Autonomous Database Services have expanded well beyond their original scope of heavy analytical workloads (ADW) and hybrid transaction processing / reporting workloads (ATP) to include dedicated Cloud-based instances to eliminate contention between “noisy neighbors” in the same region and domain.
I'll explain how Oracle DBAs at any skill level can immediately leverage Autonomous resources as force multipliers to free them from most mundane administration tasks so they can concentrate on mastering the new skills required to become an Enterprise Data Architect - the emerging post-DBA role – and shift their focus towards building better enterprise systems in concert with their organization’s application developers, business analysts, and business units.
Politics Ain’t Beanbag: Using APEX, ML, and GeoCoding In a Modern Election Ca...Jim Czuprynski
Oracle announced in December 2019 its Spatial and Graph features are now included without additional licensing costs for Oracle databases. This means application developers now have low-cost access to powerful geolocation, routing, and mapping capabilities – a welcome addition for any Application Express (APEX) application that previously shied away from implementing those features. I'll demonstrate a real-life use case – handling the changing demands of a modern election campaign, including managing widely-dispersed volunteers and voters, using geolocation for merchandise distribution, and identifying “flippable” voters with ML and analytics – through a mobile-capable APEX application.
One Less Thing For DBAs to Worry About: Automatic IndexingJim Czuprynski
You’re a busy Oracle DBA. Your phone rings. It’s your most troublesome user, once again complaining that her query is running slow. You take a quick look at the execution plan, find a possible choice for a new index to improve its performance, and drop it in place: Problem solved. Or is it? Even an experienced DBA may not immediately realize the impact that new index will have on the performance of dozens of other queries and DML statements.
Finally, there’s a better way: Let the database decide.
I'll show you how Automatic Indexing (AI) - one of the newest features of Oracle Database 19c – provides an intriguing alternative to reactive performance tuning methodologies for index creation. We’ll look at how AIC reacts to a heavy hybrid application workload and then holistically builds, tests, and implements the most appropriate secondary indexes needed to improve database performance.
Keep Your Code Low, Low, Low, Low, Low: Getting to Digitally Driven With Orac...Jim Czuprynski
In the brave new digitally-driven world, IT organizations can no longer focus on internal-only RDBMS databases as the central pillar of their infrastructure; data must be accessed externally as well, regardless of format or location, with utmost security. Fortunately, Oracle’s Converged Database strategy makes it simple to satisfy these demands. This presentation explores the myriad facets of a Converged Database strategy and what it means for your career’s future path, regardless of whether you’re an application developer or DBA.
Cluster, Classify, Associate, Regress: Satisfy Your Inner Data Scientist with...Jim Czuprynski
The modern data scientist has a daunting task: Probing petabytes of data, figuring out which Machine Learning (ML) algorithms to apply to filter the grain from the chaff, and producing meaningful intelligence on which to base digitally-driven strategies for their organization. This presentation demonstrates how even a fledgling citizen data scientist facing new real-life opportunities to discover unseen patterns and relationships within sample data can quickly leverage the powerful ML capabilities already built into the Oracle Database and available for use at no additional cost.
Where the %$#^ Is Everybody? Geospatial Solutions For Oracle APEXJim Czuprynski
Geospatial use cases are common – closest coffeeshop, efficient delivery routing, other stores near me – and I’ll show you how to use Oracle’s Spatial and Graph feature set to tackle them within a simple-to-build APEX application.
Fast and Furious: Handling Edge Computing Data With Oracle 19c Fast Ingest an...Jim Czuprynski
The Internet of Things (IoT) has deep use cases - energy grids, communications, policing, security, and manufacturing. I’ll show how to use Oracle 19c’s Fast Ingest and Fast Lookup features to load IoT data from “edge” sources to take immediate advantage of that information in nearly real time.
As Europe's leading economic powerhouse and the fourth-largest hashtag#economy globally, Germany stands at the forefront of innovation and industrial might. Renowned for its precision engineering and high-tech sectors, Germany's economic structure is heavily supported by a robust service industry, accounting for approximately 68% of its GDP. This economic clout and strategic geopolitical stance position Germany as a focal point in the global cyber threat landscape.
In the face of escalating global tensions, particularly those emanating from geopolitical disputes with nations like hashtag#Russia and hashtag#China, hashtag#Germany has witnessed a significant uptick in targeted cyber operations. Our analysis indicates a marked increase in hashtag#cyberattack sophistication aimed at critical infrastructure and key industrial sectors. These attacks range from ransomware campaigns to hashtag#AdvancedPersistentThreats (hashtag#APTs), threatening national security and business integrity.
🔑 Key findings include:
🔍 Increased frequency and complexity of cyber threats.
🔍 Escalation of state-sponsored and criminally motivated cyber operations.
🔍 Active dark web exchanges of malicious tools and tactics.
Our comprehensive report delves into these challenges, using a blend of open-source and proprietary data collection techniques. By monitoring activity on critical networks and analyzing attack patterns, our team provides a detailed overview of the threats facing German entities.
This report aims to equip stakeholders across public and private sectors with the knowledge to enhance their defensive strategies, reduce exposure to cyber risks, and reinforce Germany's resilience against cyber threats.
Chatty Kathy - UNC Bootcamp Final Project Presentation - Final Version - 5.23...John Andrews
SlideShare Description for "Chatty Kathy - UNC Bootcamp Final Project Presentation"
Title: Chatty Kathy: Enhancing Physical Activity Among Older Adults
Description:
Discover how Chatty Kathy, an innovative project developed at the UNC Bootcamp, aims to tackle the challenge of low physical activity among older adults. Our AI-driven solution uses peer interaction to boost and sustain exercise levels, significantly improving health outcomes. This presentation covers our problem statement, the rationale behind Chatty Kathy, synthetic data and persona creation, model performance metrics, a visual demonstration of the project, and potential future developments. Join us for an insightful Q&A session to explore the potential of this groundbreaking project.
Project Team: Jay Requarth, Jana Avery, John Andrews, Dr. Dick Davis II, Nee Buntoum, Nam Yeongjin & Mat Nicholas
Adjusting primitives for graph : SHORT REPORT / NOTESSubhajit Sahu
Graph algorithms, like PageRank Compressed Sparse Row (CSR) is an adjacency-list based graph representation that is
Multiply with different modes (map)
1. Performance of sequential execution based vs OpenMP based vector multiply.
2. Comparing various launch configs for CUDA based vector multiply.
Sum with different storage types (reduce)
1. Performance of vector element sum using float vs bfloat16 as the storage type.
Sum with different modes (reduce)
1. Performance of sequential execution based vs OpenMP based vector element sum.
2. Performance of memcpy vs in-place based CUDA based vector element sum.
3. Comparing various launch configs for CUDA based vector element sum (memcpy).
4. Comparing various launch configs for CUDA based vector element sum (in-place).
Sum with in-place strategies of CUDA mode (reduce)
1. Comparing various launch configs for CUDA based vector element sum (in-place).
Adjusting primitives for graph : SHORT REPORT / NOTES
Going Native: Leveraging the New JSON Native Datatype in Oracle 21c
1. Going Native:
Leveraging the New
JSON Native Datatype
in Oracle 21c
Jim Czuprynski
@JimTheWhyGuy
Zero Defect Computing, Inc.
2. Who Am I, and What Am I Doing Here?
➢E-mail me at jim@jimthewhyguy.com
➢Follow me on Twitter (@JimTheWhyGuy)
➢Connect with me on LinkedIn (Jim Czuprynski)
Traveler & public speaker Summers:
Wisconsin
Winters:
Illinois
Cyclist
XC skier
Avid
amateur
bird
watcher
Oldest dude in
martial arts class
4. Converged Database: A Vision for the Future, 21c and Beyond
Personal /
External
Datasets
Enterprise Applications
Data Integration
OAC, OML,
APEX, and
Graph Studio
Ad hoc,
Batch or
Scheduled
Business
Leaders
Analysts
Data
Scientists
Developers
OAC Dataflow,
Manual or ETL
Data Management
ADW
Business Analytics
ERP CRM HCM
Self-sufficient,
encrypted, secured
data storehouse
Self-service
analytics via ML
REST-Enabled
External APIs
IoT and
Edge
Computing
ATP
AJD AGD
Autonomous JSON Database
emerges as serious
contender versus MongoDB
Autonomous Database for
Graph Studio enables
analysis & visualization of
complex relationships
AutoML features make it simple
to apply the right algorithm(s)
with confidence
6. New in 21c: A Native JSON Datatype
CREATE TABLE bart.t_geojson(
gis_id NUMBER(06) NOT NULL
,gis_doc JSON
)
TABLESPACE json_data
STORAGE (INITIAL 8M NEXT 8M);
Here’s how simple it is
to designate the new
native JSON datatype
CREATE TABLE bart.t_notnative(
gis_id NUMBER(06) NOT NULL
,gis_doc BLOB
CONSTRAINT ensure_json
CHECK (gis_doc IS JSON)
)
LOB (gis_doc)
STORE AS (CACHE)
TABLESPACE json_data
STORAGE (INITIAL 8M NEXT 8M);
Compare it to this complex (but still-
valid!) syntax to create suitable
JSON storage in prior releases
7. Loading JSON Has Never Been This Easy
CREATE DIRECTORY XTJSON
AS '/u01/app/oracle/homes/OraDB21000_home1/XTFILES';
CREATE TABLE bart.xt_gis_docs(
gis_id VARCHAR2(06)
,gis_doc VARCHAR2(4000)
)
ORGANIZATION EXTERNAL (
TYPE ORACLE_LOADER
DEFAULT DIRECTORY XTJSON
ACCESS PARAMETERS (FIELDS TERMINATED BY '|')
LOCATION ('SampleGeoJSON.csv')
)
REJECT LIMIT 50000;
First, build an EXTERNAL
table referencing the
input file …
8. Loading JSON Has Never Been This Easy
CREATE DIRECTORY XTJSON
AS '/u01/app/oracle/homes/OraDB21000_home1/XTFILES';
CREATE TABLE bart.xt_gis_docs(
gis_id VARCHAR2(06)
,gis_doc VARCHAR2(4000)
)
ORGANIZATION EXTERNAL (
TYPE ORACLE_LOADER
DEFAULT DIRECTORY XTJSON
ACCESS PARAMETERS (FIELDS TERMINATED BY '|')
LOCATION ('SampleGeoJSON.csv')
)
REJECT LIMIT 50000;
First, build an EXTERNAL
table referencing the
input file …
TRUNCATE TABLE bart.t_geojson;
INSERT INTO bart.t_geojson(gis_id, gis_doc)
SELECT gis_id, gis_doc from bart.xt_gis_docs;
COMMIT;
… and then load the target
table via the standard INSERT
INTO … SELECT FROM method
Of course, loading via utilities like SQL*Loader is also fully supported!
9. Using New APEX Loading Capabilities for JSON Data Sources
New APEX loading
methods make
short work of
loading JSON
content
10. Using New APEX Loading Capabilities for JSON Data Sources
New APEX loading
methods make
short work of
loading JSON
content
Note the 21c Native JSON
column datatype is
automatically recognized
11. Feel the Need? The Need For Speed? 21c’s JSON Datatype is the Answer.
The new native JSON datatype is transferred between Oracle 21c client sessions and
the 21c database server without any textual conversion
• JSON encoding on ingest and text serialization on output are thus avoided
• This dramatically improves performance because it saves database CPU
The latest 21c client drivers are required to take advantage of these features!
• Otherwise, JSON datatype instances must first be converted to JSON text, which can dramatically
reduce the binary efficiencies of the JSON Native datatype
• The new 21c client are also capable of directly processing the binary JSON format (OSON) to
directly support JSON APIs
• The latest 21c client also supports the use of extended types
Note: SODA default collections built within an Oracle Database 21c must still use the 21c SODA
driver to leverage the native JSON type
Download the latest Oracle 21c Client drivers here
12. A New JSON Multi-Tool: JSON_TRANSFORM()
Check out a complete description of JSON_TRANSFORM() capabilities here
JSON_TRANSFORM()
Verb
Resulting Capability
INSERT Insert value of specified SQL expression at location targeted by specified path expression
APPEND Add value of specified SQL expression to targeted array
RENAME Rename field targeted by specified path expression to value of SQL expression
SET UPSERT data targeted by specified path expression to value of specified SQL expression
REPLACE Replace data defined by specified path expression with value of specified SQL expression
KEEP Remove all parts of input data not targeted by at least one of the specified path expressions
REMOVE Remove input data targeted by specified path expression
13. Updating JSON Key Values Directly With JSON_TRANSFORM
This statement will fix
Name values, but only
for selected entries
This UPSERT operation
didn’t require creating a
new copy of each JSON
document and then
essentially re-inserting the
updated document
14. JSON_TRANSFORM(): Some Other Examples
UPDATE bart.t_geojson
SET gi_doc =
JSON_TRANSFORM(gi_doc, SET '$.LastChangedOn' = SYSTIMESTAMP);
Add and populate a new column (LastChangedOn) to all JSON documents:
1
UPDATE bart.t_geojson
SET gis_doc =
JSON_TRANSFORM(gis_doc, APPEND '$.features.chargertypes' = 'Mr. Fusion');
Add a new element at the start of a specific JSON array:
2
UPDATE bart.t_geojson
SET gis_doc =
JSON_TRANSFORM(gis_doc, REMOVE '$.features.chargertypes');
Remove an existing element from an existing field for all JSON documents:
3
15. Differences between Native JSON vs. JSON_SCALAR() SQL Function
SELECT
JSON_VALUE(
JSON_SCALAR(CURRENT_TIMESTAMP), '$.timestamp()'
) AS "Extended TIMESTAMP"
FROM DUAL;
See this for a summary of Native JSON vs. JSON_SCALAR and JSON_SERIALIZE SQL functions
JSON_SCALAR() accepts
a SQL scalar value as
input and returns a
corresponding JSON
scalar value as a JSON
type instance
Extended TIMESTAMP
-------------------------------
12-JUN-22 04.50.04.138529000 PM
It therefore extends the
JSON native type for Oracle-
specific datatypes like DATE,
TIMESTAMP, and INTERVAL
YTM / DTS
16. Path Expression Item Methods With JSON_VALUE()
SELECT
gis_id
,JSON_VALUE(gis_doc,
'$.features.chargertypes[*].minString()’)
AS Lowest
,JSON_VALUE(gis_doc,
'$.features.chargertypes[*].maxString()’)
AS Highest
FROM bart.t_geojson;
Here’s an extensive list of the myriad conversion capabilities for JSON_VALUE()
JSON_VALUE() can
apply item methods
for data conversions
GIS_ID LOWEST HIGHEST
------ ---------- ----------
2714 L1 Mr. Fusion
2715 L1 Mr. Fusion
2716 L1 Mr. Fusion
2717 L1 Mr. Fusion
2718 L2 Mr. Fusion
. . .
In this example, it returns the minimum
and maximum string values within the
CHARGERTYPES item array
17. Multi-Value Functional Indexes: Benefits
{"type" : "FeatureCollection"
,"features" : [
{"type" : "Feature"
,"geometry" :
{"type" : "Point“
, "coordinates" : [-89.3106, 43.0653]
}
, "properties" : {
"Name" : "Blains Farm & Fleet"
, "Address" : "2202 SOUTH STOUGHTON ROAD"
, "City" : "MADISON”
, "State" : "WI"
, "ZIPCode" : "53716“
}
, "chargertypes": ["L2","L3"]
}
]
}
This CHARGERTYPES
JSON array may store
multiple different
values …
… but what if our query needs to
find only charging locations
offering L3 chargers?
18. Multi-Value Functional Indexes: Implementation
DROP INDEX bart.chargertypes_fk_idx;
CREATE MULTIVALUE INDEX bart.chargertypes_fk_idx
ON bart.t_geojson t
(t.gis_doc.features.chargertypes[*].string());
Not a problem in 21c! We can create a multi-value
index for that JSON array’s values
Note that various JSON datatype
expressions are supported as well
19. Multi-Value Indexes: Proof of Usage
SELECT
gis_id AS id
,TI.gis_doc.features.properties.City AS city
FROM bart.t_geojson TI
WHERE JSON_EXISTS(gis_doc,
'$.features.chargertypes[*]?(@.string() == "L3")');
Here’s a simple query to test
usage of the multi-value index
on values stored within the
CHARGERTYPES JSON array
20. Multi-Value Indexes: Proof of Usage
SELECT
gis_id AS id
,TI.gis_doc.features.properties.City AS city
FROM bart.t_geojson TI
WHERE JSON_EXISTS(gis_doc,
'$.features.chargertypes[*]?(@.string() == "L3")');
Here’s a simple query to test
usage of the multi-value index
on values stored within the
CHARGERTYPES JSON array
The RANGE SCAN (MULTI VALUE)
operation indicates the multi-value index
on CHARGERTYPES was definitely used
22. Storing, Indexing, and Using GeoJSON GIS Data
{"type" : "FeatureCollection"
,"features" : [
{"type" : "Feature"
,"geometry" :
{"type" : "Point“
, "coordinates" : [-89.3106, 43.0653]
}
, "properties" : {
"Name" : "Blains Farm & Fleet"
, "Address" : "2202 SOUTH STOUGHTON ROAD"
, "City" : "MADISON”
, "State" : "WI"
, "ZIPCode" : "53716“
}
, "chargertypes": ["L2","L3"]
}
]
}
This GEOMETRY JSON object contains a
GeoJSON longitude / latitude pair
SELECT
JSON_VALUE(gis_doc, '$.features[0].geometry'
RETURNING SDO_GEOMETRY
ERROR ON ERROR) AS SDOGeometryObject
,TI.gis_doc.features.properties[0].City AS City
,TI.gis_doc.features.properties[0].ZIPCode AS "ZIP Code"
FROM bart.t_geojson TI;
21c lets us translate them
directly into an
SDO_GEOMETRY object for use
in mapping and geolocation
23. Building a New APEX App Using GeoJSON Data (1)
We’ll create a new APEX app …
1
24. Building a New APEX App Using GeoJSON Data (1)
We’ll create a new APEX app …
1
… from either an existing
template, or downloaded code
2
25. Building a New APEX App Using GeoJSON Data (2)
We’ll build the new app
from scratch …
3
… and name it appropriately
4
26. Building a New APEX App Using GeoJSON Data (3)
Next, we’ll add a page using the new
APEX 21.2 Native Map Region …
5
… to demonstrate GeoJSON
mapping capabilities
6
27. Building a New APEX App Using GeoJSON Data (4)
Here’s the resulting
APEX Native Map
Region, populated with
Longitude & Latitude
coordinates …
8
28. Building a New APEX App Using GeoJSON Data (4)
Here’s the resulting
APEX Native Map
Region, populated with
Longitude & Latitude
coordinates …
8
… and an Interactive Report
region with other data elements
relevant to each plotted location
9
29. Oh … One More Thing.
Document Databases are great, but ...
MongoDB has popularized document databases for developers with their free
to use community edition. MongoDB offers simple document database APIs;
however, it has limitations supporting multi-document ACID transactions
critical to enterprise applications. For developers, implementing basic SQL
engine functionality requires writing, testing and maintaining hundreds of
lines of application code, resulting in security vulnerabilities, increased
development time and maintenance.
- October 26, 2021: Kiran Makarla & Beda Hammerschmidt,
Oracle Database API for MongoDB with Oracle Autonomous Database
opens up an entirely new set of use cases for MongoDB applications
30. So, Your Data Is In MongoDB. And Your Point Is?
Establish security permissions
to access data within your
MongoDB database …
1
… create collections
and data within
MongoDB …
2
… and start accessing your
MongoDB data directly
from Oracle!
3
31. JSON: References and Further Reading
JSON DataType Support in Oracle 21c:
https://blogs.oracle.com/database/post/json-datatype-support-in-oracle-21c
Storing, Indexing, and Using GeoJSON Geographic Data:
https://docs.oracle.com/en/database/oracle/oracle-database/21/adjsn/using-GeoJSON-geographic-data.html
Autonomous JSON Database (AJD) and SODA Examples:
https://www.slideshare.net/jczuprynski/json-a-splash-of-soda-and-a-sql-chaser-realworld-use-cases-for-autonomous-json-database-ajd
OSON - A Deeper Look:
https://blogs.oracle.com/jsondb/osonformat
http://www.vldb.org/pvldb/vol13/p3059-liu.pdf