SlideShare a Scribd company logo
1 of 17
PostgreSQL 9.5
Foreign Data Wrappers
Pittsburgh PostgreSQL Users Group
2016 April 20
Nicholas Kiraly
github.com/nkiraly
Twitter @NicholasKiraly
kiraly.nicholas@gmail.com
Introductions
Systems Integration Engineer
Open Source / PostgreSQL / FreeBSD Advocate
To play along with today’s examples, vagrant up with
https://github.com/nkiraly/koadstation/tree/master/dbdevu14
Comments and additions welcome during this presentation.
SQL and other code examples can be found at
https://github.com/nkiraly/jhe-demo/tree/master/
What are Foreign Data Wrappers?
Implementation of SQL/MED specification - “SQL Management of External Data”
Read and write to remote data stores such as MySQL, Redis, RSS, LDAP, HDFS, et
cetera.
These wrappers enable the database developer to serve, analyze, ETL, and index data
from these remote stores with all the advantages of PostgreSQL types, partial indexes,
PL/pgSQL functions, et al.
For more details, see https://wiki.postgresql.org/wiki/Foreign_data_wrappers
How do Foreign Data Wrappers work?
Implemented as
native C Postgres extension
C Skeleton Blackhole https://bitbucket.org/adunstan/blackhole_fdw
wrapper extension language such as
Python with Multicorn http://multicorn.org/
Ruby with Holycorn https://github.com/franckverrot/holycorn
Providing a postgresql extension that exports FDW handler and validator functions.
Then you can define foreign tables with CREATE FOREIGN TABLE .. SERVER ;
Use cases for Foreign Data Wrappers
ETL source or target
Backup source or target
Normalization / denormalization of data for use by analytics
GPU accelerated sequential scan - PGStrom is a scan provider utilizing CUDA for
parallel scans of large sequences with complex qualifiers
Legacy or varied systems integration platform for analytics or next generation
development
Utilization of large external or real time data like OpenStreetMaps PBF or USGS
seismic data API.
Creating a Foreign Data Wrapper
Example in C - Blackhole
https://bitbucket.org/adunstan/blackhole_fdw/src/fe87f38a8dda40cba43b67a6cd20834b7bf0fe9d/src
/blackhole_fdw.c
Python Platform - Multicorn
http://multicorn.org/implementing-an-fdw/
Declarative
SQL Examples
Install Extension
Foreign Server
User Mapping
Foreign Table
with postgres_fdw
Install / Enable Postgres FDW
CREATE EXTENSION postgres_fdw;
Defining a foreign Postgres Server
CREATE SERVER foreign_server
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host '10.22.33.45', port '5432', dbname 'foreign_db');
Defining a foreign User Mapping
CREATE USER MAPPING FOR local_user
SERVER foreign_server
OPTIONS (user 'foreign_user', password 'password');
CREATE USER MAPPING FOR PUBLIC
SERVER foreign_server
OPTIONS (user 'foreign_readonlyuser', password 'password');
Defining a foreign Postgres Table
CREATE FOREIGN TABLE foreign_users (
user_id integer NOT NULL,
user_name data text,
user_profile text
)
SERVER foreign_server
OPTIONS (schema_name 'some_schema', table_name 'some_table');
Systems
Integration
Demo
Storage Systems in Place
Yard Inventory - CSV
Yard Sales - CSV
Online Inventory - Redis 3.0
Online Sales - MySQL 5.7
for
Janey Heavy Equipment
Yard Inventory / Sales- CSV
Online Inventory - Redis 3.0
Online Sales - MySQL 5.7
PostgreSQL 9.5
Foreign Data Wrappers
Questions ? Answers !
Feedbacks $#!7$%
SELECT
implementation,
knowledge,
take_aways
FROM foreign_server
WHERE
dat_foreign_data_tho
IS NOT NULL
Nicholas Kiraly
github.com/nkiraly
Twitter @NicholasKiraly
kiraly.nicholas@gmail.com
References
FDW Overview https://wiki.postgresql.org/wiki/Foreign_data_wrappers
CSV FDW http://www.postgresql.org/docs/9.5/static/file-fdw.html
Redis FDW https://github.com/nahanni/rw_redis_fdw
MySQL FDW https://github.com/EnterpriseDB/mysql_fdw
PostgreSQL http://www.postgresql.org/docs/current/static/postgres-fdw.html

