SlideShare uma empresa Scribd logo
1 de 14
www.cdata.com
See the World as a Database
SQL for Web APIs
Simplifying Data Access for API Consumers
Jerod Johnson, Technology Evangelist
@jeRodimusPrime
@cdatasoftware
www.cdata.com
1. Popular APIs with SQL Endpoints
2. Why SQL?
3. Integration Challenges
4. Standard Drivers
5. Case Study: Bouqet.ai
Agenda
www.cdata.com
Popular APIs with SQL Functionality
Other APIs:
Standard SQL N1QL & SQL++ SOQL & SOSL
Featured:
www.cdata.com
Google BigQuery – Standard SQL
Standard SQL
• Adheres to the SQL 2011 standard
• WITH clauses and SQL functions
• Subqueries (in SELECT and WHERE)
• ARRAY and STRUCT types
• Inserts, updates, and deletes
• JOINs
Popular APIs with SQL Functionality
Python Example:
# from google.cloud import bigquery
# client = bigquery.Client()
query = (
"SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` "
'WHERE state = "TX" '
"LIMIT 100"
)
query_job = client.query(
query,
# Location must match that of the dataset(s) referenced in the query.
location="US",
) # API request - starts the query
for row in query_job: # API request - fetches results
# Row values can be accessed by field name or index
assert row[0] == row.name == row["name"]
print(row)
www.cdata.com
Salesforce – SOQL & SOSL
Salesforce Object Query Language
• Provides SQL-like access to
Salesforce objects
• Format
SELECT one or more fields
FROM an object
WHERE filter statements/ordering
JavaScript query Example:
Popular APIs with SQL Functionality
Salesforce Object Search Language
• Provides text-based searching of
Salesforce objects
• Format
FIND SeachQuery
IN SearchGroup
JavaScript search Example:
var result = sforce.connection.query(
"Select Name, Id from User");
records = result.getArray("records");
for (var i=0; i < records.length; i++) {
var record = records[i];
log(record.Name + " -- " + record.Id);
}
var result = sforce.connection.search(
"FIND {jane} IN NAME FIELDS RETURNING Account(name, id)");
if (result) {
var records = result.getArray("searchRecords");
for (var i=0; i < records.length; i++) {
var record = records[i].record;
log(record.Id + " -- " + record.Name);
}
}
www.cdata.com
Couchbase – N1QL & SQL++
• Both provide SQL-like syntax for
JSON documents for different
Couchbase services
• Format
SELECT one or more fields
FROM a document
WHERE filter statements/ordering
• Dot notation to “drill down”
• Returns a JSON document
Popular APIs with SQL Functionality
Node.js N1qlQuery Example
var N1qlQuery = couchbase.N1qlQuery;
query =
N1qlQuery.fromString('SELECT name, contact.email FROM default');
bucket.query(query, function(err, rows, meta) {
for (row in rows) {
console.log('Name: %s. Email: %s', row.name, row.email);
}
});
Node.js AnalyticsQuery Example
var query = couchbase.AnalyticsQuery.fromString(
"SELECT airportname, address.country" +
"FROM airports WHERE address.country=?");
bucket.query(query, ['France’], function(err, rows) {
// ...
});
www.cdata.com
Why SQL?
• Self-describing API: objects, fields, functions are all defined & discoverable
• Ease of integration & application development
• Simplified interfacing with popular tooling
• Leverage server-side processing
• Examples:
• Retrieve data from multiple related objects
• Retrieve parts of fields (numbers, dates, or checkboxes/flags)
• Count the number of records that meet specified criteria
• Sort results as part of the query
www.cdata.com
Integration Challenges
• SQL access ≠ SQL response
• SQL access is not uniform
across APIs
• Not all APIs provide SQL
access
• Roughly 2,000 new public
APIs per year
www.cdata.com
LEGACY TECHNOLOGY SaaS APPLICATION
2017 State of the
SaaS-Powered Workplace
Can your API Integrations Keep Up?
58% of companies are running
almost completely on SaaS.
API Challenges
www.cdata.com
Standard Drivers – SQL Access to SaaS
Applications
• Ubiquitous technologies like JDBC, ODBC, &
ADO.NET
• Historically used to integrate with databases
• Vendors now create drivers for SaaS applications
ADO.NET ODATAJDBCODBC
www.cdata.com
Modeling APIs through SQL
• Tables and views correspond with
resource collections (Orders, Accounts,
Pages, Users, etc.)
• Individual elements correspond to a row
• Sub-collection relationships are
maintained (Orders and Order Line Items)
• CRUD operations are translated to SQL
statements
• Operations and functions are
implemented with stored procedures
Standard Drivers
www.cdata.com
SQL-92 Compliant Queries
The easiest way to build data-centric applications. Write
standard SQL queries with support for JOINs, updates,
aggregation, and more.
SELECT Account.Id, Account.Name, Account.Fax,
Opportunity.AccountId, Opportunity.CloseDate
FROM Salesforce.Account
INNER JOIN Salesforce.Opportunity
ON Account.Id = Opportunity.AccountId
SELECT WITH INNER JOIN
UPDATE Account SET Name='John' WHERE Id = @myId
UPDATE DATA
SELECT State, AVG(AnnualRevenue) FROM Account GROUP BY State
AGGREGATE FUNCTIONS
Properties prop = new Properties();
prop.setProperty("User","myUser");
prop.setProperty("Password","myPassword");
prop.setProperty("Security Token","myToken");
Connection conn = DriverManager.getConnection("jdbc:salesforce:",prop);
Statement stat = conn.createStatement();
boolean ret = stat.execute("SELECT BillingState, Name FROM Account");
if (ret) {
ResultSet rs=stat.getResultSet();
while(rs.next()) {
for(int i = 1; i <= rs.getMetaData().getColumnCount(); i++) {
System.out.println(rs.getMetaData().getColumnName(i) +
"=" + rs.getString(i));
}
}
}
One SDK / API to Learn & Implement
Just like connecting with a typical RDBMS like SQL. Use
standard classes like Properties, Connection,
DriverManager, Statement, ResultSet, etc.
Simplify Developer Integration
Standard Drivers
www.cdata.com
Natural language AI platform, Aris extends data connectivity with CData and the power of SQL abstraction.
Mapping natural language queries to SQL highlights the transformative power of a SQL data
abstraction, as it would be nearly impossible to map these dynamic queries to SaaS data any
other way.
More Online: https://www.cdata.com/case-study/bouquet/
Case Study: Bouqet.ai
www.cdata.com
The Takeaway – SQL Benefits for ALL APIs
• SQL continues to be the “lingua franca” for data access
• API growth continues unabated
• Standard drivers offer simplified integration
• Rapid application development
• Ease of use for citizen analysts
• Insulation from API changes
Want to know more?
email: jerodj@cdata.com

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Sql server 2019 new features
Sql server 2019 new featuresSql server 2019 new features
Sql server 2019 new features
 
