SlideShare a Scribd company logo
Revolutionize Java Database Application
Development with Reactive Streams and
Virtual Threads
Andersen Lab - Poland
Juarez Barbosa Junior @juarezjunior
Senior Principal Java Developer Evangelist
ORACLE
Copyright © 2024, Oracle and/or its affiliates
Juarez Barbosa Junior
Senior Principal Java Developer Evangelist @ Oracle
• Coming from Dublin, Ireland
• 28 years of experience in SW Engineering & DevRel
• Oracle, Microsoft, IBM, Nokia, Unisys, Accenture, startups
• Microsoft Azure Developer Relations Lead
• IBM Watson Tech Evangelist & Cloud Rockstar
• IBM Mobile Tech Evangelist & Global Thought Leader
• Nokia Developers Global Champion
• Java, Python, Cloud, DevOps, SRE, Cloud-native, IoT, AI, Blockchain,
Rust
• Speaker at conferences
• Oracle CloudWorld, Oracle Code, Microsoft Ignite & TechX, jPrime,
JCON, DevConf.cz, GeeCon, DevOpsDays, DeveloperWeek, DevOps
Institute, CloudLand, DWX, The Developer’s Conference (TDC),
Sec4Dev, JSNation, NodeConf, Conf42, Shift Conf, Global Azure,
Open-Source Lisbon, CodeFrenzy, Mêlée Numérique, React Summit,
Test.js Summit, Porto TechHub Conf, Pyjamas, MiTechCon, Data
Science Summit, OpenSourceNorth, WeAreDevelopers, Global
Software Architecture Summit, JavaCro, JUGs, OUGs, GDGs,
meetups, hackathons, and customer engagements.
@juarezjunior
@juarezjunior
Agenda
• Java App Dev with the Oracle Database
• Oracle JDBC - Support for the Latest Java Versions
• Overview of Oracle DB Access with Java
• Oracle JDBC – Sync and Async
• Classic Java Platform Threads
• Project Loom – Virtual Threads
• Virtual Threads - JEPs 425, 436, 444
• Demo # 1: Virtual vs Platform Threads
• Reactive JDBC - Synchronous vs Asynchronous JDBC
• Reactive Streams Ingestion (RSI)
• Demo # 2: Reactive Streams Ingestion (RSI)
• From Sync to Reactive JDBC: Oracle R2DBC
• Demo # 3: Oracle R2DBC with Project Reactor
• Live Labs/Free Oracle Cloud Account/Oracle ACE Program
Copyright © 2024, Oracle and/or its affiliates
Java App
Dev with
Oracle
Database
Copyright © 2024, Oracle and/or its affiliates
Overview of Oracle DB Access with Java
Copyright © 2024, Oracle and/or its affiliates
Copyright © 2024, Oracle and/or its affiliates
Oracle JDBC - Support for the Latest Java Versions
• Java 11 - native support, compiled with it
• Java 17 - certified
• JDBC Standards - 4.2 and 4.3
• GraalVM - native image instrumentation
• Reactive Streams - Java Flow API support
• Project Loom - Virtual Threads support
• Data access is crucial in mission-critical apps
Oracle JDBC –
Async and Sync
• Project Loom - Virtual Threads
• Synchronous database access with lightweight threads
• Standard JDBC + Virtual Threads
• Client application call stack may use blocking, synchronous code
• Libraries must be compatible with Virtual Threads
• Oracle instrumented the Oracle JDBC driver to support Virtual Threads
• Reactive Programming
• Asynchronous database access with non-blocking network I/O
• Oracle Reactive Streams Ingestion + Oracle R2DBC + Oracle JDBC Reactive Extensions
(Flow)
• Libraries are available: Reactor, RxJava, Akka, Vert.x
Copyright © 2024, Oracle and/or its affiliates
Classic Java
Platform Threads
• Database access with blocking threads
• A JDBC call blocks a thread for 100s of milliseconds
(thread-per-request style)
• Thread count increases linearly with the number
of JDBC calls
• Performance degrades as the number of threads
increases
• 1 MB of stack memory per thread typically
• Scheduling many platform threads is expensive
• Preemptive scheduling vs time-slicing
Copyright © 2024, Oracle and/or its affiliates
Virtual Threads - JEPs 425, 436, 444
• Virtual Threads – JEPs (JDK Enhancement Proposals)
• Lightweight (user mode) threads that dramatically reduce the effort of writing,
maintaining, and observing high-throughput concurrent applications
• Enable applications written in the simple thread-per-request style to scale with near-
optimal hardware utilization
• Enable easy troubleshooting, debugging, and profiling of virtual threads with existing JDK
tools
• Do not remove the traditional implementation of threads
• Do not alter the basic concurrency model of Java
• Enable existing code that uses Java threads (java.lang.Thread) to adopt virtual threads with
minimal change
Copyright © 2024, Oracle and/or its affiliates
Virtual Threads - JEPs 425, 436, 444
• Virtual Threads – JEPs (JDK Enhancement Proposals)
• Virtual threads typically employ a small set of platform threads used as carrier threads
• Code executing in a virtual thread is not aware of the underlying carrier thread
• The currentThread() method will always return the Thread object for the virtual thread
• Virtual threads do not have a thread name by default. The getName() method returns the
empty string if a thread name is not set
• Virtual threads have a fixed thread priority that cannot be changed
• Virtual threads are daemon threads so do not prevent the shutdown sequence from
beginning (low-priority ones).
Copyright © 2024, Oracle and/or its affiliates
Virtual
Threads -
JEPs 425,
436, 444
• JDK Enhancement Proposals
• JEP 425: Virtual Threads (Preview)
• JEP 436: Virtual Threads (Second Preview)
• JEP 444: Virtual Threads
• java.lang.Thread
• final Boolean - isVirtual()
• static Thread.Builder.OfVirtual - ofVirtual()
• static Thread.Builder.OfPlatform - ofPlatform()
• static Thread - startVirtualThread(Runnable task)
• java.lang.Thread.Builder
• java.util.concurrent.Executors
• static ExecutorService -
newVirtualThreadPerTaskExecutor()
Copyright © 2024, Oracle and/or its affiliates
Virtual Threads - JEPs 425, 436, 444
• java.lang.Thread.Builder
• Thread defines a
Thread.Builder API for
creating and starting
both platform and virtual
threads. The following
are examples that use
the builder:
Copyright © 2024, Oracle and/or its affiliates
Copyright © 2022, Oracle and/or its affiliates
Demo # 1: Virtual vs Platform Threads
⚫ Virtual Threads vs Platform Threads
⚫ JEP 425 Virtual Threads (Preview)
⚫ JEP 436 (Second Preview)
⚫ JEP 444 (JDK 21)
⚫ Runs on Java 19, 20, 21
⚫ javac --release 19 --enable-preview
⚫ java --enable-preview
⚫ Oracle JDBC Driver instrumented to support Virtual Threads
⚫ Verifiable comparison of OS/HW resources consumption (Platform Threads x Virtual
Threads)
Copyright © 2024, Oracle and/or its affiliates
Reactive JDBC - Sync vs Async JDBC
Setup
Blocking
Handle Result
Setup
Non-Blocking
Handle Result
Synchronous JDBC Setup
Blocking
Handle Result
Setup
Non-Blocking
Handle Result
Setup
Non-Blocking
Handle Result
Reactive JDBC
Database
Setup
Blocking
Handle Result
Database
Copyright © 2022, Oracle and/or its affiliates
Reactive Streams Ingestion (RSI)
⚫ Java Library for Reactive Streams Ingestion
⚫ Streaming capability: Ingest data in an unblocking, and
reactive way from a large group of clients
⚫ Group records through RAC (Real App Clusters),
and Shard affinity using native UCP (Universal Connection
Pool)
⚫ Optimize CPU allocation while decoupling record
Processing from I/O
⚫ Fastest insert method for the Oracle Database through
Direct Path Insert, bypassing SQL and writing directly into the DB files
Copyright © 2024, Oracle and/or its affiliates
Demo # 2: Reactive Streams Ingestion (RSI)
Container
Pipelines,
Jenkins, etc.
Build
Test
Push
Push Docker
images to
Registry
Cloud
Infrastructur
e Registry
Container
Engine for
Kubernetes
Pull images
from Registry
Deploy
images to
production
Kubernetes
worker nodes
Containers
running
microservices
deployed over
Kubernetes
ORACLE CLOUD INFRASTRUCTURE
ATP, ADW, ATP-D,
AFDW-D
Memoptimized
Rowstore
RSI Runtime: Non-
blocking, optimized library
for streaming data
through Direct Path, Shard
& RAC/FAN support.
HTTP / REST Engine over
Helidon
Define build
for CI/CD
toolchain
gRPC / AMQP / MQTT
Engines
Microservices
Files / Logs
IoT
Devices
/
Apps
cv
MQTT
gRPC
AMQP
HTTP / REST
JDBC
Direct Path
INSERT
Record
Streaming
over
multiple
protocols.
Copyright © 2024, Oracle and/or its affiliates
Demo #2: RSI - Architecture
Copyright © 2024, Oracle and/or its affiliates
Demo #2: RSI - Project Structure
From Sync to Reactive JDBC: Oracle
R2DBC
• Oracle Reactive Relational Database Connectivity (R2DBC)
• Oracle R2DBC Driver is a Java library that supports reactive
programming with the Oracle Database
• It implements the R2DBC Service Provider Interface (SPI) as
specified by the Reactive Relational Database Connectivity
(R2DBC) spec
• The R2DBC SPI exposes Reactive Streams as an abstraction
for remote database operations
• The sample code uses Project Reactor. It could use RxJava,
Akka, or any Reactive Streams library
• Runs on Java 11+
• Oracle RDBC 1.1.1 (2023), Apache v2.0, OSS
Copyright © 2024, Oracle and/or its affiliates
R2DBC – Reactive Relational DB Connectivity
Copyright © 2024, Oracle and/or its affiliates
Demo # 3: Oracle R2DBC
static String queryJdbc(java.sql.Connection connection) throws
SQLException {
try (java.sql.Statement statement = connection.createStatement()) {
ResultSet resultSet =
statement.executeQuery("SELECT * FROM CUSTOMERS");
if (resultSet.next())
return resultSet.getString(1);
else
throw new NoSuchElementException("Query returned zero rows");
}
}
static Publisher<String> queryR2dbc(io.r2dbc.spi.Connection
connection) {
return Flux.from(connection.createStatement(
"SELECT * FROM CUSTOMERS")
.execute())
.flatMap(result ->
result.map(row -> row.get(0, String.class)))
.switchIfEmpty(Flux.error(
new NoSuchElementException("Query returned zero rows")));
}
Virtual Threads or
Reactive?
• Oracle JDBC supports both!
• Want Virtual Threads?
• The Oracle JDBC driver has been
“Virtual Thread Compatible” since 21c
• Want Reactive?
• Oracle R2DBC 1.1.1 is available now
• Consume Flow interfaces directly
from Oracle JDBC’s Reactive
Extensions
Copyright © 2024, Oracle and/or its affiliates
Virtual Threads or Reactive?
• Benefits of Virtual Threads:
• Easier to read and write
• Easier to debug
• Integration with JDK tools
• Do not alter the basic concurrency model of Java
• Now available in JDK 21
• Limitations of Virtual Threads:
• Some libraries/frameworks are not
compatible yet
Copyright © 2024, Oracle and/or its affiliates
Benefits of Reactive:
• Reactive Libraries (Reactor, RxJava, Akka, Vert.x)
• Stream-like API with a functional style
• Low-level concurrency is handled for you
(locks, atomics, queues)
Limitations of Reactive:
• Steep learning curve
• Harder to read and write
• Harder to debug
New | Oracle Database 23ai
Next-Generation Converged Database Services
Over 300 major new features plus thousands of enhancements
Available on OCI and Azure
Major focus on
• AI for Data features
• Developer/Analyst features
• Mission-Critical features
Addresses data management pain points that have frustrated customers forever
Copyright © 2024, Oracle and/or its affiliates
Oracle Database 23ai - AI for Data
Algorithmic AI AI Vector Search Augmented Generative AI (LLMs)
Distributed AI AI Storage AI Developer Tools
Copyright © 2024, Oracle and/or its affiliates
Oracle Database 23ai - Dev for Data
JSON Relational
Duality Views
Property Graph Views
JavaScript
Stored Procedures
Data Intent
Language
Lock-free Consistent Updates,
Long-running Transactions
True
Cache
Copyright © 2024, Oracle and/or its affiliates
Oracle Database 23ai - Mission-Critical Data
RAFT Replication for
Globally Distributed Database
In-Database
Firewall
Real-Time SQL Plan
Management
RAC, Exadata, Data Guard
Simplicity and Scalability
Analytic SQL
Simplicity and Scalability
Priority
Transactions
Copyright © 2024, Oracle and/or its affiliates
Free | Oracle Database 23ai For Developers
Oracle Always Free ADB
Available on OCI
ADB Free Container Image
Available for download
Oracle Database Free
Available as RPM, Docker
Image, VBox VM
Copyright © 2024, Oracle and/or its affiliates | Confidential - Internal
Very Low Cost Supported Developer Edition of ADB, BaseDB, ExaDB-D, and ExaDB-C@C
Copyright © 2024, Oracle and/or its affiliates
References
• JDK 22
• The Arrival of JDK 22 - https://blogs.oracle.com/java/post/the-arrival-of-java-22
• Project Loom / Virtual Threads
• Loom - https://openjdk.org/projects/loom/
• JEP 444 Virtual Threads - https://openjdk.org/jeps/444
• Introduction to Oracle JDBC Driver Support for Virtual Threads - https://bit.ly/3UlNJWP
• Reactive Streams Ingestion Library
• Getting Started with the Java library for Reactive Streams Ingestion (RSI) - https://bit.ly/3rEiRnC
• High-throughput stream processing with the Java Library for Reactive Streams Ingestion (RSI),
Virtual Threads, and the Oracle ATP Database - https://bit.ly/3rATCTd
• A High-Speed Data Ingestion Solution in Java Using MQTT, AMQP, and STOMP -
https://medium.com/oracledevs/a-high-speed-data-ingestion-microservice-in-java-using-mqtt-
amqp-and-stomp-135724223ae1
• R2DBC
• Oracle R2DBC Driver – https://github.com/oracle/oracle-r2dbc
• What’s in Oracle Database 23ai for Java Developers?
• https://www.oracle.com/a/tech/docs/database/whats-in-oracledb23ai-for-java-developers.pdf
• Develop Java applications with Oracle Database
• JDBC – https://www.oracle.com/database/technologies/appdev/jdbc.html
Juarez Junior
@juarezjunior
Andersen_Revolutionize Java DB AppDev with Reactive Streams and Virtual Threads.pdf
Oracle LiveLabs
Showcasing how Oracle’s solutions can
solve your business problems
500+
free workshops,
available or in
development
3.5 million
people have already visited
LiveLabs
developer.oracle.com/livelabs
learn something new …at your pace!
600+
events run
using LiveLabs
workshops
3 membership tiers
Connect: @oracleace facebook.com/OracleACEs
aceprogram_ww@oracle.com
500+ technical experts &
community leaders helping peers globally
The Oracle ACE Program recognizes & rewards individuals for
their technical & community contributions to the Oracle community
Nominate
yourself or a candidate:
ace.oracle.com/nominate
Learn more - ace.oracle.com
blogs.oracle.com/ace
Create your FREE
Cloud Account
• Go to
https://signup.cloud.oracle.com/
Copyright © 2024, Oracle and/or its affiliates
Ad

