SlideShare a Scribd company logo
1 of 66
RESTful Web Services for
Oracle, POUG Edition
ORDS Product Manager
https://www.thatjeffsmith.com
@thatjeffsmith
Jeff Smith 🍻
• Presented originally in 2019 for POUG in Wroclav, Poland
• Pints with Oracle User Group
• Combines two of my favorite things, ORDS & Beer (beeords!)
• Please drink responsibly
• I have non-alcoholic slides/content on my blog
About these slides…
Jeff annoys people on twitter @thatjeffsmith
• product manager/storyteller
• I help/bother people online
• Working with Oracle Database since 1999
• Helping build database tools since 2001
• I ‘manage’ these products:
whoami
Jeff annoys people on twitter @thatjeffsmith
Today’s Agenda
Jeff annoys people on twitter @thatjeffsmith
• Introduction,Terms, & Definitions
• ORDS Architecture
• Building RESTfulWeb Services
Oracle
REST
Data
Services
Included for free with your Oracle Database!!!
oracle.com/rest
• REpresentational State Transfer
• Architectural Style for networked applications
• Communicates via HTTP, but..
• Using HTTP doesn’t magically make yourAPIs RESTful
Terms: REST
Jeff annoys people on twitter @thatjeffsmith
• Model things, not actions
• UseVERBS to interact,GET, PUT, POST, DELETE
• Stateless, so be sure to use LINKs to guide your users
POST beers/ =>Adds beer, responds w/link
GET beers/:id =>
Jeff annoys people on twitter @thatjeffsmith
RESTful Architecture
🍻
• Jay-Sun
• Not just for js!
• Skinnier than XML
• Flexible
• Link-friendly
Terms: {JSON}
Jeff annoys people on twitter @thatjeffsmith
{JSON} BonusTip!
Our tools make it easy to
get your database data in
JSON format, pretty or RAW
Jeff annoys people on twitter @thatjeffsmith
…
ORDS Features and Architecture
Jeff annoys people on twitter @thatjeffsmith
• How are RESTfulWeb Services defined
• How is ORDS deployed
• Automatic
• Your Code
• SQL on the fly
• ManagementAPIs
• SQLDevWeb
Delivery Options
Jeff annoys people on twitter @thatjeffsmith
GET https://host/ords/hr/beers/1 SELECT *
FROM UNTAPPD
WHERE ID = 1
HTTP/1.1 200 OK
{ “id": 100,
“name": “Bud Lite“,
“score": “0",
“comments": “yuck” }
{json}
URI SQL & PLSQL
Marshalls to Database
HTTP Request
HTTP Response Transforms to JSON SQL Result Set / Standard OUT
Oracle REST Data Services
ORDS: HTTP to SQL and back
Jeff annoys people on twitter @thatjeffsmith
• Webserver layout
• Java Servlet
• Tomcat orWLS
ORDS Architecture
Option #1
Tomcat, WLS
ORDS
Apache
Static Files
-HTML, CSS, JS
/ords/…
/db1/hr/emp/
JSON
Binary
HTML
…
HTTP(s)
Results
JDBC
pool1 pool2 pool3
Request
JDBC JDBC
Jeff annoys people on twitter @thatjeffsmith
java –jar ords.war standalone
• Supported for production!
• ORDS is your webserver &
web listener for your
Oracle Databases
ORDS
Static Files
-HTML
, CSS,
JS
/db1/hr/emp/
JSON
Binary
HTML
…
HTTP(s)
Response
JDBC
pool1 pool2 pool3
Request
JDBC JDBC
Jeff annoys people on twitter @thatjeffsmith
ORDS Architecture
Option #2 : Standalone
• JDBC Conn Pools
• 1 Pool Per Database
• ORDS_PUBLIC_USER
• Proxy Connects
Enabled DB Users
ORDS & Database Communication
Jeff annoys people on twitter @thatjeffsmith
• PUT – HTTP Verb
• HTTPS – secure, encrypted version of HTTP (recommended!)
• Server:8080 – network location where ORDS is running
• ords – ords.war, Java servlet
• hr – schema alias, where service is defined
• examples – module, a collection of services
• beers/:id – template, defines the resource
Unwinding an ORDS Request
Jeff annoys people on twitter @thatjeffsmith
PUT https://server:8080/ords/hr/examples/beers/:id
Install & Start
ORDS
REST Enable
Application
SCHEMA
Publish RESTful
Service or REST
Enable object
1 2 3
Getting Started Steps
Jeff annoys people on twitter @thatjeffsmith
Jeff annoys people on twitter @thatjeffsmith
Step 1, Install ORDS
Video: I talk about the process, DO an install, use SQLDevWeb to build
a RESTfulWeb Service
• Services defined in schema
• Services executed as user
Step 2. REST Enable Schema
Jeff annoys people on twitter @thatjeffsmith
Services constrained by Database User:
• AUTO REST
• RESTful Services
Step 3. Define your Service
Jeff annoys people on twitter @thatjeffsmith
What RESTful Services could look like…
Jeff annoys people on twitter @thatjeffsmith
Twoje zdrowie! Or Cheers!
• UNTAPPD: my personal beer diary
• YES, these are MY pictures and MY comments
• Examples will show building REST APIs for my diary
🍻
Jeff annoys people on twitter @thatjeffsmith
Example – Beers w/pictures
SELECT beer_name,
brewery_name,
created_at,
photo_url "$pics",
comments
FROM untappd
WHERE photo_url IS NOT NULL
ORDER BY checkin_id DESC
Jeff annoys people on twitter @thatjeffsmith
GET all beers, with links to pictures
Example – Using Query String Parameters
?q={"beer_type":{"$like":"Stout%25"}}
Jeff annoys people on twitter @thatjeffsmith
SAME SQL, but…
ORDS injects the WHERE clause
for us.
No additional coding required!
Example: More Query String Parameters
?q={"beer_type":{"$like":"%25Tripel%25"}}
Jeff annoys people on twitter @thatjeffsmith
Filtering, Sorting and More
ORDS Handles the
SQL for you
Jeff annoys people on twitter @thatjeffsmith
Example: Generating Links
“$alias” => LINK
Jeff annoys people on twitter @thatjeffsmith
Example: Working w/JSON Data in the DB
Jeff annoys people on twitter @thatjeffsmith
BAD 
Escaping JSON 
Jeff annoys people on twitter @thatjeffsmith
Where/how to code your Services
Jeff annoys people on twitter @thatjeffsmith
Oracle SQL Developer
• Full ORDS Integration
• Develop RESTful Services
• REST Enable Objects
• Manage ORDS Roles and
Privileges
• Free! OS X,Windows, or Linux
IDE
Jeff annoys people on twitter @thatjeffsmith
DatabaseActions/SQLDev Web
• ORDS Single Page App
• Develop RESTful Services
• REST Enable Objects
• Manage ORDS Roles and
Privileges, OAuth2 Clients
• Free! Any major browser.
Browser
Jeff annoys people on twitter @thatjeffsmith
CLI & PL/SQL APIs
Jeff annoys people on twitter @thatjeffsmith
SQLcl Anywhere you can run PL/SQL
Or Application Express (APEX)
Jeff annoys people on twitter @thatjeffsmith
APEX is NOT required
Time to start building!
Jeff annoys people on twitter @thatjeffsmith
Home Brewing or Store Bought?
Your Code Someone Else’s
Jeff annoys people on twitter @thatjeffsmith
AUTOREST
• CRUD APIs, no SQL to write
• Single ORDS call to create
• Maintained by ORCL
• Feature Packed
• Optimized
RESTful Services
• You control:
• Inputs, outputs, error handling,
response codes, formatting
• Your SQL/PLSQL code
• Easily exported, source
controlled
• Transparent
Choose your own adventure!
Jeff annoys people on twitter @thatjeffsmith
AUTOREST Database Objects
TABLES
VIEWS
PROCEDURES
FUNCTIONS
PACKAGES
Jeff annoys people on twitter @thatjeffsmith
• Auto RESTTable
– Full CRUD API, Data Loading, Metadata (DESC)
• Auto RESTView
– Read interface (GET),Write (PUT+POST+DELETE w/PK onVIEW)
• Auto PL/SQL (RPC)
– POST to execute stored PL/SQL
– We accept {json} in, map to input params, grab output and {json} out
Automatic – ORDS owns the code
Jeff annoys people on twitter @thatjeffsmith
• GET
• PUT
• POST
• DELETE
• DESC
• DOCS
AutoREST Table /ords/hr/beers/
/ords/hr/beers/:PK
Jeff annoys people on twitter @thatjeffsmith
Jeff annoys people on twitter @thatjeffsmith
REST Enabling a TABLE
REST EnabledTABLE Swagger API Doc
• Table Metadata
• SELECT
Query Filtering/Order/ASOF SCN or Timestamp
• INSERT
• UPDATE
• DELETE
• BATCHLOAD
Jeff annoys people on twitter @thatjeffsmith
Jeff annoys people on twitter @thatjeffsmith
Two Quick AUTOREST TABLE Examples
1. GET one or more rows with a query
2. PUT updates to an existing row
• All rows /
• One row /:id – PKValue
– No PK, default to ROWID
– Multi-column PK /x,y,z
• Some rows /?q={json}
SELECT (GET)
Jeff annoys people on twitter @thatjeffsmith
METHOD : PUT /:PK
REQUEST BODY : JSON
RESPONSE: 200 OK
• Location (Header)
• JSON (Body)
UPDATE (PUT) : adding comments
REQUEST BODY
Jeff annoys people on twitter @thatjeffsmith
RESPONSE
Jeff annoys people on twitter @thatjeffsmith
We also support your PL/SQL Code!
1. Instant access to all of your application logic
2. ORDS ‘wrappers’ your existing PL/SQL with HTTPS
• POST /ords/hr/procA
• JSON Responses & Results (OUTs/RETURNs/REFCURSORs)
Accessing your PL/SQL Code, Automatically
Jeff annoys people on twitter @thatjeffsmith
Remote Procedure Call over HTTP (POST)
Jeff annoys people on twitter @thatjeffsmith
Remote Procedure Call over HTTP (POST)
Request
p(arg =>input)
Procedure output formatted {json} – links and all
Jeff annoys people on twitter @thatjeffsmith
RESTful Services, write your own code
Jeff annoys people on twitter @thatjeffsmith
• Modules
• Templates
• Handlers
• SourceTypes
• Base URI
• Default pagination size
• Can be protected by
common privileges
Modules
Jeff annoys people on twitter @thatjeffsmith
/ords/hr/untappd/beers/
/ords/hr/untappd/beers/:id
URI Templates
Jeff annoys people on twitter @thatjeffsmith
Handlers: Mapping Verbs to the SQL/PLSQL
Jeff annoys people on twitter @thatjeffsmith
• Collection Query
– Multiple records/paging
• Collection Query Item
– Single record only/no paging
• Media
– Streams the output directly
• PL/SQL
– Print HTML (HTP.P) or Code the Response
yourself (headers and body)
Source Types - Shapes Responses
Jeff annoys people on twitter @thatjeffsmith
RESTful Service Example #1
• aTABLE
• a RESTfulWebservice…
• …that INSERTs a record
Implementation
• Template => media/
• Handler => POST
• Source => PL/SQL
Jeff annoys people on twitter @thatjeffsmith
INSERT a record w/a BLOB
Jeff annoys people on twitter @thatjeffsmith
• ORDS defines request body & headers w/ :binds
• ORDS defines response body & headers w/ :binds
ORDS makes HTTP & SQL, easy!
INSERT INTO table (blob) VALUES (:body);
:status := 201;
:location := ‘../’ || id;
Jeff annoys people on twitter @thatjeffsmith
• We got the BLOB from the HTTP request via :body
• We got the other columns from HTTP request headers
• We INSERT the record
• We set HTTP LOCATION and STATUS
…in ~3 lines of PL/SQL!!!
What just happened?
Jeff annoys people on twitter @thatjeffsmith
RESTful Service Example #2
• aTABLE
• a RESTfulWebservice…
• …that gives list of links
Implementation
• Template => beers/:style/pics
• Handler => GET
• Source => SQL
Jeff annoys people on twitter @thatjeffsmith
Print a list of Rows w/LINKs to pictures
Jeff annoys people on twitter @thatjeffsmith
• SQL SELECT to get the data
• Predicate value pulled from URI via :type bind
• We told ORDS to generate a link with an “$alias”
What just happened?
Jeff annoys people on twitter @thatjeffsmith
Time to wind things down, Last Call!
Jeff annoys people on twitter @thatjeffsmith
• Source code, CI/CD
• Documentation
• Authorization
Backup/Source Control your REST Code
• GUI
• SQL
• CLI/Liquibase
Generated via:
Jeff annoys people on twitter @thatjeffsmith
Document your APIs with OpenAPI
• GUI
• REST
Generated via:
Jeff annoys people on twitter @thatjeffsmith
• See MY post on OAUTH2 w/ORDS
• SeeTodd’s post on OAUTH2 w/ORDS & Micronaut
Jeff annoys people on twitter @thatjeffsmith
SECURE Your Services
• Slides
• Blogs
• Articles
UKOUG Scene Why REST, andWhat’s in it or Me?
Oracle Magazine AUTO REST & REST Enabled SQL
Other Resources
Jeff annoys people on twitter @thatjeffsmith

More Related Content

What's hot

Oracle SQLcl: Formatting your Query Results
Oracle SQLcl: Formatting your Query ResultsOracle SQLcl: Formatting your Query Results
Oracle SQLcl: Formatting your Query ResultsJeff Smith
 
Oracle SQL Developer Top 10 Tips & Tricks
Oracle SQL Developer Top 10 Tips & TricksOracle SQL Developer Top 10 Tips & Tricks
Oracle SQL Developer Top 10 Tips & TricksJeff Smith
 
Oracle SQL Developer Reports
Oracle SQL Developer ReportsOracle SQL Developer Reports
Oracle SQL Developer ReportsJeff Smith
 
REST Enabling your Oracle Database (2018 Update)
REST Enabling your Oracle Database (2018 Update)REST Enabling your Oracle Database (2018 Update)
REST Enabling your Oracle Database (2018 Update)Jeff Smith
 
SQLcl overview - A new Command Line Interface for Oracle Database
SQLcl overview - A new Command Line Interface for Oracle DatabaseSQLcl overview - A new Command Line Interface for Oracle Database
SQLcl overview - A new Command Line Interface for Oracle DatabaseJeff Smith
 
Oracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesOracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesJeff Smith
 
Oracle SQL Developer Tips & Tricks
Oracle SQL Developer Tips & TricksOracle SQL Developer Tips & Tricks
Oracle SQL Developer Tips & TricksJeff Smith
 
Change Management for Oracle Database with SQLcl
Change Management for Oracle Database with SQLcl Change Management for Oracle Database with SQLcl
Change Management for Oracle Database with SQLcl Jeff Smith
 
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & TricksPennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & TricksJeff Smith
 
REST Enabling Your Oracle Database
REST Enabling Your Oracle DatabaseREST Enabling Your Oracle Database
REST Enabling Your Oracle DatabaseJeff Smith
 
Oracle SQL Developer Tips and Tricks: Data Edition
Oracle SQL Developer Tips and Tricks: Data EditionOracle SQL Developer Tips and Tricks: Data Edition
Oracle SQL Developer Tips and Tricks: Data EditionJeff Smith
 
Oracle Office Hours - Exposing REST services with APEX and ORDS
Oracle Office Hours - Exposing REST services with APEX and ORDSOracle Office Hours - Exposing REST services with APEX and ORDS
Oracle Office Hours - Exposing REST services with APEX and ORDSDoug Gault
 
Debugging PL/SQL from your APEX Applications with Oracle SQL Developer
Debugging PL/SQL from your APEX Applications with Oracle SQL DeveloperDebugging PL/SQL from your APEX Applications with Oracle SQL Developer
Debugging PL/SQL from your APEX Applications with Oracle SQL DeveloperJeff Smith
 
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewOracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewKris Rice
 
ORDS - Oracle REST Data Services
ORDS - Oracle REST Data ServicesORDS - Oracle REST Data Services
ORDS - Oracle REST Data ServicesJustin Michael Raj
 
Oracle SQL Developer for the DBA
Oracle SQL Developer for the DBAOracle SQL Developer for the DBA
Oracle SQL Developer for the DBAJeff Smith
 
Oracle SQL Developer Data Modeler - for SQL Server
Oracle SQL Developer Data Modeler - for SQL ServerOracle SQL Developer Data Modeler - for SQL Server
Oracle SQL Developer Data Modeler - for SQL ServerJeff Smith
 
Oracle SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?Oracle SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?Jeff Smith
 
PLSQL Developer tips and tricks
PLSQL Developer tips and tricksPLSQL Developer tips and tricks
PLSQL Developer tips and tricksPatrick Barel
 

What's hot (20)

Oracle SQLcl: Formatting your Query Results
Oracle SQLcl: Formatting your Query ResultsOracle SQLcl: Formatting your Query Results
Oracle SQLcl: Formatting your Query Results
 
Oracle SQL Developer Top 10 Tips & Tricks
Oracle SQL Developer Top 10 Tips & TricksOracle SQL Developer Top 10 Tips & Tricks
Oracle SQL Developer Top 10 Tips & Tricks
 
Oracle SQL Developer Reports
Oracle SQL Developer ReportsOracle SQL Developer Reports
Oracle SQL Developer Reports
 
REST Enabling your Oracle Database (2018 Update)
REST Enabling your Oracle Database (2018 Update)REST Enabling your Oracle Database (2018 Update)
REST Enabling your Oracle Database (2018 Update)
 
SQLcl overview - A new Command Line Interface for Oracle Database
SQLcl overview - A new Command Line Interface for Oracle DatabaseSQLcl overview - A new Command Line Interface for Oracle Database
SQLcl overview - A new Command Line Interface for Oracle Database
 
Oracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web ServicesOracle REST Data Services: Options for your Web Services
Oracle REST Data Services: Options for your Web Services
 
Oracle SQL Developer Tips & Tricks
Oracle SQL Developer Tips & TricksOracle SQL Developer Tips & Tricks
Oracle SQL Developer Tips & Tricks
 
Change Management for Oracle Database with SQLcl
Change Management for Oracle Database with SQLcl Change Management for Oracle Database with SQLcl
Change Management for Oracle Database with SQLcl
 
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & TricksPennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
Pennsylvania Banner User Group Webinar: Oracle SQL Developer Tips & Tricks
 
REST Enabling Your Oracle Database
REST Enabling Your Oracle DatabaseREST Enabling Your Oracle Database
REST Enabling Your Oracle Database
 
Oracle SQL Developer Tips and Tricks: Data Edition
Oracle SQL Developer Tips and Tricks: Data EditionOracle SQL Developer Tips and Tricks: Data Edition
Oracle SQL Developer Tips and Tricks: Data Edition
 
Oracle Office Hours - Exposing REST services with APEX and ORDS
Oracle Office Hours - Exposing REST services with APEX and ORDSOracle Office Hours - Exposing REST services with APEX and ORDS
Oracle Office Hours - Exposing REST services with APEX and ORDS
 
Debugging PL/SQL from your APEX Applications with Oracle SQL Developer
Debugging PL/SQL from your APEX Applications with Oracle SQL DeveloperDebugging PL/SQL from your APEX Applications with Oracle SQL Developer
Debugging PL/SQL from your APEX Applications with Oracle SQL Developer
 
Oracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ OverviewOracle REST Data Services Best Practices/ Overview
Oracle REST Data Services Best Practices/ Overview
 
ORDS - Oracle REST Data Services
ORDS - Oracle REST Data ServicesORDS - Oracle REST Data Services
ORDS - Oracle REST Data Services
 
Oracle SQL Developer for the DBA
Oracle SQL Developer for the DBAOracle SQL Developer for the DBA
Oracle SQL Developer for the DBA
 
Oracle SQLcl
Oracle SQLcl Oracle SQLcl
Oracle SQLcl
 
Oracle SQL Developer Data Modeler - for SQL Server
Oracle SQL Developer Data Modeler - for SQL ServerOracle SQL Developer Data Modeler - for SQL Server
Oracle SQL Developer Data Modeler - for SQL Server
 
Oracle SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?Oracle SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?
 
PLSQL Developer tips and tricks
PLSQL Developer tips and tricksPLSQL Developer tips and tricks
PLSQL Developer tips and tricks
 

Similar to Oracle REST Data Services: POUG Edition

Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...Reuven Lerner
 
flickr's architecture & php
flickr's architecture & php flickr's architecture & php
flickr's architecture & php coolpics
 
Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011Reuven Lerner
 
Devops kc meetup_5_20_2013
Devops kc meetup_5_20_2013Devops kc meetup_5_20_2013
Devops kc meetup_5_20_2013Aaron Blythe
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swaggerTony Tam
 
NotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for PentestersNotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for PentestersRob Fuller
 
DevOps Columbus Meetup Kickoff - Infrastructure as Code
DevOps Columbus Meetup Kickoff - Infrastructure as CodeDevOps Columbus Meetup Kickoff - Infrastructure as Code
DevOps Columbus Meetup Kickoff - Infrastructure as CodeMichael Ducy
 
Website designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentWebsite designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentCss Founder
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIsmdawaffe
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testingTomas Doran
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testingTomas Doran
 
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQLNoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQLAndrew Morgan
 
pandas.(to/from)_sql is simple but not fast
pandas.(to/from)_sql is simple but not fastpandas.(to/from)_sql is simple but not fast
pandas.(to/from)_sql is simple but not fastUwe Korn
 
Modeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeModeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeDavid Boike
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPressTaylor Lovett
 
Austin Day of Rest - Introduction
Austin Day of Rest - IntroductionAustin Day of Rest - Introduction
Austin Day of Rest - IntroductionHandsOnWP.com
 
Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsDerek Anderson
 
Reviewing RESTful Web Apps
Reviewing RESTful Web AppsReviewing RESTful Web Apps
Reviewing RESTful Web AppsTakuto Wada
 

Similar to Oracle REST Data Services: POUG Edition (20)

Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
Modern Web technologies (and why you should care): Megacomm, Jerusalem, Febru...
 
flickr's architecture & php
flickr's architecture & php flickr's architecture & php
flickr's architecture & php
 
Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011Modern Web Technologies — Jerusalem Web Professionals, January 2011
Modern Web Technologies — Jerusalem Web Professionals, January 2011
 
Devops kc meetup_5_20_2013
Devops kc meetup_5_20_2013Devops kc meetup_5_20_2013
Devops kc meetup_5_20_2013
 
Scaling with swagger
Scaling with swaggerScaling with swagger
Scaling with swagger
 
NotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for PentestersNotaCon 2011 - Networking for Pentesters
NotaCon 2011 - Networking for Pentesters
 
Database story by DevOps
Database story by DevOpsDatabase story by DevOps
Database story by DevOps
 
DevOps Columbus Meetup Kickoff - Infrastructure as Code
DevOps Columbus Meetup Kickoff - Infrastructure as CodeDevOps Columbus Meetup Kickoff - Infrastructure as Code
DevOps Columbus Meetup Kickoff - Infrastructure as Code
 
Website designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopmentWebsite designing company_in_delhi_phpwebdevelopment
Website designing company_in_delhi_phpwebdevelopment
 
WordPress APIs
WordPress APIsWordPress APIs
WordPress APIs
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
 
Webapp security testing
Webapp security testingWebapp security testing
Webapp security testing
 
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQLNoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
NoSQL and SQL - Why Choose? Enjoy the best of both worlds with MySQL
 
OData Services
OData ServicesOData Services
OData Services
 
pandas.(to/from)_sql is simple but not fast
pandas.(to/from)_sql is simple but not fastpandas.(to/from)_sql is simple but not fast
pandas.(to/from)_sql is simple but not fast
 
Modeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught MeModeling Tricks My Relational Database Never Taught Me
Modeling Tricks My Relational Database Never Taught Me
 
JSON REST API for WordPress
JSON REST API for WordPressJSON REST API for WordPress
JSON REST API for WordPress
 
Austin Day of Rest - Introduction
Austin Day of Rest - IntroductionAustin Day of Rest - Introduction
Austin Day of Rest - Introduction
 
Introduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCatsIntroduction to NodeJS with LOLCats
Introduction to NodeJS with LOLCats
 
Reviewing RESTful Web Apps
Reviewing RESTful Web AppsReviewing RESTful Web Apps
Reviewing RESTful Web Apps
 

More from Jeff Smith

Social Media - Why a Database Person Should Care
Social Media  - Why a Database Person Should CareSocial Media  - Why a Database Person Should Care
Social Media - Why a Database Person Should CareJeff Smith
 
All of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperAll of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperJeff Smith
 
If You Oracle Then You Should Twitter Too
If You Oracle Then You Should Twitter TooIf You Oracle Then You Should Twitter Too
If You Oracle Then You Should Twitter TooJeff Smith
 
My Favorite Oracle SQL Developer Data Modeler Features
My Favorite Oracle SQL Developer Data Modeler FeaturesMy Favorite Oracle SQL Developer Data Modeler Features
My Favorite Oracle SQL Developer Data Modeler FeaturesJeff Smith
 
Oracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsOracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsJeff Smith
 
Dimensional modeling in oracle sql developer
Dimensional modeling in oracle sql developerDimensional modeling in oracle sql developer
Dimensional modeling in oracle sql developerJeff Smith
 
Oracle SQL Developer version 4.0 New Features Overview
Oracle SQL Developer version 4.0 New Features OverviewOracle SQL Developer version 4.0 New Features Overview
Oracle SQL Developer version 4.0 New Features OverviewJeff Smith
 

More from Jeff Smith (7)

Social Media - Why a Database Person Should Care
Social Media  - Why a Database Person Should CareSocial Media  - Why a Database Person Should Care
Social Media - Why a Database Person Should Care
 
All of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL DeveloperAll of the Performance Tuning Features in Oracle SQL Developer
All of the Performance Tuning Features in Oracle SQL Developer
 
If You Oracle Then You Should Twitter Too
If You Oracle Then You Should Twitter TooIf You Oracle Then You Should Twitter Too
If You Oracle Then You Should Twitter Too
 
My Favorite Oracle SQL Developer Data Modeler Features
My Favorite Oracle SQL Developer Data Modeler FeaturesMy Favorite Oracle SQL Developer Data Modeler Features
My Favorite Oracle SQL Developer Data Modeler Features
 
Oracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your DesignsOracle SQL Developer Data Modeler - Version Control Your Designs
Oracle SQL Developer Data Modeler - Version Control Your Designs
 
Dimensional modeling in oracle sql developer
Dimensional modeling in oracle sql developerDimensional modeling in oracle sql developer
Dimensional modeling in oracle sql developer
 
Oracle SQL Developer version 4.0 New Features Overview
Oracle SQL Developer version 4.0 New Features OverviewOracle SQL Developer version 4.0 New Features Overview
Oracle SQL Developer version 4.0 New Features Overview
 

Recently uploaded

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Oracle REST Data Services: POUG Edition

  • 1. RESTful Web Services for Oracle, POUG Edition ORDS Product Manager https://www.thatjeffsmith.com @thatjeffsmith Jeff Smith 🍻
  • 2. • Presented originally in 2019 for POUG in Wroclav, Poland • Pints with Oracle User Group • Combines two of my favorite things, ORDS & Beer (beeords!) • Please drink responsibly • I have non-alcoholic slides/content on my blog About these slides… Jeff annoys people on twitter @thatjeffsmith
  • 3. • product manager/storyteller • I help/bother people online • Working with Oracle Database since 1999 • Helping build database tools since 2001 • I ‘manage’ these products: whoami Jeff annoys people on twitter @thatjeffsmith
  • 4. Today’s Agenda Jeff annoys people on twitter @thatjeffsmith • Introduction,Terms, & Definitions • ORDS Architecture • Building RESTfulWeb Services
  • 5. Oracle REST Data Services Included for free with your Oracle Database!!! oracle.com/rest
  • 6. • REpresentational State Transfer • Architectural Style for networked applications • Communicates via HTTP, but.. • Using HTTP doesn’t magically make yourAPIs RESTful Terms: REST Jeff annoys people on twitter @thatjeffsmith
  • 7. • Model things, not actions • UseVERBS to interact,GET, PUT, POST, DELETE • Stateless, so be sure to use LINKs to guide your users POST beers/ =>Adds beer, responds w/link GET beers/:id => Jeff annoys people on twitter @thatjeffsmith RESTful Architecture 🍻
  • 8. • Jay-Sun • Not just for js! • Skinnier than XML • Flexible • Link-friendly Terms: {JSON} Jeff annoys people on twitter @thatjeffsmith
  • 9. {JSON} BonusTip! Our tools make it easy to get your database data in JSON format, pretty or RAW Jeff annoys people on twitter @thatjeffsmith …
  • 10. ORDS Features and Architecture Jeff annoys people on twitter @thatjeffsmith • How are RESTfulWeb Services defined • How is ORDS deployed
  • 11. • Automatic • Your Code • SQL on the fly • ManagementAPIs • SQLDevWeb Delivery Options Jeff annoys people on twitter @thatjeffsmith
  • 12. GET https://host/ords/hr/beers/1 SELECT * FROM UNTAPPD WHERE ID = 1 HTTP/1.1 200 OK { “id": 100, “name": “Bud Lite“, “score": “0", “comments": “yuck” } {json} URI SQL & PLSQL Marshalls to Database HTTP Request HTTP Response Transforms to JSON SQL Result Set / Standard OUT Oracle REST Data Services ORDS: HTTP to SQL and back Jeff annoys people on twitter @thatjeffsmith
  • 13. • Webserver layout • Java Servlet • Tomcat orWLS ORDS Architecture Option #1 Tomcat, WLS ORDS Apache Static Files -HTML, CSS, JS /ords/… /db1/hr/emp/ JSON Binary HTML … HTTP(s) Results JDBC pool1 pool2 pool3 Request JDBC JDBC Jeff annoys people on twitter @thatjeffsmith
  • 14. java –jar ords.war standalone • Supported for production! • ORDS is your webserver & web listener for your Oracle Databases ORDS Static Files -HTML , CSS, JS /db1/hr/emp/ JSON Binary HTML … HTTP(s) Response JDBC pool1 pool2 pool3 Request JDBC JDBC Jeff annoys people on twitter @thatjeffsmith ORDS Architecture Option #2 : Standalone
  • 15. • JDBC Conn Pools • 1 Pool Per Database • ORDS_PUBLIC_USER • Proxy Connects Enabled DB Users ORDS & Database Communication Jeff annoys people on twitter @thatjeffsmith
  • 16. • PUT – HTTP Verb • HTTPS – secure, encrypted version of HTTP (recommended!) • Server:8080 – network location where ORDS is running • ords – ords.war, Java servlet • hr – schema alias, where service is defined • examples – module, a collection of services • beers/:id – template, defines the resource Unwinding an ORDS Request Jeff annoys people on twitter @thatjeffsmith PUT https://server:8080/ords/hr/examples/beers/:id
  • 17. Install & Start ORDS REST Enable Application SCHEMA Publish RESTful Service or REST Enable object 1 2 3 Getting Started Steps Jeff annoys people on twitter @thatjeffsmith
  • 18. Jeff annoys people on twitter @thatjeffsmith Step 1, Install ORDS Video: I talk about the process, DO an install, use SQLDevWeb to build a RESTfulWeb Service
  • 19. • Services defined in schema • Services executed as user Step 2. REST Enable Schema Jeff annoys people on twitter @thatjeffsmith Services constrained by Database User:
  • 20. • AUTO REST • RESTful Services Step 3. Define your Service Jeff annoys people on twitter @thatjeffsmith
  • 21. What RESTful Services could look like… Jeff annoys people on twitter @thatjeffsmith
  • 22. Twoje zdrowie! Or Cheers! • UNTAPPD: my personal beer diary • YES, these are MY pictures and MY comments • Examples will show building REST APIs for my diary 🍻 Jeff annoys people on twitter @thatjeffsmith
  • 23. Example – Beers w/pictures SELECT beer_name, brewery_name, created_at, photo_url "$pics", comments FROM untappd WHERE photo_url IS NOT NULL ORDER BY checkin_id DESC Jeff annoys people on twitter @thatjeffsmith GET all beers, with links to pictures
  • 24. Example – Using Query String Parameters ?q={"beer_type":{"$like":"Stout%25"}} Jeff annoys people on twitter @thatjeffsmith SAME SQL, but… ORDS injects the WHERE clause for us. No additional coding required!
  • 25. Example: More Query String Parameters ?q={"beer_type":{"$like":"%25Tripel%25"}} Jeff annoys people on twitter @thatjeffsmith
  • 26. Filtering, Sorting and More ORDS Handles the SQL for you Jeff annoys people on twitter @thatjeffsmith
  • 27. Example: Generating Links “$alias” => LINK Jeff annoys people on twitter @thatjeffsmith
  • 28. Example: Working w/JSON Data in the DB Jeff annoys people on twitter @thatjeffsmith BAD 
  • 29. Escaping JSON  Jeff annoys people on twitter @thatjeffsmith
  • 30. Where/how to code your Services Jeff annoys people on twitter @thatjeffsmith
  • 31. Oracle SQL Developer • Full ORDS Integration • Develop RESTful Services • REST Enable Objects • Manage ORDS Roles and Privileges • Free! OS X,Windows, or Linux IDE Jeff annoys people on twitter @thatjeffsmith
  • 32. DatabaseActions/SQLDev Web • ORDS Single Page App • Develop RESTful Services • REST Enable Objects • Manage ORDS Roles and Privileges, OAuth2 Clients • Free! Any major browser. Browser Jeff annoys people on twitter @thatjeffsmith
  • 33. CLI & PL/SQL APIs Jeff annoys people on twitter @thatjeffsmith SQLcl Anywhere you can run PL/SQL
  • 34. Or Application Express (APEX) Jeff annoys people on twitter @thatjeffsmith APEX is NOT required
  • 35. Time to start building! Jeff annoys people on twitter @thatjeffsmith
  • 36. Home Brewing or Store Bought? Your Code Someone Else’s Jeff annoys people on twitter @thatjeffsmith
  • 37. AUTOREST • CRUD APIs, no SQL to write • Single ORDS call to create • Maintained by ORCL • Feature Packed • Optimized RESTful Services • You control: • Inputs, outputs, error handling, response codes, formatting • Your SQL/PLSQL code • Easily exported, source controlled • Transparent Choose your own adventure! Jeff annoys people on twitter @thatjeffsmith
  • 39. • Auto RESTTable – Full CRUD API, Data Loading, Metadata (DESC) • Auto RESTView – Read interface (GET),Write (PUT+POST+DELETE w/PK onVIEW) • Auto PL/SQL (RPC) – POST to execute stored PL/SQL – We accept {json} in, map to input params, grab output and {json} out Automatic – ORDS owns the code Jeff annoys people on twitter @thatjeffsmith
  • 40. • GET • PUT • POST • DELETE • DESC • DOCS AutoREST Table /ords/hr/beers/ /ords/hr/beers/:PK Jeff annoys people on twitter @thatjeffsmith
  • 41. Jeff annoys people on twitter @thatjeffsmith REST Enabling a TABLE
  • 42. REST EnabledTABLE Swagger API Doc • Table Metadata • SELECT Query Filtering/Order/ASOF SCN or Timestamp • INSERT • UPDATE • DELETE • BATCHLOAD Jeff annoys people on twitter @thatjeffsmith
  • 43. Jeff annoys people on twitter @thatjeffsmith Two Quick AUTOREST TABLE Examples 1. GET one or more rows with a query 2. PUT updates to an existing row
  • 44. • All rows / • One row /:id – PKValue – No PK, default to ROWID – Multi-column PK /x,y,z • Some rows /?q={json} SELECT (GET) Jeff annoys people on twitter @thatjeffsmith
  • 45. METHOD : PUT /:PK REQUEST BODY : JSON RESPONSE: 200 OK • Location (Header) • JSON (Body) UPDATE (PUT) : adding comments REQUEST BODY Jeff annoys people on twitter @thatjeffsmith RESPONSE
  • 46. Jeff annoys people on twitter @thatjeffsmith We also support your PL/SQL Code! 1. Instant access to all of your application logic 2. ORDS ‘wrappers’ your existing PL/SQL with HTTPS
  • 47. • POST /ords/hr/procA • JSON Responses & Results (OUTs/RETURNs/REFCURSORs) Accessing your PL/SQL Code, Automatically Jeff annoys people on twitter @thatjeffsmith
  • 48. Remote Procedure Call over HTTP (POST) Jeff annoys people on twitter @thatjeffsmith
  • 49. Remote Procedure Call over HTTP (POST) Request p(arg =>input) Procedure output formatted {json} – links and all Jeff annoys people on twitter @thatjeffsmith
  • 50. RESTful Services, write your own code Jeff annoys people on twitter @thatjeffsmith • Modules • Templates • Handlers • SourceTypes
  • 51. • Base URI • Default pagination size • Can be protected by common privileges Modules Jeff annoys people on twitter @thatjeffsmith
  • 53. Handlers: Mapping Verbs to the SQL/PLSQL Jeff annoys people on twitter @thatjeffsmith
  • 54. • Collection Query – Multiple records/paging • Collection Query Item – Single record only/no paging • Media – Streams the output directly • PL/SQL – Print HTML (HTP.P) or Code the Response yourself (headers and body) Source Types - Shapes Responses Jeff annoys people on twitter @thatjeffsmith
  • 55. RESTful Service Example #1 • aTABLE • a RESTfulWebservice… • …that INSERTs a record Implementation • Template => media/ • Handler => POST • Source => PL/SQL Jeff annoys people on twitter @thatjeffsmith
  • 56. INSERT a record w/a BLOB Jeff annoys people on twitter @thatjeffsmith
  • 57. • ORDS defines request body & headers w/ :binds • ORDS defines response body & headers w/ :binds ORDS makes HTTP & SQL, easy! INSERT INTO table (blob) VALUES (:body); :status := 201; :location := ‘../’ || id; Jeff annoys people on twitter @thatjeffsmith
  • 58. • We got the BLOB from the HTTP request via :body • We got the other columns from HTTP request headers • We INSERT the record • We set HTTP LOCATION and STATUS …in ~3 lines of PL/SQL!!! What just happened? Jeff annoys people on twitter @thatjeffsmith
  • 59. RESTful Service Example #2 • aTABLE • a RESTfulWebservice… • …that gives list of links Implementation • Template => beers/:style/pics • Handler => GET • Source => SQL Jeff annoys people on twitter @thatjeffsmith
  • 60. Print a list of Rows w/LINKs to pictures Jeff annoys people on twitter @thatjeffsmith
  • 61. • SQL SELECT to get the data • Predicate value pulled from URI via :type bind • We told ORDS to generate a link with an “$alias” What just happened? Jeff annoys people on twitter @thatjeffsmith
  • 62. Time to wind things down, Last Call! Jeff annoys people on twitter @thatjeffsmith • Source code, CI/CD • Documentation • Authorization
  • 63. Backup/Source Control your REST Code • GUI • SQL • CLI/Liquibase Generated via: Jeff annoys people on twitter @thatjeffsmith
  • 64. Document your APIs with OpenAPI • GUI • REST Generated via: Jeff annoys people on twitter @thatjeffsmith
  • 65. • See MY post on OAUTH2 w/ORDS • SeeTodd’s post on OAUTH2 w/ORDS & Micronaut Jeff annoys people on twitter @thatjeffsmith SECURE Your Services
  • 66. • Slides • Blogs • Articles UKOUG Scene Why REST, andWhat’s in it or Me? Oracle Magazine AUTO REST & REST Enabled SQL Other Resources Jeff annoys people on twitter @thatjeffsmith

Editor's Notes

  1. There have been many many remote procedure call/distributed communication protocols. Many have been very deeply specified with thousands of pages of specifications, but in the end the industry moved away from these protocols to a much looser concept. So loose it cannot even deemed a protocol, rather REST is referred to as an architectural style. REST won not by being the most advanced, or the most capable, or the most efficient, but by being the easiest to get to grips with. Which is both a blessing and a curse. The world is full of less than optimal REST APIs. Because REST is so approachable folks quickly move to building and shipping APIs without considering some of the more thorny issues that every distributed application has to deal with How to manage concurrency, how to deal with lost updates, co-ordinate transactions How to deal with unavailability How to deal with massive scale Oracle REST Data Services is designed to deal with many of these issues, we’ve done the hard thinking and chosen approaches to deal with these issues so developers using ORDS don’t need to worry about them so much. I want to draw a comparison between REST and another foundational technology, UNIX. When I think of UNIX I picture big air conditioned rooms in data centres full of big iron servers. But that’s not the reality of UNIX today. It’s not just data centres and backend servers. The reality is UNIX is all around you, you wear it on your wrist, you carry it in your pocket, it powers the movies you watch when sat on an aeroplane, it controls the car you drive, it is literally everywhere. It is part of the fabric of our reality, but it’s not something out there in front of you. It’s a building block, something atop which much of the rest of the technology in our lives is built upon. I’m sure everyone in this room knows how to get around in UNIX, I’m sure that wasn’t always the case, there was a time when all I knew was MS-DOS and Windows. UNIX was a foreign land, and even seemed like something that was fading away under the march of Windows, but that time was so long ago and now I can’t picture a future where knowing and being comfortable using UNIX won’t be a valuable skill for at least another decade or two. I feel REST is following a similar trajectory. It is almost as old as the HTTP protocol itself, and it’s popularity and ubiquity has taken a considerable amount of time to build, but now that it’s value has been recognised, I don’t see it’s utility being displaced until the next paradigm shift in computing technology occurs. It has become one of the building blocks we take for granted. And thus everyone needs to know and understand REST and more importantly every piece of technology involved in distributed computing needs to be a good and competent REST citizen.
  2. New with REST Data services 3.0 it does not require APEX to define your REST Data services. Oracle currently distributes “Oracle APEX Listener”, which will be renamed to Oracle REST Data Services. Delivered with Database 12.1.0.2 Java Based plugin replacement for Apache mod_plsql Formally known as Oracle APEX listener available on OTN Available today on our Database Cloud Schema Service
  3. Perform a GET on the Collection URI to retrieve the resource In ORDS the response is a JSON document with two main elements: items: lists the items in the collection links: provides hyperlinks to help navigate the collection (next) and to identify the URI to use to POST new Items to the Collection