Deep Dive Data Management Gateway - SQLSaturday Edinburgh
Deep Dive Data Management Gateway - SQLSaturday EdinburghDeep Dive Data Management Gateway - SQLSaturday Edinburgh
Deep Dive Data Management Gateway - SQLSaturday Edinburgh
 
Technological insights behind Clusterpoint database
Technological insights behind Clusterpoint databaseTechnological insights behind Clusterpoint database
Technological insights behind Clusterpoint database
 
Design for Scale - Building Real Time, High Performing Marketing Technology p...
Design for Scale - Building Real Time, High Performing Marketing Technology p...Design for Scale - Building Real Time, High Performing Marketing Technology p...
Design for Scale - Building Real Time, High Performing Marketing Technology p...
 
Introduction to External Objects and the OData Connector
Introduction to External Objects and the OData ConnectorIntroduction to External Objects and the OData Connector
Introduction to External Objects and the OData Connector
 
Azure Data Factory V2; The Data Flows
Azure Data Factory V2; The Data FlowsAzure Data Factory V2; The Data Flows
Azure Data Factory V2; The Data Flows
 
Oracle to Amazon Aurora Migration, Step by Step - AWS Online Tech Talks
Oracle to Amazon Aurora Migration, Step by Step - AWS Online Tech TalksOracle to Amazon Aurora Migration, Step by Step - AWS Online Tech Talks
Oracle to Amazon Aurora Migration, Step by Step - AWS Online Tech Talks
 