Recommended

Porto Tech Hub Conference 2023 - Revolutionize Java DB AppDev with Reactive S...
Porto Tech Hub Conference 2023 - Revolutionize Java DB AppDev with Reactive S...
Juarez Junior
 
BarcelonaJUG - Revolutionize Java Database Application Development with React...
BarcelonaJUG - Revolutionize Java Database Application Development with React...
Juarez Junior
 
AI Industrial Summit - SOFIA, BULGARIA - A High-Speed Data Ingestion Microser...
AI Industrial Summit - SOFIA, BULGARIA - A High-Speed Data Ingestion Microser...
Juarez Junior
 
CloudLand - Revolutionize Java DB AppDev with Reactive Streams and Virtual Th...
CloudLand - Revolutionize Java DB AppDev with Reactive Streams and Virtual Th...
Juarez Junior
 
DWX23 - Revolutionize Java DB AppDev with Reactive Streams and Virtual Threads
DWX23 - Revolutionize Java DB AppDev with Reactive Streams and Virtual Threads
Juarez Junior
 
Cloud Conference Day - Revolutionize Java Database App Development with React...
Cloud Conference Day - Revolutionize Java Database App Development with React...
Juarez Junior
 
CloudTalks - Revolutionize Java DB AppDev with Reactive Streams and Virtual T...
CloudTalks - Revolutionize Java DB AppDev with Reactive Streams and Virtual T...
Juarez Junior
 