More Related Content

What's hot

PXF HAWQ Unmanaged Data
PXF HAWQ Unmanaged DataPXF HAWQ Unmanaged Data
PXF HAWQ Unmanaged DataShivram Mani
 
Introducing JDBC for SPARQL
Introducing JDBC for SPARQLIntroducing JDBC for SPARQL
Introducing JDBC for SPARQLRob Vesse
 
Bio2RDF - Make the most of Virtuoso Open Source
Bio2RDF - Make the most of Virtuoso Open SourceBio2RDF - Make the most of Virtuoso Open Source
Bio2RDF - Make the most of Virtuoso Open Sourcealison.callahan
 
Serving Images with GridFS
Serving Images with GridFSServing Images with GridFS
Serving Images with GridFSMark Smalley
 
Jan 2013 HUG: Dist cpv2 for hug 20130116
Jan 2013 HUG: Dist cpv2 for hug 20130116Jan 2013 HUG: Dist cpv2 for hug 20130116
Jan 2013 HUG: Dist cpv2 for hug 20130116Yahoo Developer Network
 
Draft slide of Demystifying DHT in GlusterFS
Draft slide of Demystifying DHT in GlusterFSDraft slide of Demystifying DHT in GlusterFS
Draft slide of Demystifying DHT in GlusterFSAnkit Raj
 
Lodstats: The Data Web Census Dataset. Kobe, Japan, 2016
Lodstats: The Data Web Census Dataset. Kobe, Japan, 2016Lodstats: The Data Web Census Dataset. Kobe, Japan, 2016
Lodstats: The Data Web Census Dataset. Kobe, Japan, 2016Ivan Ermilov
 
Level 101 for Presto: What is PrestoDB?
Level 101 for Presto: What is PrestoDB?Level 101 for Presto: What is PrestoDB?
Level 101 for Presto: What is PrestoDB?Ali LeClerc
 
Hypertable Berlin Buzzwords
Hypertable Berlin BuzzwordsHypertable Berlin Buzzwords
Hypertable Berlin Buzzwordshypertable
 
DHT2 - O Brother, Where Art Thou with Shyam Ranganathan
DHT2 - O Brother, Where Art Thou with 	Shyam RanganathanDHT2 - O Brother, Where Art Thou with 	Shyam Ranganathan
DHT2 - O Brother, Where Art Thou with Shyam RanganathanGluster.org
 
Webinar - Approaching 1 billion documents with MongoDB
Webinar - Approaching 1 billion documents with MongoDBWebinar - Approaching 1 billion documents with MongoDB
Webinar - Approaching 1 billion documents with MongoDBBoxed Ice
 
Contributing Code to Dataverse by Gustavo Durand
Contributing Code to Dataverse by Gustavo DurandContributing Code to Dataverse by Gustavo Durand
Contributing Code to Dataverse by Gustavo Duranddatascienceiqss
 
Comparison between OCFS2 and GFS2
Comparison between OCFS2 and GFS2Comparison between OCFS2 and GFS2
Comparison between OCFS2 and GFS2Gang He
 
shark attack on sql-on-hadoop Talk at BerlinBuzzwords 2014
shark attack on sql-on-hadoop Talk at BerlinBuzzwords 2014shark attack on sql-on-hadoop Talk at BerlinBuzzwords 2014
shark attack on sql-on-hadoop Talk at BerlinBuzzwords 2014Gerd König
 
OpenStreetMap in the age of Spark
OpenStreetMap in the age of SparkOpenStreetMap in the age of Spark
OpenStreetMap in the age of SparkAdrian Bona
 

What's hot (20)

