SlideShare a Scribd company logo
1 of 16
Download to read offline
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
ORDSFile Up/Downloads via REST
https://oracle.com/rest
Jeff Smith
Senior Principal Product Manager
Jeff.d.smith@oracle.com || @thatjeffsmith
Database Tools, Oracle Corp
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Oracle
REST
Data
Services
2
Formerly Known as the APEX Listener
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
• Model resources, not actions:
– GET /ords/hr/employees/ - GOOD
– GET /ords/hr/delete_emp/ - BAD
– DELETE /ords/hr/employees/97 - GOOD
• Uniform operations on all resources:
– GET, POST, PUT, DELETE, OPTIONS, HEAD
• Stateless requests, state transitions communicated via hyper-links.
The Architectural Style of the Web{REST}
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
• Java JEE mid tier application, e.g., WebLogic, Tomcat, Glassfish (deprecated)
– Also supported “Standalone” mode
• For input, maps/binds URI to SQL and PL/SQL
• For output, transforms results to JSON and other formats
Oracle REST Data ServicesHTTP(S) client Oracle Database
SQLMap & BindURI
JSON Transform to JSON SQL Result Set
How do we apply this Architectural Style to a DB?
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
https://host/ords/human/peeps/10
SELECT …
WHERE EMPLOYEE_ID = :id
Oracle DB
1. Browser GET request
2. Proxy connect HR, executes
‘peeps’ HANDLER code
ORDS Runs in WLS, Tomcat, or
as a standalone process
Oracle
REST
Data
Services
Anatomy of a RESTful Service Transaction
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Typical Deployments
• Standard webserver layout
• Implements Java Servlet
• Deploys to WLS, Tomcat, Glassfish
• or Standalone (embedded Jetty)
WLS,Tomcat
ORDS
Apache
Static Files
-HTML, CSS, JS
/hr/emp
JSON
Binary
HTML
…
HTTP(s) Results
JDBC
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
And it’s Easy!
I had been looking for a chance to perform a POC, so I proposed I just provide him
with a couple of web services. In under a day I had functioning
web services in place for him to consume. There’s been
refinements to them and new ones developed since then. We are now exploring
where else we could leverage this technology.
- a REAL customer talking about ORDS
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Today’s Mission – Get Files into a BLOB
GET & POST => https://
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Our Resource Templates
• media/
– GET retrieves a list of files with links
– POST adds a new file
• media/:id
– GET retrieves file info with link to content
• media/:id/content
– GET downloads content of the file
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Handler Code – it’s all SQL & PL/SQL!
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
POST – Adding a File
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
GET – File Details
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
GET – ‘Download’ the File
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
The Code…is All on My Blog
• I provide:
– The TABLE
– The REST Services Module
• You provide:
– The Database
– ORDS running
– Files you want to play with
https://www.thatjeffsmith.com – click on ORDS
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Swagger Doc
http://localhost:8080/ords/hr/open-api-catalog/ora_magazine/
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Thanks! Questions?
Resources
• Blogs
• Videos
• GitHub Examples
• Articles
– UKOUG Scene Why REST, and What’s in it or Me?
– Oracle Mag AUTO REST & REST Enabled SQL

More Related Content

More from Jeff 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
 
What's New in Oracle SQL Developer for 2018
What's New in Oracle SQL Developer for 2018What's New in Oracle SQL Developer for 2018
What's New in Oracle SQL Developer for 2018Jeff Smith
 
Oracle SQL Developer: You're Doing it Wrong!
Oracle SQL Developer: You're Doing it Wrong!Oracle SQL Developer: You're Doing it Wrong!
Oracle SQL Developer: You're Doing it Wrong!Jeff 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
 
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
 
Oracle SQL Developer Reports
Oracle SQL Developer ReportsOracle SQL Developer Reports
Oracle SQL Developer ReportsJeff Smith
 
Oracle SQL Developer: 3 Features You're Not Using But Should Be
Oracle SQL Developer: 3 Features You're Not Using But Should BeOracle SQL Developer: 3 Features You're Not Using But Should Be
Oracle SQL Developer: 3 Features You're Not Using But Should BeJeff 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
 
PL/SQL All the Things in Oracle SQL Developer
PL/SQL All the Things in Oracle SQL DeveloperPL/SQL All the Things in Oracle SQL Developer
PL/SQL All the Things in Oracle SQL DeveloperJeff Smith
 
Debugging PL/SQL with Oracle SQL Developer
Debugging PL/SQL with Oracle SQL DeveloperDebugging PL/SQL with Oracle SQL Developer
Debugging PL/SQL with Oracle SQL DeveloperJeff Smith
 