jPrime 2023 - Revolutionize Java DB AppDev with Reactive Streams and Virtual ...
jPrime 2023 - Revolutionize Java DB AppDev with Reactive Streams and Virtual ...
Juarez Junior
 
DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...
DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...
Juarez Junior
 
BarcelonaJUG - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, ...
BarcelonaJUG - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, ...
Juarez Junior
 
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...
Juarez Junior
 
DWX23 - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and STO...
DWX23 - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and STO...
Juarez Junior
 
CloudLand - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and...
CloudLand - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and...
Juarez Junior
 
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...
Juarez Junior
 
Oracle CloudWorld 2023 - A High-Speed Data Ingestion Service in Java Using MQ...
Oracle CloudWorld 2023 - A High-Speed Data Ingestion Service in Java Using MQ...
Juarez Junior
 
Quarkus Club_Java Virtual Threads & Pipelined Database Operations
Quarkus Club_Java Virtual Threads & Pipelined Database Operations
Juarez Junior
 
OSN-Blazingly Fast GenAI App Development With Java and Spring AI
OSN-Blazingly Fast GenAI App Development With Java and Spring AI
Juarez Junior
 
DSS_ML_Creating GenAI Apps in Java with SD4J and the ONNX Runtime
DSS_ML_Creating GenAI Apps in Java with SD4J and the ONNX Runtime
Juarez Junior
 
DeveloperWeek Latin America 2023 - A High-Speed Data Ingestion Service in Jav...
DeveloperWeek Latin America 2023 - A High-Speed Data Ingestion Service in Jav...
Juarez Junior
 
Creating GenAI Apps in Java with SD4J and the ONNX Runtime - MiTechCon - Mic...
Creating GenAI Apps in Java with SD4J and the ONNX Runtime - MiTechCon - Mic...
Juarez Junior
 
Server Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David Delabassee
JAXLondon2014
 
DSS_A Solid Foundation for GenAI Apps - Exploring Architectural Blueprints fo...
DSS_A Solid Foundation for GenAI Apps - Exploring Architectural Blueprints fo...
Juarez Junior
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth Slides
Edward Burns
 