PXF HAWQ Unmanaged Data
PXF HAWQ Unmanaged DataPXF HAWQ Unmanaged Data
PXF HAWQ Unmanaged Data
 
Introducing JDBC for SPARQL
Introducing JDBC for SPARQLIntroducing JDBC for SPARQL
Introducing JDBC for SPARQL
 
Bio2RDF - Make the most of Virtuoso Open Source
Bio2RDF - Make the most of Virtuoso Open SourceBio2RDF - Make the most of Virtuoso Open Source
Bio2RDF - Make the most of Virtuoso Open Source
 
Serving Images with GridFS
Serving Images with GridFSServing Images with GridFS
Serving Images with GridFS
 
Jan 2013 HUG: Dist cpv2 for hug 20130116
Jan 2013 HUG: Dist cpv2 for hug 20130116Jan 2013 HUG: Dist cpv2 for hug 20130116
Jan 2013 HUG: Dist cpv2 for hug 20130116
 
Draft slide of Demystifying DHT in GlusterFS
Draft slide of Demystifying DHT in GlusterFSDraft slide of Demystifying DHT in GlusterFS
Draft slide of Demystifying DHT in GlusterFS
 
PXF BDAM 2016
PXF BDAM 2016PXF BDAM 2016
PXF BDAM 2016
 
Lodstats: The Data Web Census Dataset. Kobe, Japan, 2016
Lodstats: The Data Web Census Dataset. Kobe, Japan, 2016Lodstats: The Data Web Census Dataset. Kobe, Japan, 2016
Lodstats: The Data Web Census Dataset. Kobe, Japan, 2016
 
Level 101 for Presto: What is PrestoDB?
Level 101 for Presto: What is PrestoDB?Level 101 for Presto: What is PrestoDB?
Level 101 for Presto: What is PrestoDB?
 
Circos
CircosCircos
Circos
 
Hypertable Berlin Buzzwords
Hypertable Berlin BuzzwordsHypertable Berlin Buzzwords
Hypertable Berlin Buzzwords
 
DHT2 - O Brother, Where Art Thou with Shyam Ranganathan
DHT2 - O Brother, Where Art Thou with 	Shyam RanganathanDHT2 - O Brother, Where Art Thou with 	Shyam Ranganathan
DHT2 - O Brother, Where Art Thou with Shyam Ranganathan
 
Webinar - Approaching 1 billion documents with MongoDB
Webinar - Approaching 1 billion documents with MongoDBWebinar - Approaching 1 billion documents with MongoDB
Webinar - Approaching 1 billion documents with MongoDB
 
Dedupe nmamit
Dedupe nmamitDedupe nmamit
Dedupe nmamit
 
Alluxio
AlluxioAlluxio
Alluxio
 
Oracle 12c revealed Demonstration
Oracle 12c revealed DemonstrationOracle 12c revealed Demonstration
Oracle 12c revealed Demonstration
 
Contributing Code to Dataverse by Gustavo Durand
Contributing Code to Dataverse by Gustavo DurandContributing Code to Dataverse by Gustavo Durand
Contributing Code to Dataverse by Gustavo Durand
 
Comparison between OCFS2 and GFS2
Comparison between OCFS2 and GFS2Comparison between OCFS2 and GFS2
Comparison between OCFS2 and GFS2
 
shark attack on sql-on-hadoop Talk at BerlinBuzzwords 2014
shark attack on sql-on-hadoop Talk at BerlinBuzzwords 2014shark attack on sql-on-hadoop Talk at BerlinBuzzwords 2014
shark attack on sql-on-hadoop Talk at BerlinBuzzwords 2014
 
OpenStreetMap in the age of Spark
OpenStreetMap in the age of SparkOpenStreetMap in the age of Spark
OpenStreetMap in the age of Spark
 

Viewers also liked

Postgresql 9.3 overview
Postgresql 9.3 overviewPostgresql 9.3 overview
Postgresql 9.3 overviewAveic
 