REST Enabling Your Oracle Database
REST Enabling Your Oracle DatabaseREST Enabling Your Oracle Database
REST Enabling Your Oracle DatabaseJeff 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
 
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 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
 
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 Database 12c Feature Support in Oracle SQL Developer
Oracle Database 12c Feature Support in Oracle SQL DeveloperOracle Database 12c Feature Support in Oracle SQL Developer
Oracle Database 12c Feature Support in Oracle SQL DeveloperJeff 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
 
Oracle SQL Developer for the DBA
Oracle SQL Developer for the DBAOracle SQL Developer for the DBA
Oracle SQL Developer for the DBAJeff 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
 

More from Jeff Smith (20)

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
 
What's New in Oracle SQL Developer for 2018
What's New in Oracle SQL Developer for 2018What's New in Oracle SQL Developer for 2018
What's New in Oracle SQL Developer for 2018
 
Oracle SQL Developer: You're Doing it Wrong!
Oracle SQL Developer: You're Doing it Wrong!Oracle SQL Developer: You're Doing it Wrong!
Oracle SQL Developer: You're Doing it Wrong!
 
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)
 
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
 
Oracle SQL Developer Reports
Oracle SQL Developer ReportsOracle SQL Developer Reports
Oracle SQL Developer Reports
 
Oracle SQL Developer: 3 Features You're Not Using But Should Be
Oracle SQL Developer: 3 Features You're Not Using But Should BeOracle SQL Developer: 3 Features You're Not Using But Should Be
Oracle SQL Developer: 3 Features You're Not Using But Should Be
 
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
 
PL/SQL All the Things in Oracle SQL Developer
PL/SQL All the Things in Oracle SQL DeveloperPL/SQL All the Things in Oracle SQL Developer
PL/SQL All the Things in Oracle SQL Developer
 
Debugging PL/SQL with Oracle SQL Developer
Debugging PL/SQL with Oracle SQL DeveloperDebugging PL/SQL with Oracle SQL Developer
Debugging PL/SQL with Oracle SQL Developer
 
REST Enabling Your Oracle Database
REST Enabling Your Oracle DatabaseREST Enabling Your Oracle Database
REST Enabling Your Oracle Database
 
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
 
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 SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?Oracle SQL Developer for SQL Server?
Oracle SQL Developer for SQL Server?
 
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 Database 12c Feature Support in Oracle SQL Developer
Oracle Database 12c Feature Support in Oracle SQL DeveloperOracle Database 12c Feature Support in Oracle SQL Developer
Oracle Database 12c Feature Support in Oracle SQL Developer
 
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
 
Oracle SQL Developer for the DBA
Oracle SQL Developer for the DBAOracle SQL Developer for the DBA
Oracle SQL Developer for the DBA
 
Dimensional modeling in oracle sql developer
Dimensional modeling in oracle sql developerDimensional modeling in oracle sql developer
Dimensional modeling in oracle sql developer
 

Recently uploaded

AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarPrecisely
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesDavid Newbury
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopBachir Benyammi
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Brian Pichman
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfJamie (Taka) Wang
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024D Cloud Solutions
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URLRuncy Oommen
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UbiTrack UK
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDELiveplex
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationIES VE
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-pyJamie (Taka) Wang
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioChristian Posta
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxMatsuo Lab
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Websitedgelyza
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1DianaGray10
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfinfogdgmi
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Commit University
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.YounusS2
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8DianaGray10
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IES VE
 

Recently uploaded (20)

AI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity WebinarAI You Can Trust - Ensuring Success with Data Integrity Webinar
AI You Can Trust - Ensuring Success with Data Integrity Webinar
 
Linked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond OntologiesLinked Data in Production: Moving Beyond Ontologies
Linked Data in Production: Moving Beyond Ontologies
 
NIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 WorkshopNIST Cybersecurity Framework (CSF) 2.0 Workshop
NIST Cybersecurity Framework (CSF) 2.0 Workshop
 
Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )Building Your Own AI Instance (TBLC AI )
Building Your Own AI Instance (TBLC AI )
 
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
activity_diagram_combine_v4_20190827.pdfactivity_diagram_combine_v4_20190827.pdf
 
Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024Artificial Intelligence & SEO Trends for 2024
Artificial Intelligence & SEO Trends for 2024
 
Designing A Time bound resource download URL
Designing A Time bound resource download URLDesigning A Time bound resource download URL
Designing A Time bound resource download URL
 
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
UWB Technology for Enhanced Indoor and Outdoor Positioning in Physiological M...
 
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDEADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
ADOPTING WEB 3 FOR YOUR BUSINESS: A STEP-BY-STEP GUIDE
 
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve DecarbonizationUsing IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
Using IESVE for Loads, Sizing and Heat Pump Modeling to Achieve Decarbonization
 