Rollin onj Rubyv3
Rollin onj Rubyv3
Oracle
 
TDC Connections 2023 - A High-Speed Data Ingestion Service in Java Using MQTT...
TDC Connections 2023 - A High-Speed Data Ingestion Service in Java Using MQTT...
Juarez Junior
 
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...
Juarez Junior
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDK
Wolfgang Weigend
 
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Codemotion Tel Aviv
 
WeAreDevelopers Berlin - Blazingly Fast GenAI App Development With Java and S...
WeAreDevelopers Berlin - Blazingly Fast GenAI App Development With Java and S...
Juarez Junior
 
WeAreDevelopers Berlin - LangChain4J - A Guide for Impatient Developers
WeAreDevelopers Berlin - LangChain4J - A Guide for Impatient Developers
Juarez Junior
 

More Related Content

Similar to Andersen_Revolutionize Java DB AppDev with Reactive Streams and Virtual Threads.pdf (20)

DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...
DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...
Juarez Junior
 
BarcelonaJUG - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, ...
BarcelonaJUG - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, ...
Juarez Junior
 
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...
Juarez Junior
 
DWX23 - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and STO...
DWX23 - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and STO...
Juarez Junior
 
CloudLand - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and...
CloudLand - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and...
Juarez Junior
 
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...
Juarez Junior
 
Oracle CloudWorld 2023 - A High-Speed Data Ingestion Service in Java Using MQ...
Oracle CloudWorld 2023 - A High-Speed Data Ingestion Service in Java Using MQ...
Juarez Junior
 
Quarkus Club_Java Virtual Threads & Pipelined Database Operations
Quarkus Club_Java Virtual Threads & Pipelined Database Operations
Juarez Junior
 
OSN-Blazingly Fast GenAI App Development With Java and Spring AI
OSN-Blazingly Fast GenAI App Development With Java and Spring AI
Juarez Junior
 
DSS_ML_Creating GenAI Apps in Java with SD4J and the ONNX Runtime
DSS_ML_Creating GenAI Apps in Java with SD4J and the ONNX Runtime
Juarez Junior
 
DeveloperWeek Latin America 2023 - A High-Speed Data Ingestion Service in Jav...
DeveloperWeek Latin America 2023 - A High-Speed Data Ingestion Service in Jav...
Juarez Junior
 
Creating GenAI Apps in Java with SD4J and the ONNX Runtime - MiTechCon - Mic...
Creating GenAI Apps in Java with SD4J and the ONNX Runtime - MiTechCon - Mic...
Juarez Junior
 
Server Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David Delabassee
JAXLondon2014
 
DSS_A Solid Foundation for GenAI Apps - Exploring Architectural Blueprints fo...
DSS_A Solid Foundation for GenAI Apps - Exploring Architectural Blueprints fo...
Juarez Junior
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth Slides
Edward Burns
 
Rollin onj Rubyv3
Rollin onj Rubyv3
Oracle
 
TDC Connections 2023 - A High-Speed Data Ingestion Service in Java Using MQTT...
TDC Connections 2023 - A High-Speed Data Ingestion Service in Java Using MQTT...
Juarez Junior
 
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...
Juarez Junior
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDK
Wolfgang Weigend
 
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Codemotion Tel Aviv
 
DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...
DeveloperWeek Europe 2023 - Revolutionize Java DB AppDev with Reactive Stream...
Juarez Junior
 
BarcelonaJUG - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, ...
BarcelonaJUG - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, ...
Juarez Junior
 
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...
Juarez Junior
 
DWX23 - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and STO...
DWX23 - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and STO...
Juarez Junior
 
CloudLand - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and...
CloudLand - A High-Speed Data Ingestion Service in Java Using MQTT, AMQP, and...
Juarez Junior
 
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...
TDC Connections 2023 - Revolutionize Java DB AppDev with Reactive Streams and...
Juarez Junior
 
Oracle CloudWorld 2023 - A High-Speed Data Ingestion Service in Java Using MQ...
Oracle CloudWorld 2023 - A High-Speed Data Ingestion Service in Java Using MQ...
Juarez Junior
 
Quarkus Club_Java Virtual Threads & Pipelined Database Operations
Quarkus Club_Java Virtual Threads & Pipelined Database Operations
Juarez Junior
 
OSN-Blazingly Fast GenAI App Development With Java and Spring AI
OSN-Blazingly Fast GenAI App Development With Java and Spring AI
Juarez Junior
 
DSS_ML_Creating GenAI Apps in Java with SD4J and the ONNX Runtime
DSS_ML_Creating GenAI Apps in Java with SD4J and the ONNX Runtime
Juarez Junior
 
DeveloperWeek Latin America 2023 - A High-Speed Data Ingestion Service in Jav...
DeveloperWeek Latin America 2023 - A High-Speed Data Ingestion Service in Jav...
Juarez Junior
 
Creating GenAI Apps in Java with SD4J and the ONNX Runtime - MiTechCon - Mic...
Creating GenAI Apps in Java with SD4J and the ONNX Runtime - MiTechCon - Mic...
Juarez Junior
 
Server Side JavaScript on the Java Platform - David Delabassee
Server Side JavaScript on the Java Platform - David Delabassee
JAXLondon2014
 
DSS_A Solid Foundation for GenAI Apps - Exploring Architectural Blueprints fo...
DSS_A Solid Foundation for GenAI Apps - Exploring Architectural Blueprints fo...
Juarez Junior
 
JavaOne 2014 Java EE 8 Booth Slides
JavaOne 2014 Java EE 8 Booth Slides
Edward Burns
 
Rollin onj Rubyv3
Rollin onj Rubyv3
Oracle
 
TDC Connections 2023 - A High-Speed Data Ingestion Service in Java Using MQTT...
TDC Connections 2023 - A High-Speed Data Ingestion Service in Java Using MQTT...
Juarez Junior
 
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...
Melee Numerique 2022 - Revolutionize Java DB App Dev with Reactive Streams an...
Juarez Junior
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDK
Wolfgang Weigend
 
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Pushing JavaEE outside of the enterprise: Home Automation & IoT - David Delab...
Codemotion Tel Aviv
 

More from Juarez Junior (20)

WeAreDevelopers Berlin - Blazingly Fast GenAI App Development With Java and S...
WeAreDevelopers Berlin - Blazingly Fast GenAI App Development With Java and S...
Juarez Junior
 