Building your first Data lake platform
Building your first Data lake platform Building your first Data lake platform
Building your first Data lake platform
 
Azure Data Factory
Azure Data FactoryAzure Data Factory
Azure Data Factory
 
J1 T1 3 - Azure Data Lake store & analytics 101 - Kenneth M. Nielsen
J1 T1 3 - Azure Data Lake store & analytics 101 - Kenneth M. NielsenJ1 T1 3 - Azure Data Lake store & analytics 101 - Kenneth M. Nielsen
J1 T1 3 - Azure Data Lake store & analytics 101 - Kenneth M. Nielsen
 
Azure data factory
Azure data factoryAzure data factory
Azure data factory
 
Analyzing StackExchange data with Azure Data Lake
Analyzing StackExchange data with Azure Data LakeAnalyzing StackExchange data with Azure Data Lake
Analyzing StackExchange data with Azure Data Lake
 
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
Migrating Oracle to Aurora PostgreSQL Utilizing AWS Database Migration Servic...
 
Odessa .net-user-group-sql-server-2019-hidden-gems by Denis Reznik
Odessa .net-user-group-sql-server-2019-hidden-gems by Denis ReznikOdessa .net-user-group-sql-server-2019-hidden-gems by Denis Reznik
Odessa .net-user-group-sql-server-2019-hidden-gems by Denis Reznik
 
An intro to Azure Data Lake
An intro to Azure Data LakeAn intro to Azure Data Lake
An intro to Azure Data Lake
 
Azure Cosmos DB + Gremlin API in Action
Azure Cosmos DB + Gremlin API in ActionAzure Cosmos DB + Gremlin API in Action
Azure Cosmos DB + Gremlin API in Action
 
Architecting Solutions Leveraging The Cloud
Architecting Solutions Leveraging The CloudArchitecting Solutions Leveraging The Cloud
Architecting Solutions Leveraging The Cloud
 
Best Practices for Building a Data Lake on AWS
Best Practices for Building a Data Lake on AWSBest Practices for Building a Data Lake on AWS
Best Practices for Building a Data Lake on AWS
 
Big Data Processing with Spark and .NET - Microsoft Ignite 2019
Big Data Processing with Spark and .NET - Microsoft Ignite 2019Big Data Processing with Spark and .NET - Microsoft Ignite 2019
Big Data Processing with Spark and .NET - Microsoft Ignite 2019
 
Spark as a Service with Azure Databricks
Spark as a Service with Azure DatabricksSpark as a Service with Azure Databricks
Spark as a Service with Azure Databricks
 

Semelhante a SQL for Web APIs - Simplifying Data Access for API Consumers

TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
Tieturi Oy
 
Make your gui shine with ajax solr
Make your gui shine with ajax solrMake your gui shine with ajax solr
Make your gui shine with ajax solr
lucenerevolution
 

Semelhante a SQL for Web APIs - Simplifying Data Access for API Consumers (20)

Introduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIRIntroduction to SQLite in Adobe AIR
Introduction to SQLite in Adobe AIR
 
Developing Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web ApplicationDeveloping Next-Gen Enterprise Web Application
Developing Next-Gen Enterprise Web Application
 
Why Standards-Based Drivers Offer Better API Integration
Why Standards-Based Drivers Offer Better API IntegrationWhy Standards-Based Drivers Offer Better API Integration
Why Standards-Based Drivers Offer Better API Integration
 
Why Standards-Based Drivers Offer Better API Integration
Why Standards-Based Drivers Offer Better API IntegrationWhy Standards-Based Drivers Offer Better API Integration
Why Standards-Based Drivers Offer Better API Integration
 
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
Full Stack Development With Node.Js And NoSQL (Nic Raboy & Arun Gupta)
 
Scalable web application architecture
Scalable web application architectureScalable web application architecture
Scalable web application architecture
 
Webinar: What's New in Solr 6
Webinar: What's New in Solr 6Webinar: What's New in Solr 6
Webinar: What's New in Solr 6
 