PostgreSQL: Welcome To Total Security
PostgreSQL: Welcome To Total SecurityPostgreSQL: Welcome To Total Security
PostgreSQL: Welcome To Total SecurityRobert Bernier
 
Using the PostgreSQL Extension Ecosystem for Advanced Analytics
Using the PostgreSQL Extension Ecosystem for Advanced AnalyticsUsing the PostgreSQL Extension Ecosystem for Advanced Analytics
Using the PostgreSQL Extension Ecosystem for Advanced AnalyticsChartio
 
PostgreSQL9.3 Switchover/Switchback
PostgreSQL9.3 Switchover/SwitchbackPostgreSQL9.3 Switchover/Switchback
PostgreSQL9.3 Switchover/SwitchbackVibhor Kumar
 
Useful PostgreSQL Extensions
Useful PostgreSQL ExtensionsUseful PostgreSQL Extensions
Useful PostgreSQL ExtensionsEDB
 
外部データラッパによる PostgreSQL の拡張
外部データラッパによる PostgreSQL の拡張外部データラッパによる PostgreSQL の拡張
外部データラッパによる PostgreSQL の拡張Shigeru Hanada
 
The GRASS GIS software (with QGIS) - GIS Seminar
The GRASS GIS software (with QGIS) - GIS SeminarThe GRASS GIS software (with QGIS) - GIS Seminar
The GRASS GIS software (with QGIS) - GIS SeminarMarkus Neteler
 

Viewers also liked (9)

PostgreSQL and XML
PostgreSQL and XMLPostgreSQL and XML
PostgreSQL and XML
 
Postgresql 9.3 overview
Postgresql 9.3 overviewPostgresql 9.3 overview
Postgresql 9.3 overview
 
PostgreSQL: Welcome To Total Security
PostgreSQL: Welcome To Total SecurityPostgreSQL: Welcome To Total Security
PostgreSQL: Welcome To Total Security
 
Using the PostgreSQL Extension Ecosystem for Advanced Analytics
Using the PostgreSQL Extension Ecosystem for Advanced AnalyticsUsing the PostgreSQL Extension Ecosystem for Advanced Analytics
Using the PostgreSQL Extension Ecosystem for Advanced Analytics
 
PostgreSQL9.3 Switchover/Switchback
PostgreSQL9.3 Switchover/SwitchbackPostgreSQL9.3 Switchover/Switchback
PostgreSQL9.3 Switchover/Switchback
 
Useful PostgreSQL Extensions
Useful PostgreSQL ExtensionsUseful PostgreSQL Extensions
Useful PostgreSQL Extensions
 
外部データラッパによる PostgreSQL の拡張
外部データラッパによる PostgreSQL の拡張外部データラッパによる PostgreSQL の拡張
外部データラッパによる PostgreSQL の拡張
 
The GRASS GIS software (with QGIS) - GIS Seminar
The GRASS GIS software (with QGIS) - GIS SeminarThe GRASS GIS software (with QGIS) - GIS Seminar
The GRASS GIS software (with QGIS) - GIS Seminar
 
PostgreSQL 9.5 新機能紹介
PostgreSQL 9.5 新機能紹介PostgreSQL 9.5 新機能紹介
PostgreSQL 9.5 新機能紹介
 

Similar to PostgreSQL 9.5 Foreign Data Wrappers

Foreign Data Wrappers and You with Postgres
Foreign Data Wrappers and You with PostgresForeign Data Wrappers and You with Postgres
Foreign Data Wrappers and You with PostgresEDB
 
EKAW - Publishing with Triple Pattern Fragments
EKAW - Publishing with Triple Pattern FragmentsEKAW - Publishing with Triple Pattern Fragments
EKAW - Publishing with Triple Pattern FragmentsRuben Taelman
 
SQL/MED: Doping for PostgreSQL
SQL/MED: Doping for PostgreSQLSQL/MED: Doping for PostgreSQL
SQL/MED: Doping for PostgreSQLPeter Eisentraut
 