WeAreDevelopers Berlin - LangChain4J - A Guide for Impatient Developers
WeAreDevelopers Berlin - LangChain4J - A Guide for Impatient Developers
Juarez Junior
 
Build Stuff Lithuania - Blazingly Fast GenAI App Development With Java and Sp...
Build Stuff Lithuania - Blazingly Fast GenAI App Development With Java and Sp...
Juarez Junior
 
DUBJUG-Simplifying Data Access with Jakarta Data for Domain-Driven Design
DUBJUG-Simplifying Data Access with Jakarta Data for Domain-Driven Design
Juarez Junior
 
Cloud Lunch and Learn -Microsoft Semantic Kernel for Java
Cloud Lunch and Learn -Microsoft Semantic Kernel for Java
Juarez Junior
 
Compass AI Budapest -The Trinity in GenAI - Spring AI, LangChain4J and OpenAI
Compass AI Budapest -The Trinity in GenAI - Spring AI, LangChain4J and OpenAI
Juarez Junior
 
GSAS - Global Software Architecture Summit - GenAI-Architectural-Blueprints
GSAS - Global Software Architecture Summit - GenAI-Architectural-Blueprints
Juarez Junior
 
BaselOne_Langchain4J - A Guide for Impatient Developers
BaselOne_Langchain4J - A Guide for Impatient Developers
Juarez Junior
 
DeveloperWeek USA - A Solid Foundation for GenAI Apps - Exploring Architectur...
DeveloperWeek USA - A Solid Foundation for GenAI Apps - Exploring Architectur...
Juarez Junior
 
I Love Tech Romania - Blazingly Fast GenAI App Development With Java and Spri...
I Love Tech Romania - Blazingly Fast GenAI App Development With Java and Spri...
Juarez Junior
 
I Love Tech Romania - The Trinity in GenAI - Spring AI, LangChain4J and OpenAI
I Love Tech Romania - The Trinity in GenAI - Spring AI, LangChain4J and OpenAI
Juarez Junior
 
DUBJUG_Blazingly Fast GenAI App Development With Java and Spring AI.pdf
DUBJUG_Blazingly Fast GenAI App Development With Java and Spring AI.pdf
Juarez Junior
 
DUBJUG_Creating GenAI Apps in Java with SD4J and the ONNX Runtime
DUBJUG_Creating GenAI Apps in Java with SD4J and the ONNX Runtime
Juarez Junior
 
I Love Tech Romania - A High-Speed Data Ingestion Microservice in Java Using ...
I Love Tech Romania - A High-Speed Data Ingestion Microservice in Java Using ...
Juarez Junior
 
DevTalks Cluj Romania - A Solid Foundation for GenAI Apps.pdf
DevTalks Cluj Romania - A Solid Foundation for GenAI Apps.pdf
Juarez Junior
 
Quarkus Club_Revolutionize Java Database App Development with Reactive Stream...
Quarkus Club_Revolutionize Java Database App Development with Reactive Stream...
Juarez Junior
 
TDC - The Developers Conference - The Trinity in GenAI - Spring AI, LangChain...
TDC - The Developers Conference - The Trinity in GenAI - Spring AI, LangChain...
Juarez Junior
 
TDC - The Developers Conference - Creating GenAI Apps in Java with SD4J and t...
TDC - The Developers Conference - Creating GenAI Apps in Java with SD4J and t...
Juarez Junior
 
TDC - The Developers Conference - An Introduction to Machine Learning in Java...
TDC - The Developers Conference - An Introduction to Machine Learning in Java...
Juarez Junior
 
SouJava - Blazingly Fast GenAI App Development With Java and Spring AI
SouJava - Blazingly Fast GenAI App Development With Java and Spring AI
Juarez Junior
 
WeAreDevelopers Berlin - Blazingly Fast GenAI App Development With Java and S...
WeAreDevelopers Berlin - Blazingly Fast GenAI App Development With Java and S...
Juarez Junior
 
WeAreDevelopers Berlin - LangChain4J - A Guide for Impatient Developers
WeAreDevelopers Berlin - LangChain4J - A Guide for Impatient Developers
Juarez Junior
 
Build Stuff Lithuania - Blazingly Fast GenAI App Development With Java and Sp...
Build Stuff Lithuania - Blazingly Fast GenAI App Development With Java and Sp...
Juarez Junior
 
DUBJUG-Simplifying Data Access with Jakarta Data for Domain-Driven Design
DUBJUG-Simplifying Data Access with Jakarta Data for Domain-Driven Design
Juarez Junior
 
Cloud Lunch and Learn -Microsoft Semantic Kernel for Java
Cloud Lunch and Learn -Microsoft Semantic Kernel for Java
Juarez Junior
 
Compass AI Budapest -The Trinity in GenAI - Spring AI, LangChain4J and OpenAI
Compass AI Budapest -The Trinity in GenAI - Spring AI, LangChain4J and OpenAI
Juarez Junior
 
GSAS - Global Software Architecture Summit - GenAI-Architectural-Blueprints
GSAS - Global Software Architecture Summit - GenAI-Architectural-Blueprints
Juarez Junior
 
BaselOne_Langchain4J - A Guide for Impatient Developers
BaselOne_Langchain4J - A Guide for Impatient Developers
Juarez Junior
 
DeveloperWeek USA - A Solid Foundation for GenAI Apps - Exploring Architectur...
DeveloperWeek USA - A Solid Foundation for GenAI Apps - Exploring Architectur...
Juarez Junior
 
I Love Tech Romania - Blazingly Fast GenAI App Development With Java and Spri...
I Love Tech Romania - Blazingly Fast GenAI App Development With Java and Spri...
Juarez Junior
 
I Love Tech Romania - The Trinity in GenAI - Spring AI, LangChain4J and OpenAI
I Love Tech Romania - The Trinity in GenAI - Spring AI, LangChain4J and OpenAI
Juarez Junior
 
DUBJUG_Blazingly Fast GenAI App Development With Java and Spring AI.pdf
DUBJUG_Blazingly Fast GenAI App Development With Java and Spring AI.pdf
Juarez Junior
 
DUBJUG_Creating GenAI Apps in Java with SD4J and the ONNX Runtime
DUBJUG_Creating GenAI Apps in Java with SD4J and the ONNX Runtime
Juarez Junior
 
I Love Tech Romania - A High-Speed Data Ingestion Microservice in Java Using ...
I Love Tech Romania - A High-Speed Data Ingestion Microservice in Java Using ...
Juarez Junior
 
