PostgreSQL SQL-MED Ibrar Ahmed Senior Software Engineer @ Percona - - PowerPoint PPT Presentation

postgresql sql med
SMART_READER_LITE
LIVE PREVIEW

PostgreSQL SQL-MED Ibrar Ahmed Senior Software Engineer @ Percona - - PowerPoint PPT Presentation

PostgreSQL SQL-MED Ibrar Ahmed Senior Software Engineer @ Percona PostgreSQL Consultant What? Is an relational database Licence PostgreSQL: Released under the PostgreSQL management system (RDBMS) License. (Similar to the BSD or MIT)


slide-1
SLIDE 1

PostgreSQL SQL-MED

Ibrar Ahmed Senior Software Engineer @ Percona PostgreSQL Consultant

slide-2
SLIDE 2

!2

What? •

Is an relational database management system (RDBMS)

  • Is a Object-Relation Database

Management System(ORDBMS)

Why?

  • One of the finest open source relation

database which has some object-

  • riented features.
  • PostgreSQL is free.
  • PostgreSQL is Open Source.
  • PostgreSQL Conform to the ANSI-SQL:

2008.

  • PostgreSQL is ACID (Atomicity,

Consistency, Isolation and Durability) Complaint.

Who? • Web technology

  • Financial
  • No-SQL Workload
  • Small & Large Scale Business

Licence

PostgreSQL: Released under the PostgreSQL

  • License. (Similar to the BSD or MIT)

Support?

There are many companies providing professional support for PostgreSQL.

slide-3
SLIDE 3

SELECT data from multiple “Database Engines” and generate results?

Accessing Data From Multiple Sources

Is it possible? Is it possible within Database Engine

slide-4
SLIDE 4

libmysqlclient libpq libmongo-c JDBC File System API U S E R A P P L I C A T I O N

PostgreSQ L

Module

MongoDB

Module

JDBC

Module

File System

Module

MySQL

Module

… JDBC

Application Architecture 1/2

Join

slide-5
SLIDE 5

SQL-MED

Management of External Data

  • SQL standard, It is defined by ISO/IEC 9075-9:2008
  • SQL/MED provides extensions to SQL that define FDW ( Foreign Data Wrapper)
  • PostgreSQL start implementing in its core since PostgreSQL version 9.1
  • PostgreSQL community builds its own few postgresql_fdw.
  • Now there are many FDW implemented by other people.

https://wiki.postgresql.org/wiki/Foreign_data_wrappers

What do you mean by start implementing? Do we really need to implement separate extension?

slide-6
SLIDE 6

U S E R A P P L I C A T I O N

PostgreSQL Module

libmysqlclient libpq libmongoc JDBC File System API JDBC libpq

postgres_fdw mogo_fdw hdfs_fdw hdfs_fdw

mysql_fdw

file_fdw

Join Filter Aggregate

Connection Pooling

Application Architecture 2/2

slide-7
SLIDE 7

PostgreSQL Foreign Data Wrapper

  • DML Support*
  • Query Splitting
  • Joins
  • Aggregate
  • Connection Pooling
slide-8
SLIDE 8

PostgreSQL Foreign Data Wrapper Push Down

  • Quals pushdown
  • Joins Push Down
  • Aggregate Push Down
slide-9
SLIDE 9

> db.mongo_tbl.find() { "_id" : ObjectId("5b64d9628365b615c035bcba"), "id" : 1, "data" : "Item" } { "_id" : ObjectId("5b64d97c8365b615c035bcbb"), "id" : 2, "data" : "Item-2" } { "_id" : ObjectId("5b64d9818365b615c035bcbc"), "id" : 3, "data" : "Item-3" }

SELECT * FROM mysql_tbl;

  • SELECT count(*)

FROM mysql_tbl AS mysql, mongo_tbl AS mongo WHERE mongo.id = mysql.id;

  • CREATE EXTENSION mysql_fdw;
  • CREATE SERVER mysql_svr

FOREIGN DATA WRAPPER mysql_fdw OPTIONS (host ‘127.0.0.1’, port '5432', dbname 'db');

  • CREATE USER MAPPING FOR postgres

SERVER foreign_server OPTIONS (user ‘mysql_user', password ‘mysql_pass');

  • CREATE FOREIGN TABLE mysql_tbl (

id integer NOT NULL, data text )

  • CREATE EXTENSION mongo_fdw;
  • CREATE SERVER mongo_svr

FOREIGN DATA WRAPPER mongo_fdw OPTIONS (host ‘127.0.0.1’, port '5432', dbname 'db');

  • CREATE USER MAPPING FOR postgres

SERVER mongo_svr OPTIONS (user ‘mongo_user', password ‘mongo_pass');

  • CREATE FOREIGN TABLE mongo_tbl (

id integer NOT NULL, data text )

PostgreSQL Foreign Data Wrapper Executing Query

slide-10
SLIDE 10

– Steve Jobs

“It's not a faith in technology. It's faith in people.