Virtuoso RDF Triple Store Analysis Benchmark & mapping tools RDF / OO
Virtuoso RDF Triple Store Analysis Benchmark & mapping tools RDF / OOVirtuoso RDF Triple Store Analysis Benchmark & mapping tools RDF / OO
Virtuoso RDF Triple Store Analysis Benchmark & mapping tools RDF / OOPaolo Cristofaro
 
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico CaldaraTrivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico CaldaraTrivadis
 
Denodo Partner Connect: Technical Webinar - Ask Me Anything
Denodo Partner Connect: Technical Webinar - Ask Me AnythingDenodo Partner Connect: Technical Webinar - Ask Me Anything
Denodo Partner Connect: Technical Webinar - Ask Me AnythingDenodo
 
Federated Queries Across Both Different Storage Mediums and Different Data En...
Federated Queries Across Both Different Storage Mediums and Different Data En...Federated Queries Across Both Different Storage Mediums and Different Data En...
Federated Queries Across Both Different Storage Mediums and Different Data En...VMware Tanzu
 
PostgreSQL ecosystem
PostgreSQL ecosystemPostgreSQL ecosystem
PostgreSQL ecosystemJosé Lin
 
map3d_mapguide_postgis
map3d_mapguide_postgismap3d_mapguide_postgis
map3d_mapguide_postgisPrasad PANDIT
 
Osgis 2010 notes
Osgis 2010 notesOsgis 2010 notes
Osgis 2010 notesJoanne Cook
 
Machine Learning with H2O, Spark, and Python at Strata 2015
Machine Learning with H2O, Spark, and Python at Strata 2015Machine Learning with H2O, Spark, and Python at Strata 2015
Machine Learning with H2O, Spark, and Python at Strata 2015Sri Ambati
 
Reactive dashboard’s using apache spark
Reactive dashboard’s using apache sparkReactive dashboard’s using apache spark
Reactive dashboard’s using apache sparkRahul Kumar
 
Virtuoso Sponger - RDFizer Middleware for creating RDF from non RDF Data Sources
Virtuoso Sponger - RDFizer Middleware for creating RDF from non RDF Data SourcesVirtuoso Sponger - RDFizer Middleware for creating RDF from non RDF Data Sources
Virtuoso Sponger - RDFizer Middleware for creating RDF from non RDF Data Sourcesrumito
 
DAC4B 2015 - Polybase
DAC4B 2015 - PolybaseDAC4B 2015 - Polybase
DAC4B 2015 - PolybaseŁukasz Grala
 
Drupal8 migrate
Drupal8 migrateDrupal8 migrate
Drupal8 migrateJohn Doyle
 
Big Data Europe: Simplifying Development and Deployment of Big Data Applications
Big Data Europe: Simplifying Development and Deployment of Big Data ApplicationsBig Data Europe: Simplifying Development and Deployment of Big Data Applications
Big Data Europe: Simplifying Development and Deployment of Big Data ApplicationsBigData_Europe
 
Real time analytics at uber @ strata data 2019
Real time analytics at uber @ strata data 2019Real time analytics at uber @ strata data 2019
Real time analytics at uber @ strata data 2019Zhenxiao Luo
 
Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresqlbotsplash.com
 

Similar to PostgreSQL 9.5 Foreign Data Wrappers (20)

Foreign Data Wrappers and You with Postgres
Foreign Data Wrappers and You with PostgresForeign Data Wrappers and You with Postgres
Foreign Data Wrappers and You with Postgres
 
EKAW - Publishing with Triple Pattern Fragments
EKAW - Publishing with Triple Pattern FragmentsEKAW - Publishing with Triple Pattern Fragments
EKAW - Publishing with Triple Pattern Fragments
 
SQL/MED: Doping for PostgreSQL
SQL/MED: Doping for PostgreSQLSQL/MED: Doping for PostgreSQL
SQL/MED: Doping for PostgreSQL
 
Virtuoso RDF Triple Store Analysis Benchmark & mapping tools RDF / OO
Virtuoso RDF Triple Store Analysis Benchmark & mapping tools RDF / OOVirtuoso RDF Triple Store Analysis Benchmark & mapping tools RDF / OO
Virtuoso RDF Triple Store Analysis Benchmark & mapping tools RDF / OO
 