DevTalks Cluj Romania - A Solid Foundation for GenAI Apps.pdf
DevTalks Cluj Romania - A Solid Foundation for GenAI Apps.pdf
Juarez Junior
 
Quarkus Club_Revolutionize Java Database App Development with Reactive Stream...
Quarkus Club_Revolutionize Java Database App Development with Reactive Stream...
Juarez Junior
 
TDC - The Developers Conference - The Trinity in GenAI - Spring AI, LangChain...
TDC - The Developers Conference - The Trinity in GenAI - Spring AI, LangChain...
Juarez Junior
 
TDC - The Developers Conference - Creating GenAI Apps in Java with SD4J and t...
TDC - The Developers Conference - Creating GenAI Apps in Java with SD4J and t...
Juarez Junior
 
TDC - The Developers Conference - An Introduction to Machine Learning in Java...
TDC - The Developers Conference - An Introduction to Machine Learning in Java...
Juarez Junior
 
SouJava - Blazingly Fast GenAI App Development With Java and Spring AI
SouJava - Blazingly Fast GenAI App Development With Java and Spring AI
Juarez Junior
 
Ad

Recently uploaded (20)

Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
Automated Testing and Safety Analysis of Deep Neural Networks
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
 
From Data Preparation to Inference: How Alluxio Speeds Up AI
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
Decipher SEO Solutions for your startup needs.
Decipher SEO Solutions for your startup needs.
mathai2
 
declaration of Variables and constants.pptx
declaration of Variables and constants.pptx
meemee7378
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
Jamie Coleman
 
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
2nd Sight Lab
 
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
Streamlining CI/CD with FME Flow: A Practical Guide
Streamlining CI/CD with FME Flow: A Practical Guide
Safe Software
 
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Folding Cheat Sheet # 9 - List Unfolding 𝑢𝑛𝑓𝑜𝑙𝑑 as the Computational Dual of ...
Philip Schwarz
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
CodeCleaner: Mitigating Data Contamination for LLM Benchmarking
arabelatso
 
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
IDM Crack with Internet Download Manager 6.42 Build 41 [Latest 2025]
pcprocore
 
Azure AI Foundry: The AI app and agent factory
Azure AI Foundry: The AI app and agent factory
Maxim Salnikov
 
Automated Testing and Safety Analysis of Deep Neural Networks
Automated Testing and Safety Analysis of Deep Neural Networks
Lionel Briand
 
Advance Doctor Appointment Booking App With Online Payment
Advance Doctor Appointment Booking App With Online Payment
AxisTechnolabs
 
Heat Treatment Process Automation in India
Heat Treatment Process Automation in India
Reckers Mechatronics
 
Canva Pro Crack Free Download 2025-FREE LATEST
Canva Pro Crack Free Download 2025-FREE LATEST
grete1122g
 
HYBRIDIZATION OF ALKANES AND ALKENES ...
HYBRIDIZATION OF ALKANES AND ALKENES ...
karishmaduhijod1
 
From Data Preparation to Inference: How Alluxio Speeds Up AI
From Data Preparation to Inference: How Alluxio Speeds Up AI
Alluxio, Inc.
 
Complete WordPress Programming Guidance Book
Complete WordPress Programming Guidance Book
Shabista Imam
 
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Test Case Design Techniques – Practical Examples & Best Practices in Software...
Muhammad Fahad Bashir
 
Decipher SEO Solutions for your startup needs.
Decipher SEO Solutions for your startup needs.
mathai2
 
declaration of Variables and constants.pptx
declaration of Variables and constants.pptx
meemee7378
 
Best Practice for LLM Serving in the Cloud
Best Practice for LLM Serving in the Cloud
Alluxio, Inc.
 
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
From Code to Commerce, a Backend Java Developer's Galactic Journey into Ecomm...
Jamie Coleman
 
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
Threat Modeling a Batch Job Framework - Teri Radichel - AWS re:Inforce 2025
2nd Sight Lab
 
How Automation in Claims Handling Streamlined Operations
How Automation in Claims Handling Streamlined Operations
Insurance Tech Services
 
Ad