Windows Azure and a little SQL Data Services
Windows Azure and a little SQL Data ServicesWindows Azure and a little SQL Data Services
Windows Azure and a little SQL Data Services
 
Silverlight & WCF RIA
Silverlight & WCF RIASilverlight & WCF RIA
Silverlight & WCF RIA
 
Access Data from XPages with the Relational Controls
Access Data from XPages with the Relational ControlsAccess Data from XPages with the Relational Controls
Access Data from XPages with the Relational Controls
 
Naver_alternative_to_jpa
Naver_alternative_to_jpaNaver_alternative_to_jpa
Naver_alternative_to_jpa
 
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
Analytics Metrics delivery and ML Feature visualization: Evolution of Data Pl...
 
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5TechDays 2013 Jari Kallonen: What's New WebForms 4.5
TechDays 2013 Jari Kallonen: What's New WebForms 4.5
 
NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020NoSQL Endgame DevoxxUA Conference 2020
NoSQL Endgame DevoxxUA Conference 2020
 
Going Serverless with Azure Functions
Going Serverless with Azure FunctionsGoing Serverless with Azure Functions
Going Serverless with Azure Functions
 
Linq
LinqLinq
Linq
 
Make your gui shine with ajax solr
Make your gui shine with ajax solrMake your gui shine with ajax solr
Make your gui shine with ajax solr
 
ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)ADL/U-SQL Introduction (SQLBits 2016)
ADL/U-SQL Introduction (SQLBits 2016)
 
Migrating on premises workload to azure sql database
Migrating on premises workload to azure sql databaseMigrating on premises workload to azure sql database
Migrating on premises workload to azure sql database
 
GraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learnedGraphQL - when REST API is not enough - lessons learned
GraphQL - when REST API is not enough - lessons learned
 

Último

如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
zifhagzkk
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Bertram Ludäscher
 
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
wsppdmt
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
acoha1
 
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
Obat Aborsi 088980685493 Jual Obat Aborsi
 
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
jk0tkvfv
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Valters Lauzums
 
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
varanasisatyanvesh
 
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
q6pzkpark
 
Displacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second DerivativesDisplacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second Derivatives
23050636
 

Último (20)

Solution manual for managerial accounting 8th edition by john wild ken shaw b...
Solution manual for managerial accounting 8th edition by john wild ken shaw b...Solution manual for managerial accounting 8th edition by john wild ken shaw b...
Solution manual for managerial accounting 8th edition by john wild ken shaw b...
 
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
如何办理(Dalhousie毕业证书)达尔豪斯大学毕业证成绩单留信学历认证
 
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
Statistics Informed Decisions Using Data 5th edition by Michael Sullivan solu...
 
Predictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting TechniquesPredictive Precipitation: Advanced Rain Forecasting Techniques
Predictive Precipitation: Advanced Rain Forecasting Techniques
 
Ranking and Scoring Exercises for Research
Ranking and Scoring Exercises for ResearchRanking and Scoring Exercises for Research
Ranking and Scoring Exercises for Research
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 
What is Insertion Sort. Its basic information
What is Insertion Sort. Its basic informationWhat is Insertion Sort. Its basic information
What is Insertion Sort. Its basic information
 
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...Reconciling Conflicting Data Curation Actions:  Transparency Through Argument...
Reconciling Conflicting Data Curation Actions: Transparency Through Argument...
 
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxRESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
 
Bios of leading Astrologers & Researchers
Bios of leading Astrologers & ResearchersBios of leading Astrologers & Researchers
Bios of leading Astrologers & Researchers
 