SFScon 2020 - Peter Hopfgartner - Open Data de luxe
SFScon 2020 - Peter Hopfgartner - Open Data de luxeSFScon 2020 - Peter Hopfgartner - Open Data de luxe
SFScon 2020 - Peter Hopfgartner - Open Data de luxe
 
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico CaldaraTrivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
Trivadis TechEvent 2017 PostgreSQL für die (Orakel) DBA by Ludovico Caldara
 
Denodo Partner Connect: Technical Webinar - Ask Me Anything
Denodo Partner Connect: Technical Webinar - Ask Me AnythingDenodo Partner Connect: Technical Webinar - Ask Me Anything
Denodo Partner Connect: Technical Webinar - Ask Me Anything
 
Federated Queries Across Both Different Storage Mediums and Different Data En...
Federated Queries Across Both Different Storage Mediums and Different Data En...Federated Queries Across Both Different Storage Mediums and Different Data En...
Federated Queries Across Both Different Storage Mediums and Different Data En...
 
PostgreSQL ecosystem
PostgreSQL ecosystemPostgreSQL ecosystem
PostgreSQL ecosystem
 
map3d_mapguide_postgis
map3d_mapguide_postgismap3d_mapguide_postgis
map3d_mapguide_postgis
 
Osgis 2010 notes
Osgis 2010 notesOsgis 2010 notes
Osgis 2010 notes
 
SQL/MED and PostgreSQL
SQL/MED and PostgreSQLSQL/MED and PostgreSQL
SQL/MED and PostgreSQL
 
Machine Learning with H2O, Spark, and Python at Strata 2015
Machine Learning with H2O, Spark, and Python at Strata 2015Machine Learning with H2O, Spark, and Python at Strata 2015
Machine Learning with H2O, Spark, and Python at Strata 2015
 
Reactive dashboard’s using apache spark
Reactive dashboard’s using apache sparkReactive dashboard’s using apache spark
Reactive dashboard’s using apache spark
 
Virtuoso Sponger - RDFizer Middleware for creating RDF from non RDF Data Sources
Virtuoso Sponger - RDFizer Middleware for creating RDF from non RDF Data SourcesVirtuoso Sponger - RDFizer Middleware for creating RDF from non RDF Data Sources
Virtuoso Sponger - RDFizer Middleware for creating RDF from non RDF Data Sources
 
DAC4B 2015 - Polybase
DAC4B 2015 - PolybaseDAC4B 2015 - Polybase
DAC4B 2015 - Polybase
 
Drupal8 migrate
Drupal8 migrateDrupal8 migrate
Drupal8 migrate
 
Big Data Europe: Simplifying Development and Deployment of Big Data Applications
Big Data Europe: Simplifying Development and Deployment of Big Data ApplicationsBig Data Europe: Simplifying Development and Deployment of Big Data Applications
Big Data Europe: Simplifying Development and Deployment of Big Data Applications
 
Real time analytics at uber @ strata data 2019
Real time analytics at uber @ strata data 2019Real time analytics at uber @ strata data 2019
Real time analytics at uber @ strata data 2019
 
Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresql
 

Recently uploaded

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 

Recently uploaded (20)

Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 