Andersen_Revolutionize Java DB AppDev with Reactive Streams and Virtual Threads.pdf

  • 1. Revolutionize Java Database Application Development with Reactive Streams and Virtual Threads Andersen Lab - Poland Juarez Barbosa Junior @juarezjunior Senior Principal Java Developer Evangelist ORACLE Copyright © 2024, Oracle and/or its affiliates
  • 2. Juarez Barbosa Junior Senior Principal Java Developer Evangelist @ Oracle • Coming from Dublin, Ireland • 28 years of experience in SW Engineering & DevRel • Oracle, Microsoft, IBM, Nokia, Unisys, Accenture, startups • Microsoft Azure Developer Relations Lead • IBM Watson Tech Evangelist & Cloud Rockstar • IBM Mobile Tech Evangelist & Global Thought Leader • Nokia Developers Global Champion • Java, Python, Cloud, DevOps, SRE, Cloud-native, IoT, AI, Blockchain, Rust • Speaker at conferences • Oracle CloudWorld, Oracle Code, Microsoft Ignite & TechX, jPrime, JCON, DevConf.cz, GeeCon, DevOpsDays, DeveloperWeek, DevOps Institute, CloudLand, DWX, The Developer’s Conference (TDC), Sec4Dev, JSNation, NodeConf, Conf42, Shift Conf, Global Azure, Open-Source Lisbon, CodeFrenzy, Mêlée Numérique, React Summit, Test.js Summit, Porto TechHub Conf, Pyjamas, MiTechCon, Data Science Summit, OpenSourceNorth, WeAreDevelopers, Global Software Architecture Summit, JavaCro, JUGs, OUGs, GDGs, meetups, hackathons, and customer engagements. @juarezjunior @juarezjunior
  • 3. Agenda • Java App Dev with the Oracle Database • Oracle JDBC - Support for the Latest Java Versions • Overview of Oracle DB Access with Java • Oracle JDBC – Sync and Async • Classic Java Platform Threads • Project Loom – Virtual Threads • Virtual Threads - JEPs 425, 436, 444 • Demo # 1: Virtual vs Platform Threads • Reactive JDBC - Synchronous vs Asynchronous JDBC • Reactive Streams Ingestion (RSI) • Demo # 2: Reactive Streams Ingestion (RSI) • From Sync to Reactive JDBC: Oracle R2DBC • Demo # 3: Oracle R2DBC with Project Reactor • Live Labs/Free Oracle Cloud Account/Oracle ACE Program Copyright © 2024, Oracle and/or its affiliates
  • 4. Java App Dev with Oracle Database Copyright © 2024, Oracle and/or its affiliates
  • 5. Overview of Oracle DB Access with Java Copyright © 2024, Oracle and/or its affiliates
  • 6. Copyright © 2024, Oracle and/or its affiliates Oracle JDBC - Support for the Latest Java Versions • Java 11 - native support, compiled with it • Java 17 - certified • JDBC Standards - 4.2 and 4.3 • GraalVM - native image instrumentation • Reactive Streams - Java Flow API support • Project Loom - Virtual Threads support • Data access is crucial in mission-critical apps
  • 7. Oracle JDBC – Async and Sync • Project Loom - Virtual Threads • Synchronous database access with lightweight threads • Standard JDBC + Virtual Threads • Client application call stack may use blocking, synchronous code • Libraries must be compatible with Virtual Threads • Oracle instrumented the Oracle JDBC driver to support Virtual Threads • Reactive Programming • Asynchronous database access with non-blocking network I/O • Oracle Reactive Streams Ingestion + Oracle R2DBC + Oracle JDBC Reactive Extensions (Flow) • Libraries are available: Reactor, RxJava, Akka, Vert.x Copyright © 2024, Oracle and/or its affiliates
  • 8. Classic Java Platform Threads • Database access with blocking threads • A JDBC call blocks a thread for 100s of milliseconds (thread-per-request style) • Thread count increases linearly with the number of JDBC calls • Performance degrades as the number of threads increases • 1 MB of stack memory per thread typically • Scheduling many platform threads is expensive • Preemptive scheduling vs time-slicing Copyright © 2024, Oracle and/or its affiliates
  • 9. Virtual Threads - JEPs 425, 436, 444 • Virtual Threads – JEPs (JDK Enhancement Proposals) • Lightweight (user mode) threads that dramatically reduce the effort of writing, maintaining, and observing high-throughput concurrent applications • Enable applications written in the simple thread-per-request style to scale with near- optimal hardware utilization • Enable easy troubleshooting, debugging, and profiling of virtual threads with existing JDK tools • Do not remove the traditional implementation of threads • Do not alter the basic concurrency model of Java • Enable existing code that uses Java threads (java.lang.Thread) to adopt virtual threads with minimal change Copyright © 2024, Oracle and/or its affiliates
  • 10. Virtual Threads - JEPs 425, 436, 444 • Virtual Threads – JEPs (JDK Enhancement Proposals) • Virtual threads typically employ a small set of platform threads used as carrier threads • Code executing in a virtual thread is not aware of the underlying carrier thread • The currentThread() method will always return the Thread object for the virtual thread • Virtual threads do not have a thread name by default. The getName() method returns the empty string if a thread name is not set • Virtual threads have a fixed thread priority that cannot be changed • Virtual threads are daemon threads so do not prevent the shutdown sequence from beginning (low-priority ones). Copyright © 2024, Oracle and/or its affiliates
  • 11. Virtual Threads - JEPs 425, 436, 444 • JDK Enhancement Proposals • JEP 425: Virtual Threads (Preview) • JEP 436: Virtual Threads (Second Preview) • JEP 444: Virtual Threads • java.lang.Thread • final Boolean - isVirtual() • static Thread.Builder.OfVirtual - ofVirtual() • static Thread.Builder.OfPlatform - ofPlatform() • static Thread - startVirtualThread(Runnable task) • java.lang.Thread.Builder • java.util.concurrent.Executors • static ExecutorService - newVirtualThreadPerTaskExecutor() Copyright © 2024, Oracle and/or its affiliates
  • 12. Virtual Threads - JEPs 425, 436, 444 • java.lang.Thread.Builder • Thread defines a Thread.Builder API for creating and starting both platform and virtual threads. The following are examples that use the builder: Copyright © 2024, Oracle and/or its affiliates
  • 13. Copyright © 2022, Oracle and/or its affiliates Demo # 1: Virtual vs Platform Threads ⚫ Virtual Threads vs Platform Threads ⚫ JEP 425 Virtual Threads (Preview) ⚫ JEP 436 (Second Preview) ⚫ JEP 444 (JDK 21) ⚫ Runs on Java 19, 20, 21 ⚫ javac --release 19 --enable-preview ⚫ java --enable-preview ⚫ Oracle JDBC Driver instrumented to support Virtual Threads ⚫ Verifiable comparison of OS/HW resources consumption (Platform Threads x Virtual Threads)
  • 14. Copyright © 2024, Oracle and/or its affiliates Reactive JDBC - Sync vs Async JDBC Setup Blocking Handle Result Setup Non-Blocking Handle Result Synchronous JDBC Setup Blocking Handle Result Setup Non-Blocking Handle Result Setup Non-Blocking Handle Result Reactive JDBC Database Setup Blocking Handle Result Database
  • 15. Copyright © 2022, Oracle and/or its affiliates Reactive Streams Ingestion (RSI) ⚫ Java Library for Reactive Streams Ingestion ⚫ Streaming capability: Ingest data in an unblocking, and reactive way from a large group of clients ⚫ Group records through RAC (Real App Clusters), and Shard affinity using native UCP (Universal Connection Pool) ⚫ Optimize CPU allocation while decoupling record Processing from I/O ⚫ Fastest insert method for the Oracle Database through Direct Path Insert, bypassing SQL and writing directly into the DB files
  • 16. Copyright © 2024, Oracle and/or its affiliates Demo # 2: Reactive Streams Ingestion (RSI) Container Pipelines, Jenkins, etc. Build Test Push Push Docker images to Registry Cloud Infrastructur e Registry Container Engine for Kubernetes Pull images from Registry Deploy images to production Kubernetes worker nodes Containers running microservices deployed over Kubernetes ORACLE CLOUD INFRASTRUCTURE ATP, ADW, ATP-D, AFDW-D Memoptimized Rowstore RSI Runtime: Non- blocking, optimized library for streaming data through Direct Path, Shard & RAC/FAN support. HTTP / REST Engine over Helidon Define build for CI/CD toolchain gRPC / AMQP / MQTT Engines Microservices Files / Logs IoT Devices / Apps cv MQTT gRPC AMQP HTTP / REST JDBC Direct Path INSERT Record Streaming over multiple protocols.
  • 17. Copyright © 2024, Oracle and/or its affiliates Demo #2: RSI - Architecture
  • 18. Copyright © 2024, Oracle and/or its affiliates Demo #2: RSI - Project Structure
  • 19. From Sync to Reactive JDBC: Oracle R2DBC • Oracle Reactive Relational Database Connectivity (R2DBC) • Oracle R2DBC Driver is a Java library that supports reactive programming with the Oracle Database • It implements the R2DBC Service Provider Interface (SPI) as specified by the Reactive Relational Database Connectivity (R2DBC) spec • The R2DBC SPI exposes Reactive Streams as an abstraction for remote database operations • The sample code uses Project Reactor. It could use RxJava, Akka, or any Reactive Streams library • Runs on Java 11+ • Oracle RDBC 1.1.1 (2023), Apache v2.0, OSS Copyright © 2024, Oracle and/or its affiliates R2DBC – Reactive Relational DB Connectivity
  • 20. Copyright © 2024, Oracle and/or its affiliates Demo # 3: Oracle R2DBC static String queryJdbc(java.sql.Connection connection) throws SQLException { try (java.sql.Statement statement = connection.createStatement()) { ResultSet resultSet = statement.executeQuery("SELECT * FROM CUSTOMERS"); if (resultSet.next()) return resultSet.getString(1); else throw new NoSuchElementException("Query returned zero rows"); } } static Publisher<String> queryR2dbc(io.r2dbc.spi.Connection connection) { return Flux.from(connection.createStatement( "SELECT * FROM CUSTOMERS") .execute()) .flatMap(result -> result.map(row -> row.get(0, String.class))) .switchIfEmpty(Flux.error( new NoSuchElementException("Query returned zero rows"))); }
  • 21. Virtual Threads or Reactive? • Oracle JDBC supports both! • Want Virtual Threads? • The Oracle JDBC driver has been “Virtual Thread Compatible” since 21c • Want Reactive? • Oracle R2DBC 1.1.1 is available now • Consume Flow interfaces directly from Oracle JDBC’s Reactive Extensions Copyright © 2024, Oracle and/or its affiliates
  • 22. Virtual Threads or Reactive? • Benefits of Virtual Threads: • Easier to read and write • Easier to debug • Integration with JDK tools • Do not alter the basic concurrency model of Java • Now available in JDK 21 • Limitations of Virtual Threads: • Some libraries/frameworks are not compatible yet Copyright © 2024, Oracle and/or its affiliates Benefits of Reactive: • Reactive Libraries (Reactor, RxJava, Akka, Vert.x) • Stream-like API with a functional style • Low-level concurrency is handled for you (locks, atomics, queues) Limitations of Reactive: • Steep learning curve • Harder to read and write • Harder to debug
  • 23. New | Oracle Database 23ai Next-Generation Converged Database Services Over 300 major new features plus thousands of enhancements Available on OCI and Azure Major focus on • AI for Data features • Developer/Analyst features • Mission-Critical features Addresses data management pain points that have frustrated customers forever Copyright © 2024, Oracle and/or its affiliates
  • 24. Oracle Database 23ai - AI for Data Algorithmic AI AI Vector Search Augmented Generative AI (LLMs) Distributed AI AI Storage AI Developer Tools Copyright © 2024, Oracle and/or its affiliates
  • 25. Oracle Database 23ai - Dev for Data JSON Relational Duality Views Property Graph Views JavaScript Stored Procedures Data Intent Language Lock-free Consistent Updates, Long-running Transactions True Cache Copyright © 2024, Oracle and/or its affiliates
  • 26. Oracle Database 23ai - Mission-Critical Data RAFT Replication for Globally Distributed Database In-Database Firewall Real-Time SQL Plan Management RAC, Exadata, Data Guard Simplicity and Scalability Analytic SQL Simplicity and Scalability Priority Transactions Copyright © 2024, Oracle and/or its affiliates
  • 27. Free | Oracle Database 23ai For Developers Oracle Always Free ADB Available on OCI ADB Free Container Image Available for download Oracle Database Free Available as RPM, Docker Image, VBox VM Copyright © 2024, Oracle and/or its affiliates | Confidential - Internal Very Low Cost Supported Developer Edition of ADB, BaseDB, ExaDB-D, and ExaDB-C@C
  • 28. Copyright © 2024, Oracle and/or its affiliates References • JDK 22 • The Arrival of JDK 22 - https://blogs.oracle.com/java/post/the-arrival-of-java-22 • Project Loom / Virtual Threads • Loom - https://openjdk.org/projects/loom/ • JEP 444 Virtual Threads - https://openjdk.org/jeps/444 • Introduction to Oracle JDBC Driver Support for Virtual Threads - https://bit.ly/3UlNJWP • Reactive Streams Ingestion Library • Getting Started with the Java library for Reactive Streams Ingestion (RSI) - https://bit.ly/3rEiRnC • High-throughput stream processing with the Java Library for Reactive Streams Ingestion (RSI), Virtual Threads, and the Oracle ATP Database - https://bit.ly/3rATCTd • A High-Speed Data Ingestion Solution in Java Using MQTT, AMQP, and STOMP - https://medium.com/oracledevs/a-high-speed-data-ingestion-microservice-in-java-using-mqtt- amqp-and-stomp-135724223ae1 • R2DBC • Oracle R2DBC Driver – https://github.com/oracle/oracle-r2dbc • What’s in Oracle Database 23ai for Java Developers? • https://www.oracle.com/a/tech/docs/database/whats-in-oracledb23ai-for-java-developers.pdf • Develop Java applications with Oracle Database • JDBC – https://www.oracle.com/database/technologies/appdev/jdbc.html
  • 31. Oracle LiveLabs Showcasing how Oracle’s solutions can solve your business problems 500+ free workshops, available or in development 3.5 million people have already visited LiveLabs developer.oracle.com/livelabs learn something new …at your pace! 600+ events run using LiveLabs workshops
  • 32. 3 membership tiers Connect: @oracleace facebook.com/OracleACEs [email protected] 500+ technical experts & community leaders helping peers globally The Oracle ACE Program recognizes & rewards individuals for their technical & community contributions to the Oracle community Nominate yourself or a candidate: ace.oracle.com/nominate Learn more - ace.oracle.com blogs.oracle.com/ace
  • 33. Create your FREE Cloud Account • Go to https://signup.cloud.oracle.com/ Copyright © 2024, Oracle and/or its affiliates