Mail: j_schuster@me.com Twitter: @JuergenSchuster Web: juergen-schuster-it.de APEX-Homepage: APEX Podcast: apex.press/talkshow Dynamic Actions Examples: dynamic-actions.com
Who am I Oracle (13 Years) Freelancer (6 Years) APEX > 10 Years Other: Java, Ext-JS, QlikView, HANA SAP UI 5 The guy with the stickers apex.press/talkshow
Who am I Founder of
Agenda Why Webservices? What are Webservices? Project Example ORDS (Oracle REST Data Services) REST in APEX
Agenda Why Webservices? What are Webservices? Project Example ORDS (Oracle REST Data Services) REST in APEX
APEX - REQUEST /i/ =.jpg;.png;.css;.js HTML / JSON A P A C H E ORACLE /pls/ HTML JSON Data SQL https:///pls/f?p= mod plsql HTML / JSON (OCI) f?p= APEX Browser Apache with mod_plsql Database Apex Engine
Why Webservices? Access to Data NOT in the Oracle DB (Social Media) Leverage the amazing productivity of APEX Leave the Data where they are Simple: Client, Server, Stateless, Readable, pure HTTP we already know Fast: Caching, Compressing, Scalable, Incremental Rendering, Pre-Fetching Reliable: Roy Fielding How the Web works and why it works well"
APEX - REST - REQUEST REST /i/ =.jpg;.png;.css;.js HTML / JSON A P A C H E Data / JSON https:// /emp ORACLE /pls/ HTML JSON Data SQL https:///pls/f?p= mod plsql HTML / JSON (OCI) f?p= APEX Browser Apache with mod_plsql Database Apex Engine
Agenda Why Webservices? What are Webservices? Project Example ORDS (Oracle REST Data Services) REST in APEX
What are Webservices? SOAP ( Simple Object Access Protocol) Complex XML, Parser, WSDL, Envelopes, Verbose XML only, Nested Object Structures? Extra Protocol Legacy, not so simple, not relevant anymore
What are Webservices? REST (Representational State Transfer) Really Simple, uses the well known HTTP commands No extra Protocol like SOAP, JSON inmemory 12.2 http:///ords/orders REST CRUID SQL GET Read SELECT POST Create INSERT PUT Update/Create UPDATE/CREATE DELETE Delete DELETE
Agenda Why Webservices? What are Webservices? Project Example ORDS (Oracle REST Data Services) REST in APEX
APEX - SAP HANA SAP-HANA via REST /i/ =.jpg;.png;.css;.js HTML / JSON A P A C H E Data / JSON https:// /emp ORACLE /pls/ HTML JSON Data SQL https:///pls/f?p= mod plsql HTML / JSON (OCI) f?p= APEX Browser Apache with mod_plsql Database Apex Engine
Native Webdevelopment with SAP UI5? Around 20 times longer Around 20 times more complicated Around 20 thousand times more Sourcecode Around 20 times higher maintenance costs
APEX - SAP HANA - Thoughts Usual APEX development w/o restrictions Use PL/JSON - Today APEX_JSON 4 times faster Use Pipelined Table Functions
APEX - SAP HANA - Thoughts APEX: select * from table(my_package.my_func(p_param)) function my_func(p_param) return my_rec_table pipelined is begin -- Do http call to REST Service -- Parse the result -- Pipe Row end;
APEX - SAP HANA - Reality 8ms / record - PL/JSON 5ms / record - Own specialized JSON Parser 3ms / record - Own CSV parser 1ms / record - CSV parsing Steven Feuerstein => 1 second 1000 records 10 seconds for 10 000! Decision: Live with it, we have 1000 records max.
APEX - SAP HANA - Room for Improvement Use APEX_JSON (4 times faster than PL/JSON) Use 12.1.0.2 SQL-JSON Egine (100-times faster) Pushes the Limit to 100 000 records, no final solution
APEX - SAP HANA - Final Solution Only fetch the records shown on the screen Overwrite Pagination and Sorting in Standard-Report No Interactive Report anymore Wait for APEX 6.0? Working with REST-Sources natively? The next big Step (Mike Hichwa, APEX Podcast March 2015)
APEX - SAP HANA - with Dynamic Actions
Agenda Why Webservices? What are Webservices? Project Example ORDS (Oracle REST Data Services) REST in APEX
ORDS Read REST only? You don t need ORDS! But you should!
ORDS advantages over mod_plsql Connection Pooling Post > 32K Virus-Scanner PDF-Printing SODA Multiple DBs REST Hooks OAuth2 Excel-Upload Cashing
APEX - ORDS - REST - Consume External Tomcat REST Jetty /i/ =.jpg;.png;.css;.js HTML / JSON https:///ords/f?p= Glassfish O R D S (Java) Weblogic HTML / JSON (JDBC thin) Data / JSON https:// /emp ORACLE Data SQL f?p= APEX Browser ORDS Database Apex Engine
APEX - Apache - ORDS - REST - Consume External REST Tomcat Browser /i/ =.jpg;.png;.css;.js HTML / JSON https:///ords/f?p= A P A C H E /ords/ HTML JSON mod jk Apache with mod_jk Fire Wall (AJP) f?p= HTML / JSON Glassfish O R D S (Java) ORDS Weblogic (JDBC thin) f?p= HTML / JSON Data / JSON https:// /emp ORACLE Data SQL APEX Database Apex Engine
APEX - ORDS - REST Publish Tomcat O R D S ORACLE JSON https://.../ords/orders(4711) Glassfish Transform to JSON Map & Bind Weblogic ORALCE Cursor (JDBC thin) SQL REST Call ORDS ORACLE Database
Agenda Why Webservices? What are Webservices? Project Example ORDS (Oracle REST Data Services) REST in APEX
APEX - REST - Consume Internal REST /i/ =.jpg;.png;.css;.js HTML https:///pls/f?p= /pls/ A P A C H E HTML JSON mod plsql HTML (OCI) f?p= Data / JSON https:// /emp ORACLE APEX Collection Browser Apache with mod_plsql Database Apex Engine
APEX - REST - Consume
APEX - REST - Consume
APEX - REST - Consume
APEX - REST - Consume
APEX - REST - Consume
APEX - REST - Consume
APEX - REST - Consume Internal - Whats Missing REST Result as JSON stored in Collection Blob as document only Need to apply APEX_JSON -> another Collection
APEX - REST - Publish You need to have ORDS You can do the definitions in APEX or ORDS But it is always performed by ORDS Actually it has nothing to do with APEX
REST - Publish - APEX Definition
REST - Publish - ORDS Definition
Conclusions Read REST? No ORDS needed but you should! Publish REST form Oracle DB -> Need ORDS Deal with a JSON Result in the DB -> SQL 12.1.0.2 Deal with JSON Result in PL/SQL -> APEX_JSON
Mail: j_schuster@me.com Twitter: @JuergenSchuster Web: juergen-schuster-it.de APEX-Homepage: APEX Podcast: apex.press/talkshow Dynamic Actions Examples: dynamic-actions.com