How to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data AnalyticsHow to Transform Clinical Trial Management with Advanced Data Analytics
How to Transform Clinical Trial Management with Advanced Data Analytics
 
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
如何办理澳洲拉筹伯大学毕业证(LaTrobe毕业证书)成绩单原件一模一样
 
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
如何办理(WashU毕业证书)圣路易斯华盛顿大学毕业证成绩单本科硕士学位证留信学历认证
 
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
Jual Obat Aborsi Lhokseumawe ( Asli No.1 ) 088980685493 Obat Penggugur Kandun...
 
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
如何办理(UCLA毕业证书)加州大学洛杉矶分校毕业证成绩单学位证留信学历认证原件一样
 
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
Data Analytics for Digital Marketing Lecture for Advanced Digital & Social Me...
 
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...Simplify hybrid data integration at an enterprise scale. Integrate all your d...
Simplify hybrid data integration at an enterprise scale. Integrate all your d...
 
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
一比一原版(曼大毕业证书)曼尼托巴大学毕业证成绩单留信学历认证一手价格
 
Fuel Efficiency Forecast: Predictive Analytics for a Greener Automotive Future
Fuel Efficiency Forecast: Predictive Analytics for a Greener Automotive FutureFuel Efficiency Forecast: Predictive Analytics for a Greener Automotive Future
Fuel Efficiency Forecast: Predictive Analytics for a Greener Automotive Future
 
Displacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second DerivativesDisplacement, Velocity, Acceleration, and Second Derivatives
Displacement, Velocity, Acceleration, and Second Derivatives
 