PostgreSQL 9.5 Foreign Data Wrappers

  • 1. PostgreSQL 9.5 Foreign Data Wrappers Pittsburgh PostgreSQL Users Group 2016 April 20 Nicholas Kiraly github.com/nkiraly Twitter @NicholasKiraly kiraly.nicholas@gmail.com
  • 2. Introductions Systems Integration Engineer Open Source / PostgreSQL / FreeBSD Advocate To play along with today’s examples, vagrant up with https://github.com/nkiraly/koadstation/tree/master/dbdevu14 Comments and additions welcome during this presentation. SQL and other code examples can be found at https://github.com/nkiraly/jhe-demo/tree/master/
  • 3. What are Foreign Data Wrappers? Implementation of SQL/MED specification - “SQL Management of External Data” Read and write to remote data stores such as MySQL, Redis, RSS, LDAP, HDFS, et cetera. These wrappers enable the database developer to serve, analyze, ETL, and index data from these remote stores with all the advantages of PostgreSQL types, partial indexes, PL/pgSQL functions, et al. For more details, see https://wiki.postgresql.org/wiki/Foreign_data_wrappers
  • 4. How do Foreign Data Wrappers work? Implemented as native C Postgres extension C Skeleton Blackhole https://bitbucket.org/adunstan/blackhole_fdw wrapper extension language such as Python with Multicorn http://multicorn.org/ Ruby with Holycorn https://github.com/franckverrot/holycorn Providing a postgresql extension that exports FDW handler and validator functions. Then you can define foreign tables with CREATE FOREIGN TABLE .. SERVER ;
  • 5. Use cases for Foreign Data Wrappers ETL source or target Backup source or target Normalization / denormalization of data for use by analytics GPU accelerated sequential scan - PGStrom is a scan provider utilizing CUDA for parallel scans of large sequences with complex qualifiers Legacy or varied systems integration platform for analytics or next generation development Utilization of large external or real time data like OpenStreetMaps PBF or USGS seismic data API.
  • 6. Creating a Foreign Data Wrapper Example in C - Blackhole https://bitbucket.org/adunstan/blackhole_fdw/src/fe87f38a8dda40cba43b67a6cd20834b7bf0fe9d/src /blackhole_fdw.c Python Platform - Multicorn http://multicorn.org/implementing-an-fdw/
  • 7. Declarative SQL Examples Install Extension Foreign Server User Mapping Foreign Table with postgres_fdw
  • 8. Install / Enable Postgres FDW CREATE EXTENSION postgres_fdw;
  • 9. Defining a foreign Postgres Server CREATE SERVER foreign_server FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host '10.22.33.45', port '5432', dbname 'foreign_db');
  • 10. Defining a foreign User Mapping CREATE USER MAPPING FOR local_user SERVER foreign_server OPTIONS (user 'foreign_user', password 'password'); CREATE USER MAPPING FOR PUBLIC SERVER foreign_server OPTIONS (user 'foreign_readonlyuser', password 'password');
  • 11. Defining a foreign Postgres Table CREATE FOREIGN TABLE foreign_users ( user_id integer NOT NULL, user_name data text, user_profile text ) SERVER foreign_server OPTIONS (schema_name 'some_schema', table_name 'some_table');
  • 12. Systems Integration Demo Storage Systems in Place Yard Inventory - CSV Yard Sales - CSV Online Inventory - Redis 3.0 Online Sales - MySQL 5.7 for Janey Heavy Equipment
  • 13. Yard Inventory / Sales- CSV
  • 14. Online Inventory - Redis 3.0
  • 15. Online Sales - MySQL 5.7
  • 16. PostgreSQL 9.5 Foreign Data Wrappers Questions ? Answers ! Feedbacks $#!7$% SELECT implementation, knowledge, take_aways FROM foreign_server WHERE dat_foreign_data_tho IS NOT NULL Nicholas Kiraly github.com/nkiraly Twitter @NicholasKiraly kiraly.nicholas@gmail.com
  • 17. References FDW Overview https://wiki.postgresql.org/wiki/Foreign_data_wrappers CSV FDW http://www.postgresql.org/docs/9.5/static/file-fdw.html Redis FDW https://github.com/nahanni/rw_redis_fdw MySQL FDW https://github.com/EnterpriseDB/mysql_fdw PostgreSQL http://www.postgresql.org/docs/current/static/postgres-fdw.html

Editor's Notes

  1. I am a Systems Integration Engineer. To me that means that I take different systems written in different ways with different technology, connect these systems to produce new value with the correlated data or through the interaction of those previously separate systems. Doing this means knowing what technology you already have or you may be planning to deploy can do for you. I am also an advocate for several open source projects and platforms.