20230202 - Introduction to tis-py
20230202 - Introduction to tis-py20230202 - Introduction to tis-py
20230202 - Introduction to tis-py
 
Comparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and IstioComparing Sidecar-less Service Mesh from Cilium and Istio
Comparing Sidecar-less Service Mesh from Cilium and Istio
 
Introduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptxIntroduction to Matsuo Laboratory (ENG).pptx
Introduction to Matsuo Laboratory (ENG).pptx
 
COMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a WebsiteCOMPUTER 10 Lesson 8 - Building a Website
COMPUTER 10 Lesson 8 - Building a Website
 
Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1Secure your environment with UiPath and CyberArk technologies - Session 1
Secure your environment with UiPath and CyberArk technologies - Session 1
 
Videogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdfVideogame localization & technology_ how to enhance the power of translation.pdf
Videogame localization & technology_ how to enhance the power of translation.pdf
 
Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)Crea il tuo assistente AI con lo Stregatto (open source python framework)
Crea il tuo assistente AI con lo Stregatto (open source python framework)
 
Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.Basic Building Blocks of Internet of Things.
Basic Building Blocks of Internet of Things.
 
UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8UiPath Studio Web workshop series - Day 8
UiPath Studio Web workshop series - Day 8
 
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
IESVE Software for Florida Code Compliance Using ASHRAE 90.1-2019
 

Build a Web Service to Up and Download Files for Oracle Database

  • 1. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | ORDSFile Up/Downloads via REST https://oracle.com/rest Jeff Smith Senior Principal Product Manager Jeff.d.smith@oracle.com || @thatjeffsmith Database Tools, Oracle Corp
  • 2. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Oracle REST Data Services 2 Formerly Known as the APEX Listener
  • 3. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Model resources, not actions: – GET /ords/hr/employees/ - GOOD – GET /ords/hr/delete_emp/ - BAD – DELETE /ords/hr/employees/97 - GOOD • Uniform operations on all resources: – GET, POST, PUT, DELETE, OPTIONS, HEAD • Stateless requests, state transitions communicated via hyper-links. The Architectural Style of the Web{REST}
  • 4. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Java JEE mid tier application, e.g., WebLogic, Tomcat, Glassfish (deprecated) – Also supported “Standalone” mode • For input, maps/binds URI to SQL and PL/SQL • For output, transforms results to JSON and other formats Oracle REST Data ServicesHTTP(S) client Oracle Database SQLMap & BindURI JSON Transform to JSON SQL Result Set How do we apply this Architectural Style to a DB?
  • 5. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | https://host/ords/human/peeps/10 SELECT … WHERE EMPLOYEE_ID = :id Oracle DB 1. Browser GET request 2. Proxy connect HR, executes ‘peeps’ HANDLER code ORDS Runs in WLS, Tomcat, or as a standalone process Oracle REST Data Services Anatomy of a RESTful Service Transaction
  • 6. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Typical Deployments • Standard webserver layout • Implements Java Servlet • Deploys to WLS, Tomcat, Glassfish • or Standalone (embedded Jetty) WLS,Tomcat ORDS Apache Static Files -HTML, CSS, JS /hr/emp JSON Binary HTML … HTTP(s) Results JDBC
  • 7. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | And it’s Easy! I had been looking for a chance to perform a POC, so I proposed I just provide him with a couple of web services. In under a day I had functioning web services in place for him to consume. There’s been refinements to them and new ones developed since then. We are now exploring where else we could leverage this technology. - a REAL customer talking about ORDS
  • 8. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Today’s Mission – Get Files into a BLOB GET & POST => https://
  • 9. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Our Resource Templates • media/ – GET retrieves a list of files with links – POST adds a new file • media/:id – GET retrieves file info with link to content • media/:id/content – GET downloads content of the file
  • 10. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Handler Code – it’s all SQL & PL/SQL!
  • 11. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | POST – Adding a File
  • 12. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | GET – File Details
  • 13. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | GET – ‘Download’ the File
  • 14. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | The Code…is All on My Blog • I provide: – The TABLE – The REST Services Module • You provide: – The Database – ORDS running – Files you want to play with https://www.thatjeffsmith.com – click on ORDS
  • 15. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Swagger Doc http://localhost:8080/ords/hr/open-api-catalog/ora_magazine/
  • 16. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Thanks! Questions? Resources • Blogs • Videos • GitHub Examples • Articles – UKOUG Scene Why REST, and What’s in it or Me? – Oracle Mag AUTO REST & REST Enabled SQL

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