SlideShare a Scribd company logo
Application
Development and
Database Choices:
Postgres Support for
non Relational Data
EDB CTO Team
December 2020
Slides and recording will be made available
Submit questions via Zoom – will be answering at end
Welcome – Housekeeping Items
This talk will cover the advanced features of
Postgres that make it the most-loved RDBMS
by developers and a great choice for non-
relational workloads.
Portions of this presentation were taken from https://momjian.us/presentations
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.4
Agenda
The “Post” Relational Database
1.Postgres has won
2.Document-centric applications
3.Geographic Information Systems (GIS)
4.Business intelligence
5.Central data centers
6.Server-side languages
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.5
It is the most loved RDMS. Postgres is widely
adopted, is globally developed by hundreds of
people and is continually innovating.
1. Postgres Has Won
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.6
PostgreSQL Won
If you bet… you bet on PostgreSQL
Most Loved DatabaseMost Commonly Used Database Postgres Popularity
Source: Stack Overflow Developer Survey, 2019 Source: DB-Engines.com, 2020
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.7
Postgres as a service offering on all major clouds
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.8
Over 180 new features every year
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.9
Over 300 people contribute to each release
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.10
• 9.6 Parallel Query
• 10 Partitioning and Logical Replication
• 11 Transaction controlled stored procedures and Just In Time (JIT) Compilation
• 12 Pluggable Storage and Partitioning at Scale
• 13 Incremental Sort and Advanced Indexing and performance
About features
More recent release have taken on the more challenging features
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.11
• Strong support for the SQL Standard
• The optimizer has attracted top academics and practitioners
• Advanced features such as window functions
• The source for many commercial relational databases is Postgres and database add-ons
• True ACID compliance
A great relational database
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.12
Many Databases leverage Postgres
And … many more !!!
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.13
Postgres was designed from the start to be
extensible. This makes it a great choice for
non-relational (No SQL) applications.
2. Document-Centric Applications
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.14
• Full is naturally integrated with ANSI SQL in Postgres
• JSON and SQL queries use the same language, the same planner, and the same ACID compliant
transaction framework
• JSON and HSTORE are elegant and easy to use extensions of the underlying object-relational
model
JSON and ANSI SQL - A natural fit
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.15
JSON Examples
CREATE TABLE semi_structured_data (object JSONB);
….
{"name": "Apple Phone", "type": "phone", "brand": "ACME", "price": 200, "available": true,
"warranty_years": 1}
…
INSERT INTO semi_structured_data (object) VALUES
(’ { "name": "Apple Phone",
"type": "phone",
"brand": "ACME",
"price": 200,
"available": true,
"warranty_years": 1
} ')
Create a table JSONB Field
Simple JSON Data
Element
Insert this data element into the table
semi_structured_objects
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.16
{
"firstName": "John", // String Type
"lastName": "Smith",
"isAlive": true, // Boolean
"age": 25, // Number Type
"height_cm": 167.6,
"address": { // Object Type
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021-3100"
},
"phoneNumbers": [ // Object Array
{
"type": "home", "number": "212 555-1234"
},
{
"type": "office", "number": "646 555-4567"
}
],
"children": [],
"spouse": null
}
}
JSON Data Type Example
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.17
products=# insert into semi_structured_objects values('{ "firstName": "John", "lastName": "Smith", "isAlive": true, "age": 25,
"height_cm": 167.6,
"address": {
"streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021-3100"
},
"phoneNumbers": [
{
"type": "home", "number": "212 555-1234"
},
{
"type": "office", "number": "646 555-4567"
}
],
"children": [],
"spouse": null
}
');
products=# select * from semi_structured_objects ;
{"name": "Apple Phone", "type": "phone", "brand": "ACME", "price": 200, "available": true, "warranty_years": 1}
{"age": 25, "spouse": null, "address": {"city": "New York", "state": "NY", "postalCode": "10021-3100", "streetAddress": ...
Can store different objects in same field
Different ROWs with different
attributes.
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.18
products=# select * from product;
weight | sku | name | manufacturer | instock | price
--------+-----+---------------+--------------+---------+---------
0.5 | 1 | Apple iPhone | Apple | t | $950.00
0.3 | 2 | Apple Watch | Apple | t | $220.00
0.2 | 3 | Apple earpods | Apple | t | $220.00
3 | 4 | Macbook Pro | Apple | t | $220.00
products=# select to_json(r) from (select sku as id, name as prod_name from product) r;
--------------------------------------
{"id":1,"prod_name":"Apple iPhone"}
{"id":2,"prod_name":"Apple Watch"}
{"id":3,"prod_name":"Apple earpods"}
{"id":4,"prod_name":"Macbook Pro"}
(4 rows)
Transform tables to JSON Format
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.19
products=# select * from semi_structured_objects ;
{"name": "Apple Phone", "type": "phone", "brand": "ACME", "price": 200, "available": true, "warranty_years": 1}
{"age": 25, "spouse": null, "address": {"city": "New York", "state": "NY", "postalCode": "10021-3100", "streetAddress": ...
products=# select object->>'name' as "Product Name" from semi_structured_objects where object->>'brand'='ACME';
Product Name
--------------
Apple Phone
(1 row)
products=#
SQL constructs to query the JSON DATA
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.20
JSON and ANSI SQL Example
SELECT DISTINCT
product_type,
data->>'brand' as Brand,
data->>'available' as Availability
FROM json_data
JOIN product
ON (product.product_type=semi_structured_objects.object->>'name')
WHERE semi_structured_objects.object->>'available'=true;
product_type | brand | availability
---------------------------+-----------+--------------
AC3 Phone | ACME | true
ANSI SQL
JSON
No need for programmatic logic to combine SQL and NoSQL in the
application – Postgres does it all
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.21
Performance Comparison: PostgreSQL 11/MongoDB 4.0
● Benchmarks published in June 2019 (follow up to similar analysis in 2014)
● Executed by ongres.com
● Using m5.4xlarge (16 vcores) on AWS EC2
● Details at (including the code and the engine to verify the findings)
http://info.enterprisedb.com/Performance-Benchmarks-PostgreSQL-vs-MongoDB.html
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.22
Performance Comparison: PostgreSQL 11/MongoDB 4.0
OLTP (sysbench) - Many Small Transactions - Large Data Set
PGBouncer (connection pooler) is key to
manage highly concurrent access
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.23
PostGIS is one of the most popular geospatial
database offerings in the market. Turning
Postgres into one of the most popular and
powerful geospatial database is free and
simple.
3. Geographic Information Systems (GIS)
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.24
Power through extensibility — Geo spatial
Postgres=# create EXTENSION postgis;
CREATE EXTENSION
Now have one of the world’s most popular
Geospatial Databases built on well established
industry standards.
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.25
PostGIS enables a new type of analysis
● What is the largest city with 100 miles of the Grand Canyon?
● How many households are within 1 mile of this fault line?
● If we relocate, the office how does the average commute distance change?
● How many cities within 150KM of Tampa have median income over $50,000.00?
● What truck drove the greatest distance yesterday?
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.26
PostGIS enables a new type of analysis
CREATE TABLE public.interesting_cities
(
id integer,
name character varying(100),
location geometry(Point,4326),
medium_hval money,
int population,
PRIMARY KEY (id)
)
A type introduced by
PostGIS
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.27
Analysis can now involve spatial references
-- How many Meters are between Boston (TOM) and Philadelphia (BRUCE)?
select ST_Distance (ST_Transform ((select location from interesting_cities
where name ='Boston'), 3587),
ST_Transform((select location from interesting_cities
where name = 'Philadelphia'), 3587));
st_distance
--------------------
431332.35327121057
(1 row)
ST_Distance and ST_Transform
are functions introduced by PostGIS
extension.
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.28
Can use Spatial AND Traditional analysis tools
-- Interesting cities within 150 KM of Boston with the 10 lowest medium home prices
select name , medium_hval, location from interesting_cities where
(select ST_Distance (ST_Transform (location, 3587),
ST_Transform( ( select location from interesting_cities
where name = 'Boston'), 3587) ) ) < 150000
ORDER BY medium_hval limit 10;
Spatial Query
Traditional RDBMS expression
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.29
PgAdmin 4 is part of PostGIS eco-system
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.30
Postgres has advanced functionality for
business intelligence.
4. Business Intelligence
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.31
Variable from first
expression passed to next
expression. (and again to
third expression)
Business Intelligence — Advanced CTE Features
WITH source (order_id) AS (
DELETE FROM orders WHERE name = ’my order’ RETURNING order_id
), source2 AS (
DELETE FROM items USING source WHERE source.order_id =
items.order_id )
INSERT INTO old_orders SELECT order_id FROM source;
Delete a given order,all the items associated with order and place order in a historical table.
Less code to maintain than on any other database
Fewer round trips with the server than on any other database
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.32
Business Intelligence — Windows Functions
SELECT depname, empno, salary, rank() OVER (PARTITION BY depname ORDER BY salary DESC)
FROM empsalary;
depname | empno | salary | avg
-----------+-------+--------+-----------------------
develop | 11 | 5200 | 5020.0000000000000000
develop | 7 | 4200 | 5020.0000000000000000
develop | 8 | 6000 | 5020.0000000000000000
develop | 10 | 5200 | 5020.0000000000000000
personnel | 5 | 3500 | 3700.0000000000000000
personnel | 2 | 3900 | 3700.0000000000000000
sales | 3 | 4800 | 4866.6666666666666667
sales | 1 | 5000 | 4866.6666666666666667
sales | 4 | 4800 | 4866.666666666666667
(9 rows)
compare each employee's salary with the average salary in his or her department
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.33
Business Intelligence — Specialized Indexes
Specialized Indexes for all data types and access patterns
Index Type Optimized For
B-Tree Range queries with low selectivity and largely unique
values. The traditional database index.
HASH Equality lookups on large datasets (key / value store)
use cases.
GiST Unstructured Data i.e. Geo Spatial Types
GIN JSON Data, Full Text Search, JSONB Data
SP-GiST SP-GIST is ideal for indexes whose keys have many
duplicate prefixes
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.34
Business Intelligence — Specialized Indexes
Specialized Indexes for non-relational data
Index Type Optimized For
BRIN Time series data, multi-terabyte tables
PARTIAL When only a specific set of values will be looked up
COVERING For access patterns to unindex values navigated to
by an index.
EXPRESSION Allow for variances in keys
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.35
Postgres can function as a central integration
point for your data center using Foreign Data
Wrappers.
5. Central Data Center
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.36
Power through extensibility — Foreign Data Wrappers
postgres=# create extension postgres_fdw;
CREATE EXTENSION
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.37
Foreign Data Wrappers
CREATE SERVER postgres_server FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host ’localhost’, dbname
’fdw_test’);
create SERVER oracle_server foreign data wrapper oracle_fdw options (dbserver
'//<oracle_servefr_IP>/<sid>' );
CREATE SERVER mongo_server FOREIGN DATA WRAPPER mongo_fdw OPTIONS (address '127.0.0.1', port '27017');
CREATE SERVER hadoop_server FOREIGN DATA WRAPPER hdfs_fdw OPTIONS (host '127.0.0.1');
CREATE SERVER mysql_server FOREIGN DATA WRAPPER mysql_fdw OPTIONS (host '127.0.0.1', port '3306');
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.38
Foreign Data Wrapper Access
Application Stack
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.39
Postgres has server-side language support for
almost all developers.
6. Server-Side Languages
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.40
Server-Side Programming Languages
• PL/Java
• PL/Python
• PL/R
• PL/pgSQL (like PL/SQL)
• PL/Ruby
• PL/Scheme
• PL/sh
• PL/Tcl
• PL/v8 (JavaScript)
• SPI (C)
CREATE LANGUAGE plpython3u;
CREATE OR REPLACE FUNCTION pymax (a integer,
b integer) RETURNS integer AS
$$
if a > b:
return a
return b
$$ LANGUAGE plpython3u;
SELECT pymax(12, 3);
pymax
-------
12
(1 row)
© Copyright EnterpriseDB Corporation, 2020. All rights reserved.41
Learn More
Other resources
Thank You
Next Webinar: December 16
Postgres Enterprise Manager 8.0:
Something For Everyone
Postgres Pulse EDB Youtube
Channel
Ad

Recommended

Szabaduljon ki az Oracle szorításából
Szabaduljon ki az Oracle szorításából
EDB
 
Ein Expertenleitfaden für die Migration von Legacy-Datenbanken zu PostgreSQL
Ein Expertenleitfaden für die Migration von Legacy-Datenbanken zu PostgreSQL
EDB
 
Un guide complet pour la migration de bases de données héritées vers PostgreSQL
Un guide complet pour la migration de bases de données héritées vers PostgreSQL
EDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
EDB
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
EDB
 
Auditing and Monitoring PostgreSQL/EPAS
Auditing and Monitoring PostgreSQL/EPAS
EDB
 
Break Free from Oracle
Break Free from Oracle
EDB
 
EDB & ELOS Technologies - Break Free from Oracle
EDB & ELOS Technologies - Break Free from Oracle
EDB
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
EDB
 
Large Table Partitioning with PostgreSQL and Django
Large Table Partitioning with PostgreSQL and Django
EDB
 
Migration DB2 to EDB - Project Experience
Migration DB2 to EDB - Project Experience
EDB
 
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
EDB
 
PostgreSQL as a Strategic Tool
PostgreSQL as a Strategic Tool
EDB
 
New Approaches to Migrating from Oracle to Enterprise-Ready Postgres in the C...
New Approaches to Migrating from Oracle to Enterprise-Ready Postgres in the C...
EDB
 
Keynote: The Postgres Ecosystem
Keynote: The Postgres Ecosystem
EDB
 
Why Care Risk Choose PostgreSQL
Why Care Risk Choose PostgreSQL
EDB
 
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
EDB
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
EDB
 
EDB Postgres Platform 11 Webinar
EDB Postgres Platform 11 Webinar
EDB
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
EDB
 
Postgres Databases in Minutes with the EDB Postgres Cloud Database Service
Postgres Databases in Minutes with the EDB Postgres Cloud Database Service
EDB
 
Oracle Migration to Postgres in the Cloud
Oracle Migration to Postgres in the Cloud
EDB
 
Migrate Today: Proactive Steps to Unhook from Oracle
Migrate Today: Proactive Steps to Unhook from Oracle
EDB
 
Postgres Foreign Data Wrappers
Postgres Foreign Data Wrappers
EDB
 
HTAP Queries
HTAP Queries
Atif Shaikh
 
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...
Tammy Bednar
 
Making Postgres Central in Your Data Center
Making Postgres Central in Your Data Center
EDB
 
PostgreSQL 13 is Coming - Find Out What's New!
PostgreSQL 13 is Coming - Find Out What's New!
EDB
 
NoSQL Now: Postgres - The NoSQL Cake You Can Eat
NoSQL Now: Postgres - The NoSQL Cake You Can Eat
DATAVERSITY
 
Postgres NoSQL - Delivering Apps Faster
Postgres NoSQL - Delivering Apps Faster
EDB
 

More Related Content

What's hot (20)

EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
EDB
 
Large Table Partitioning with PostgreSQL and Django
Large Table Partitioning with PostgreSQL and Django
EDB
 
Migration DB2 to EDB - Project Experience
Migration DB2 to EDB - Project Experience
EDB
 
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
EDB
 
PostgreSQL as a Strategic Tool
PostgreSQL as a Strategic Tool
EDB
 
New Approaches to Migrating from Oracle to Enterprise-Ready Postgres in the C...
New Approaches to Migrating from Oracle to Enterprise-Ready Postgres in the C...
EDB
 
Keynote: The Postgres Ecosystem
Keynote: The Postgres Ecosystem
EDB
 
Why Care Risk Choose PostgreSQL
Why Care Risk Choose PostgreSQL
EDB
 
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
EDB
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
EDB
 
EDB Postgres Platform 11 Webinar
EDB Postgres Platform 11 Webinar
EDB
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
EDB
 
Postgres Databases in Minutes with the EDB Postgres Cloud Database Service
Postgres Databases in Minutes with the EDB Postgres Cloud Database Service
EDB
 
Oracle Migration to Postgres in the Cloud
Oracle Migration to Postgres in the Cloud
EDB
 
Migrate Today: Proactive Steps to Unhook from Oracle
Migrate Today: Proactive Steps to Unhook from Oracle
EDB
 
Postgres Foreign Data Wrappers
Postgres Foreign Data Wrappers
EDB
 
HTAP Queries
HTAP Queries
Atif Shaikh
 
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...
Tammy Bednar
 
Making Postgres Central in Your Data Center
Making Postgres Central in Your Data Center
EDB
 
PostgreSQL 13 is Coming - Find Out What's New!
PostgreSQL 13 is Coming - Find Out What's New!
EDB
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
EDB
 
Large Table Partitioning with PostgreSQL and Django
Large Table Partitioning with PostgreSQL and Django
EDB
 
Migration DB2 to EDB - Project Experience
Migration DB2 to EDB - Project Experience
EDB
 
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
EDB
 
PostgreSQL as a Strategic Tool
PostgreSQL as a Strategic Tool
EDB
 
New Approaches to Migrating from Oracle to Enterprise-Ready Postgres in the C...
New Approaches to Migrating from Oracle to Enterprise-Ready Postgres in the C...
EDB
 
Keynote: The Postgres Ecosystem
Keynote: The Postgres Ecosystem
EDB
 
Why Care Risk Choose PostgreSQL
Why Care Risk Choose PostgreSQL
EDB
 
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
Using PEM to understand and improve performance in Postgres: Postgres Tuning ...
EDB
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
EDB
 
EDB Postgres Platform 11 Webinar
EDB Postgres Platform 11 Webinar
EDB
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
EDB
 
Postgres Databases in Minutes with the EDB Postgres Cloud Database Service
Postgres Databases in Minutes with the EDB Postgres Cloud Database Service
EDB
 
Oracle Migration to Postgres in the Cloud
Oracle Migration to Postgres in the Cloud
EDB
 
Migrate Today: Proactive Steps to Unhook from Oracle
Migrate Today: Proactive Steps to Unhook from Oracle
EDB
 
Postgres Foreign Data Wrappers
Postgres Foreign Data Wrappers
EDB
 
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...
Database@Home - Data Driven : Loading, Indexing, and Searching with Text and ...
Tammy Bednar
 
Making Postgres Central in Your Data Center
Making Postgres Central in Your Data Center
EDB
 
PostgreSQL 13 is Coming - Find Out What's New!
PostgreSQL 13 is Coming - Find Out What's New!
EDB
 

Similar to Application Development & Database Choices: Postgres Support for non Relational Data (20)

NoSQL Now: Postgres - The NoSQL Cake You Can Eat
NoSQL Now: Postgres - The NoSQL Cake You Can Eat
DATAVERSITY
 
Postgres NoSQL - Delivering Apps Faster
Postgres NoSQL - Delivering Apps Faster
EDB
 
NoSQL on ACID - Meet Unstructured Postgres
NoSQL on ACID - Meet Unstructured Postgres
EDB
 
NoSQL on ACID: Meet Unstructured Postgres
NoSQL on ACID: Meet Unstructured Postgres
EDB
 
EDB NoSQL German Webinar 2015
EDB NoSQL German Webinar 2015
EDB
 
Postgres: The NoSQL Cake You Can Eat
Postgres: The NoSQL Cake You Can Eat
EDB
 
No sql bigdata and postgresql
No sql bigdata and postgresql
Zaid Shabbir
 
Do More with Postgres- NoSQL Applications for the Enterprise
Do More with Postgres- NoSQL Applications for the Enterprise
EDB
 
Mathias test
Mathias test
Mathias Stjernström
 
FOSSASIA 2015 - 10 Features your developers are missing when stuck with Propr...
FOSSASIA 2015 - 10 Features your developers are missing when stuck with Propr...
Ashnikbiz
 
PostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQL
Alexei Krasner
 
Postgres.foreign.data.wrappers.2015
Postgres.foreign.data.wrappers.2015
EDB
 
No sql way_in_pg
No sql way_in_pg
Vibhor Kumar
 
PostgreSQL, your NoSQL database
PostgreSQL, your NoSQL database
Reuven Lerner
 
PostgreSQL as NoSQL
PostgreSQL as NoSQL
Himanchali -
 
Pg 95 new capabilities
Pg 95 new capabilities
Jamey Hanson
 
The NoSQL Way in Postgres
The NoSQL Way in Postgres
EDB
 
Postgres vs Mongo / Олег Бартунов (Postgres Professional)
Postgres vs Mongo / Олег Бартунов (Postgres Professional)
Ontico
 
The Central View of your Data with Postgres
The Central View of your Data with Postgres
EDB
 
The rise of json in rdbms land jab17
The rise of json in rdbms land jab17
alikonweb
 
NoSQL Now: Postgres - The NoSQL Cake You Can Eat
NoSQL Now: Postgres - The NoSQL Cake You Can Eat
DATAVERSITY
 
Postgres NoSQL - Delivering Apps Faster
Postgres NoSQL - Delivering Apps Faster
EDB
 
NoSQL on ACID - Meet Unstructured Postgres
NoSQL on ACID - Meet Unstructured Postgres
EDB
 
NoSQL on ACID: Meet Unstructured Postgres
NoSQL on ACID: Meet Unstructured Postgres
EDB
 
EDB NoSQL German Webinar 2015
EDB NoSQL German Webinar 2015
EDB
 
Postgres: The NoSQL Cake You Can Eat
Postgres: The NoSQL Cake You Can Eat
EDB
 
No sql bigdata and postgresql
No sql bigdata and postgresql
Zaid Shabbir
 
Do More with Postgres- NoSQL Applications for the Enterprise
Do More with Postgres- NoSQL Applications for the Enterprise
EDB
 
FOSSASIA 2015 - 10 Features your developers are missing when stuck with Propr...
FOSSASIA 2015 - 10 Features your developers are missing when stuck with Propr...
Ashnikbiz
 
PostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQL
Alexei Krasner
 
Postgres.foreign.data.wrappers.2015
Postgres.foreign.data.wrappers.2015
EDB
 
PostgreSQL, your NoSQL database
PostgreSQL, your NoSQL database
Reuven Lerner
 
PostgreSQL as NoSQL
PostgreSQL as NoSQL
Himanchali -
 
Pg 95 new capabilities
Pg 95 new capabilities
Jamey Hanson
 
The NoSQL Way in Postgres
The NoSQL Way in Postgres
EDB
 
Postgres vs Mongo / Олег Бартунов (Postgres Professional)
Postgres vs Mongo / Олег Бартунов (Postgres Professional)
Ontico
 
The Central View of your Data with Postgres
The Central View of your Data with Postgres
EDB
 
The rise of json in rdbms land jab17
The rise of json in rdbms land jab17
alikonweb
 
Ad

More from EDB (20)

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
EDB
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
EDB
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube
EDB
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021
EDB
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL
EDB
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL
EDB
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
EDB
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
EDB
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
EDB
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
EDB
 
IOT with PostgreSQL
IOT with PostgreSQL
EDB
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
EDB
 
Psql is awesome!
Psql is awesome!
EDB
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos données
EDB
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano
EDB
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
EDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
EDB
 
EDB Postgres & Tools in a Smart City Project
EDB Postgres & Tools in a Smart City Project
EDB
 
All you need to know about CREATE STATISTICS
All you need to know about CREATE STATISTICS
EDB
 
Cloud Native PostgreSQL
Cloud Native PostgreSQL
EDB
 
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
EDB
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
EDB
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube
EDB
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021
EDB
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL
EDB
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL
EDB
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
EDB
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
EDB
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
EDB
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
EDB
 
IOT with PostgreSQL
IOT with PostgreSQL
EDB
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
EDB
 
Psql is awesome!
Psql is awesome!
EDB
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos données
EDB
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano
EDB
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
EDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
EDB
 
EDB Postgres & Tools in a Smart City Project
EDB Postgres & Tools in a Smart City Project
EDB
 
All you need to know about CREATE STATISTICS
All you need to know about CREATE STATISTICS
EDB
 
Cloud Native PostgreSQL
Cloud Native PostgreSQL
EDB
 
Ad

Recently uploaded (20)

Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
Supporting the NextGen 911 Digital Transformation with FME
Supporting the NextGen 911 Digital Transformation with FME
Safe Software
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
AI vs Human Writing: Can You Tell the Difference?
AI vs Human Writing: Can You Tell the Difference?
Shashi Sathyanarayana, Ph.D
 
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
FME for Good: Integrating Multiple Data Sources with APIs to Support Local Ch...
Safe Software
 
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC and Open Hackathons Monthly Highlights June 2025
OpenACC
 
Kubernetes Security Act Now Before It’s Too Late
Kubernetes Security Act Now Before It’s Too Late
Michael Furman
 
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Creating Inclusive Digital Learning with AI: A Smarter, Fairer Future
Impelsys Inc.
 
Bridging the divide: A conversation on tariffs today in the book industry - T...
Bridging the divide: A conversation on tariffs today in the book industry - T...
BookNet Canada
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
Securing Account Lifecycles in the Age of Deepfakes.pptx
Securing Account Lifecycles in the Age of Deepfakes.pptx
FIDO Alliance
 
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
“Addressing Evolving AI Model Challenges Through Memory and Storage,” a Prese...
Edge AI and Vision Alliance
 
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Viral>Wondershare Filmora 14.5.18.12900 Crack Free Download
Puppy jhon
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
“Key Requirements to Successfully Implement Generative AI in Edge Devices—Opt...
Edge AI and Vision Alliance
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Reducing Conflicts and Increasing Safety Along the Cycling Networks of East-F...
Safe Software
 
OWASP Barcelona 2025 Threat Model Library
OWASP Barcelona 2025 Threat Model Library
PetraVukmirovic
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 

Application Development & Database Choices: Postgres Support for non Relational Data

  • 1. Application Development and Database Choices: Postgres Support for non Relational Data EDB CTO Team December 2020
  • 2. Slides and recording will be made available Submit questions via Zoom – will be answering at end Welcome – Housekeeping Items
  • 3. This talk will cover the advanced features of Postgres that make it the most-loved RDBMS by developers and a great choice for non- relational workloads. Portions of this presentation were taken from https://momjian.us/presentations
  • 4. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.4 Agenda The “Post” Relational Database 1.Postgres has won 2.Document-centric applications 3.Geographic Information Systems (GIS) 4.Business intelligence 5.Central data centers 6.Server-side languages
  • 5. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.5 It is the most loved RDMS. Postgres is widely adopted, is globally developed by hundreds of people and is continually innovating. 1. Postgres Has Won
  • 6. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.6 PostgreSQL Won If you bet… you bet on PostgreSQL Most Loved DatabaseMost Commonly Used Database Postgres Popularity Source: Stack Overflow Developer Survey, 2019 Source: DB-Engines.com, 2020
  • 7. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.7 Postgres as a service offering on all major clouds
  • 8. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.8 Over 180 new features every year
  • 9. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.9 Over 300 people contribute to each release
  • 10. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.10 • 9.6 Parallel Query • 10 Partitioning and Logical Replication • 11 Transaction controlled stored procedures and Just In Time (JIT) Compilation • 12 Pluggable Storage and Partitioning at Scale • 13 Incremental Sort and Advanced Indexing and performance About features More recent release have taken on the more challenging features
  • 11. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.11 • Strong support for the SQL Standard • The optimizer has attracted top academics and practitioners • Advanced features such as window functions • The source for many commercial relational databases is Postgres and database add-ons • True ACID compliance A great relational database
  • 12. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.12 Many Databases leverage Postgres And … many more !!!
  • 13. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.13 Postgres was designed from the start to be extensible. This makes it a great choice for non-relational (No SQL) applications. 2. Document-Centric Applications
  • 14. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.14 • Full is naturally integrated with ANSI SQL in Postgres • JSON and SQL queries use the same language, the same planner, and the same ACID compliant transaction framework • JSON and HSTORE are elegant and easy to use extensions of the underlying object-relational model JSON and ANSI SQL - A natural fit
  • 15. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.15 JSON Examples CREATE TABLE semi_structured_data (object JSONB); …. {"name": "Apple Phone", "type": "phone", "brand": "ACME", "price": 200, "available": true, "warranty_years": 1} … INSERT INTO semi_structured_data (object) VALUES (’ { "name": "Apple Phone", "type": "phone", "brand": "ACME", "price": 200, "available": true, "warranty_years": 1 } ') Create a table JSONB Field Simple JSON Data Element Insert this data element into the table semi_structured_objects
  • 16. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.16 { "firstName": "John", // String Type "lastName": "Smith", "isAlive": true, // Boolean "age": 25, // Number Type "height_cm": 167.6, "address": { // Object Type "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021-3100" }, "phoneNumbers": [ // Object Array { "type": "home", "number": "212 555-1234" }, { "type": "office", "number": "646 555-4567" } ], "children": [], "spouse": null } } JSON Data Type Example
  • 17. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.17 products=# insert into semi_structured_objects values('{ "firstName": "John", "lastName": "Smith", "isAlive": true, "age": 25, "height_cm": 167.6, "address": { "streetAddress": "21 2nd Street", "city": "New York", "state": "NY", "postalCode": "10021-3100" }, "phoneNumbers": [ { "type": "home", "number": "212 555-1234" }, { "type": "office", "number": "646 555-4567" } ], "children": [], "spouse": null } '); products=# select * from semi_structured_objects ; {"name": "Apple Phone", "type": "phone", "brand": "ACME", "price": 200, "available": true, "warranty_years": 1} {"age": 25, "spouse": null, "address": {"city": "New York", "state": "NY", "postalCode": "10021-3100", "streetAddress": ... Can store different objects in same field Different ROWs with different attributes.
  • 18. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.18 products=# select * from product; weight | sku | name | manufacturer | instock | price --------+-----+---------------+--------------+---------+--------- 0.5 | 1 | Apple iPhone | Apple | t | $950.00 0.3 | 2 | Apple Watch | Apple | t | $220.00 0.2 | 3 | Apple earpods | Apple | t | $220.00 3 | 4 | Macbook Pro | Apple | t | $220.00 products=# select to_json(r) from (select sku as id, name as prod_name from product) r; -------------------------------------- {"id":1,"prod_name":"Apple iPhone"} {"id":2,"prod_name":"Apple Watch"} {"id":3,"prod_name":"Apple earpods"} {"id":4,"prod_name":"Macbook Pro"} (4 rows) Transform tables to JSON Format
  • 19. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.19 products=# select * from semi_structured_objects ; {"name": "Apple Phone", "type": "phone", "brand": "ACME", "price": 200, "available": true, "warranty_years": 1} {"age": 25, "spouse": null, "address": {"city": "New York", "state": "NY", "postalCode": "10021-3100", "streetAddress": ... products=# select object->>'name' as "Product Name" from semi_structured_objects where object->>'brand'='ACME'; Product Name -------------- Apple Phone (1 row) products=# SQL constructs to query the JSON DATA
  • 20. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.20 JSON and ANSI SQL Example SELECT DISTINCT product_type, data->>'brand' as Brand, data->>'available' as Availability FROM json_data JOIN product ON (product.product_type=semi_structured_objects.object->>'name') WHERE semi_structured_objects.object->>'available'=true; product_type | brand | availability ---------------------------+-----------+-------------- AC3 Phone | ACME | true ANSI SQL JSON No need for programmatic logic to combine SQL and NoSQL in the application – Postgres does it all
  • 21. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.21 Performance Comparison: PostgreSQL 11/MongoDB 4.0 ● Benchmarks published in June 2019 (follow up to similar analysis in 2014) ● Executed by ongres.com ● Using m5.4xlarge (16 vcores) on AWS EC2 ● Details at (including the code and the engine to verify the findings) http://info.enterprisedb.com/Performance-Benchmarks-PostgreSQL-vs-MongoDB.html
  • 22. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.22 Performance Comparison: PostgreSQL 11/MongoDB 4.0 OLTP (sysbench) - Many Small Transactions - Large Data Set PGBouncer (connection pooler) is key to manage highly concurrent access
  • 23. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.23 PostGIS is one of the most popular geospatial database offerings in the market. Turning Postgres into one of the most popular and powerful geospatial database is free and simple. 3. Geographic Information Systems (GIS)
  • 24. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.24 Power through extensibility — Geo spatial Postgres=# create EXTENSION postgis; CREATE EXTENSION Now have one of the world’s most popular Geospatial Databases built on well established industry standards.
  • 25. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.25 PostGIS enables a new type of analysis ● What is the largest city with 100 miles of the Grand Canyon? ● How many households are within 1 mile of this fault line? ● If we relocate, the office how does the average commute distance change? ● How many cities within 150KM of Tampa have median income over $50,000.00? ● What truck drove the greatest distance yesterday?
  • 26. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.26 PostGIS enables a new type of analysis CREATE TABLE public.interesting_cities ( id integer, name character varying(100), location geometry(Point,4326), medium_hval money, int population, PRIMARY KEY (id) ) A type introduced by PostGIS
  • 27. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.27 Analysis can now involve spatial references -- How many Meters are between Boston (TOM) and Philadelphia (BRUCE)? select ST_Distance (ST_Transform ((select location from interesting_cities where name ='Boston'), 3587), ST_Transform((select location from interesting_cities where name = 'Philadelphia'), 3587)); st_distance -------------------- 431332.35327121057 (1 row) ST_Distance and ST_Transform are functions introduced by PostGIS extension.
  • 28. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.28 Can use Spatial AND Traditional analysis tools -- Interesting cities within 150 KM of Boston with the 10 lowest medium home prices select name , medium_hval, location from interesting_cities where (select ST_Distance (ST_Transform (location, 3587), ST_Transform( ( select location from interesting_cities where name = 'Boston'), 3587) ) ) < 150000 ORDER BY medium_hval limit 10; Spatial Query Traditional RDBMS expression
  • 29. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.29 PgAdmin 4 is part of PostGIS eco-system
  • 30. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.30 Postgres has advanced functionality for business intelligence. 4. Business Intelligence
  • 31. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.31 Variable from first expression passed to next expression. (and again to third expression) Business Intelligence — Advanced CTE Features WITH source (order_id) AS ( DELETE FROM orders WHERE name = ’my order’ RETURNING order_id ), source2 AS ( DELETE FROM items USING source WHERE source.order_id = items.order_id ) INSERT INTO old_orders SELECT order_id FROM source; Delete a given order,all the items associated with order and place order in a historical table. Less code to maintain than on any other database Fewer round trips with the server than on any other database
  • 32. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.32 Business Intelligence — Windows Functions SELECT depname, empno, salary, rank() OVER (PARTITION BY depname ORDER BY salary DESC) FROM empsalary; depname | empno | salary | avg -----------+-------+--------+----------------------- develop | 11 | 5200 | 5020.0000000000000000 develop | 7 | 4200 | 5020.0000000000000000 develop | 8 | 6000 | 5020.0000000000000000 develop | 10 | 5200 | 5020.0000000000000000 personnel | 5 | 3500 | 3700.0000000000000000 personnel | 2 | 3900 | 3700.0000000000000000 sales | 3 | 4800 | 4866.6666666666666667 sales | 1 | 5000 | 4866.6666666666666667 sales | 4 | 4800 | 4866.666666666666667 (9 rows) compare each employee's salary with the average salary in his or her department
  • 33. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.33 Business Intelligence — Specialized Indexes Specialized Indexes for all data types and access patterns Index Type Optimized For B-Tree Range queries with low selectivity and largely unique values. The traditional database index. HASH Equality lookups on large datasets (key / value store) use cases. GiST Unstructured Data i.e. Geo Spatial Types GIN JSON Data, Full Text Search, JSONB Data SP-GiST SP-GIST is ideal for indexes whose keys have many duplicate prefixes
  • 34. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.34 Business Intelligence — Specialized Indexes Specialized Indexes for non-relational data Index Type Optimized For BRIN Time series data, multi-terabyte tables PARTIAL When only a specific set of values will be looked up COVERING For access patterns to unindex values navigated to by an index. EXPRESSION Allow for variances in keys
  • 35. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.35 Postgres can function as a central integration point for your data center using Foreign Data Wrappers. 5. Central Data Center
  • 36. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.36 Power through extensibility — Foreign Data Wrappers postgres=# create extension postgres_fdw; CREATE EXTENSION
  • 37. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.37 Foreign Data Wrappers CREATE SERVER postgres_server FOREIGN DATA WRAPPER postgres_fdw OPTIONS (host ’localhost’, dbname ’fdw_test’); create SERVER oracle_server foreign data wrapper oracle_fdw options (dbserver '//<oracle_servefr_IP>/<sid>' ); CREATE SERVER mongo_server FOREIGN DATA WRAPPER mongo_fdw OPTIONS (address '127.0.0.1', port '27017'); CREATE SERVER hadoop_server FOREIGN DATA WRAPPER hdfs_fdw OPTIONS (host '127.0.0.1'); CREATE SERVER mysql_server FOREIGN DATA WRAPPER mysql_fdw OPTIONS (host '127.0.0.1', port '3306');
  • 38. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.38 Foreign Data Wrapper Access Application Stack
  • 39. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.39 Postgres has server-side language support for almost all developers. 6. Server-Side Languages
  • 40. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.40 Server-Side Programming Languages • PL/Java • PL/Python • PL/R • PL/pgSQL (like PL/SQL) • PL/Ruby • PL/Scheme • PL/sh • PL/Tcl • PL/v8 (JavaScript) • SPI (C) CREATE LANGUAGE plpython3u; CREATE OR REPLACE FUNCTION pymax (a integer, b integer) RETURNS integer AS $$ if a > b: return a return b $$ LANGUAGE plpython3u; SELECT pymax(12, 3); pymax ------- 12 (1 row)
  • 41. © Copyright EnterpriseDB Corporation, 2020. All rights reserved.41 Learn More Other resources Thank You Next Webinar: December 16 Postgres Enterprise Manager 8.0: Something For Everyone Postgres Pulse EDB Youtube Channel