SQL for Web APIs - Simplifying Data Access for API Consumers

  • 1. www.cdata.com See the World as a Database SQL for Web APIs Simplifying Data Access for API Consumers Jerod Johnson, Technology Evangelist @jeRodimusPrime @cdatasoftware
  • 2. www.cdata.com 1. Popular APIs with SQL Endpoints 2. Why SQL? 3. Integration Challenges 4. Standard Drivers 5. Case Study: Bouqet.ai Agenda
  • 3. www.cdata.com Popular APIs with SQL Functionality Other APIs: Standard SQL N1QL & SQL++ SOQL & SOSL Featured:
  • 4. www.cdata.com Google BigQuery – Standard SQL Standard SQL • Adheres to the SQL 2011 standard • WITH clauses and SQL functions • Subqueries (in SELECT and WHERE) • ARRAY and STRUCT types • Inserts, updates, and deletes • JOINs Popular APIs with SQL Functionality Python Example: # from google.cloud import bigquery # client = bigquery.Client() query = ( "SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` " 'WHERE state = "TX" ' "LIMIT 100" ) query_job = client.query( query, # Location must match that of the dataset(s) referenced in the query. location="US", ) # API request - starts the query for row in query_job: # API request - fetches results # Row values can be accessed by field name or index assert row[0] == row.name == row["name"] print(row)
  • 5. www.cdata.com Salesforce – SOQL & SOSL Salesforce Object Query Language • Provides SQL-like access to Salesforce objects • Format SELECT one or more fields FROM an object WHERE filter statements/ordering JavaScript query Example: Popular APIs with SQL Functionality Salesforce Object Search Language • Provides text-based searching of Salesforce objects • Format FIND SeachQuery IN SearchGroup JavaScript search Example: var result = sforce.connection.query( "Select Name, Id from User"); records = result.getArray("records"); for (var i=0; i < records.length; i++) { var record = records[i]; log(record.Name + " -- " + record.Id); } var result = sforce.connection.search( "FIND {jane} IN NAME FIELDS RETURNING Account(name, id)"); if (result) { var records = result.getArray("searchRecords"); for (var i=0; i < records.length; i++) { var record = records[i].record; log(record.Id + " -- " + record.Name); } }
  • 6. www.cdata.com Couchbase – N1QL & SQL++ • Both provide SQL-like syntax for JSON documents for different Couchbase services • Format SELECT one or more fields FROM a document WHERE filter statements/ordering • Dot notation to “drill down” • Returns a JSON document Popular APIs with SQL Functionality Node.js N1qlQuery Example var N1qlQuery = couchbase.N1qlQuery; query = N1qlQuery.fromString('SELECT name, contact.email FROM default'); bucket.query(query, function(err, rows, meta) { for (row in rows) { console.log('Name: %s. Email: %s', row.name, row.email); } }); Node.js AnalyticsQuery Example var query = couchbase.AnalyticsQuery.fromString( "SELECT airportname, address.country" + "FROM airports WHERE address.country=?"); bucket.query(query, ['France’], function(err, rows) { // ... });
  • 7. www.cdata.com Why SQL? • Self-describing API: objects, fields, functions are all defined & discoverable • Ease of integration & application development • Simplified interfacing with popular tooling • Leverage server-side processing • Examples: • Retrieve data from multiple related objects • Retrieve parts of fields (numbers, dates, or checkboxes/flags) • Count the number of records that meet specified criteria • Sort results as part of the query
  • 8. www.cdata.com Integration Challenges • SQL access ≠ SQL response • SQL access is not uniform across APIs • Not all APIs provide SQL access • Roughly 2,000 new public APIs per year
  • 9. www.cdata.com LEGACY TECHNOLOGY SaaS APPLICATION 2017 State of the SaaS-Powered Workplace Can your API Integrations Keep Up? 58% of companies are running almost completely on SaaS. API Challenges
  • 10. www.cdata.com Standard Drivers – SQL Access to SaaS Applications • Ubiquitous technologies like JDBC, ODBC, & ADO.NET • Historically used to integrate with databases • Vendors now create drivers for SaaS applications ADO.NET ODATAJDBCODBC
  • 11. www.cdata.com Modeling APIs through SQL • Tables and views correspond with resource collections (Orders, Accounts, Pages, Users, etc.) • Individual elements correspond to a row • Sub-collection relationships are maintained (Orders and Order Line Items) • CRUD operations are translated to SQL statements • Operations and functions are implemented with stored procedures Standard Drivers
  • 12. www.cdata.com SQL-92 Compliant Queries The easiest way to build data-centric applications. Write standard SQL queries with support for JOINs, updates, aggregation, and more. SELECT Account.Id, Account.Name, Account.Fax, Opportunity.AccountId, Opportunity.CloseDate FROM Salesforce.Account INNER JOIN Salesforce.Opportunity ON Account.Id = Opportunity.AccountId SELECT WITH INNER JOIN UPDATE Account SET Name='John' WHERE Id = @myId UPDATE DATA SELECT State, AVG(AnnualRevenue) FROM Account GROUP BY State AGGREGATE FUNCTIONS Properties prop = new Properties(); prop.setProperty("User","myUser"); prop.setProperty("Password","myPassword"); prop.setProperty("Security Token","myToken"); Connection conn = DriverManager.getConnection("jdbc:salesforce:",prop); Statement stat = conn.createStatement(); boolean ret = stat.execute("SELECT BillingState, Name FROM Account"); if (ret) { ResultSet rs=stat.getResultSet(); while(rs.next()) { for(int i = 1; i <= rs.getMetaData().getColumnCount(); i++) { System.out.println(rs.getMetaData().getColumnName(i) + "=" + rs.getString(i)); } } } One SDK / API to Learn & Implement Just like connecting with a typical RDBMS like SQL. Use standard classes like Properties, Connection, DriverManager, Statement, ResultSet, etc. Simplify Developer Integration Standard Drivers
  • 13. www.cdata.com Natural language AI platform, Aris extends data connectivity with CData and the power of SQL abstraction. Mapping natural language queries to SQL highlights the transformative power of a SQL data abstraction, as it would be nearly impossible to map these dynamic queries to SaaS data any other way. More Online: https://www.cdata.com/case-study/bouquet/ Case Study: Bouqet.ai
  • 14. www.cdata.com The Takeaway – SQL Benefits for ALL APIs • SQL continues to be the “lingua franca” for data access • API growth continues unabated • Standard drivers offer simplified integration • Rapid application development • Ease of use for citizen analysts • Insulation from API changes Want to know more? email: jerodj@cdata.com

Notas do Editor

  1. As the data world evolves, businesses are moving more of their data out of databases and into SaaS applications. Despite the migration, SQL remains a ubiquitous language for data access, so much so that many SaaS applications and non-relational cloud data stores support SQL endpoints in their APIs. While these endpoints allow users to leverage SQL queries to easily request data, there are still costly challenges to overcome when it comes to processing and managing the returned data. In this session, we'll showcase popular APIs that offer SQL endpoints, explore the benefits of providing customers SQL access, and cover how standards-based drivers enable SaaS integration and self-service data access through SQL.