SlideShare a Scribd company logo
Performance, Reliability, Flexibility –Pick Any Three!
•JSONB-jsonBinary Storage 
•Replication improvements-Replication Slots 
•Logical Decoding in WAL log 
•Time Lagging Replica 
•pg_prewarm 
•ALTER SYSTEM Command 
•Great new enhancements in aggregation features
Wasn’t JSON was introduced in v9.2? Well it just got better 
JSONB is much more optimized and faster for lookup 
New functions to extract and manipulate the jsondata 
You have the flexibility without compromising on Reliability! 
Non-relational data with ACID compliance!
row_to_json–to convert a row to json 
json_object–Create jsonobject out of text array 
json_build_object–Create jsonobject out of variadicargument list 
array_to_json–to converan array to JSON 
json_eachand json_each_text–convert jsonobjects in key-value pair 
json_extract_path-Get value of a jsonobject 
json_populate_recordand json_populate_recordset-Convert jsonobject to records
Operator 
Operand Type 
Purpose 
-> 
int 
Get JSON arraryelement 
-> 
text 
Get JSON object field 
->> 
int 
Get JSON array element as text 
->> 
text 
Get JSON object fieldas text 
#> 
array of text 
Get JSONobject at specified path 
#>> 
array of text 
Get JSON object at specified path as text 
@> 
jsonb 
Does the left JSON value contain within it the right value? 
<@ 
jsonb 
Is the left JSON value contained within the right value? 
? 
text 
Does the key/elementstringexist within the JSON value? 
?| 
text[] 
Do any of these key/elementstringsexist? 
?& 
text[] 
Do all of these key/elementstringsexist?
JSONB in action!
select data from Table as a jsonobject- 
SELECT 
JSON_BUILD_OBJECT( 'name',name) 
FROM books; 
Convert a row to json 
SELECT ROW_TO_JSON(my_row) 
FROM ( SELECT ROW(books.*) 
FROM books )my_row;
Select output of join as a jsonobject- 
SELECT JSON_BUILD_OBJECT( 'name', name, 'author', name_arr) 
FROM( 
SELECT ARRAY_AGG( a.name ) AS name_arr, b.name AS name 
FROM authors a JOIN author_book_mapab ON a.id=ab.author_id 
JOIN books b ON b.id=ab.book_id 
GROUP BY b.name ) books_authors_join;
Now you need to guess “wal_keep_segment” to avoid walfiles from getting removed 
Simply create a replication slot and WAL which are yet not replicated to the slot will not be removed from live WAL location 
Time Lagging Replica-You can define a lag period for your replica 
This can be used for back-dated reporting 
Or recover from a user error –an accidentally dropped table or a truncated table
Set WAL level to ‘logical’ to do more verbose recoding in WAL files 
This will also record table and relation level details in each WAL entry 
These WAL files can be used for logical decoding and logical replication to replicate changes on a particular table 
There are commercial and open source solutions which are in beta stage and are based on this approach
ALTER SYSTEM Command-Now a DBA can alter the configuration with ALTER SYSTEM command and avoid changing it in postgresql.conf 
pg_prewarm-now a DBA can load certain relations and blocks in cache after startup and avoid performance issues due to cold-reboot
https://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.4 
Hangout Recording for Replication Features in v9.4- https://www.youtube.com/watch?v=-HkrXwaWCb8 
EnterpriseDB Whitepaper-http://www.enterprisedb.com/nosql-for-enterprise 
http://www.craigkerstiens.com/2014/03/24/Postgres-9.4-Looking-up/ 
Or just mail me… 
sameer.kasi200x@gmail.com 
sameer.kumar@ashnik.com

More Related Content

What's hot

Redis: REmote DIctionary Server
Redis: REmote DIctionary ServerRedis: REmote DIctionary Server
Redis: REmote DIctionary Server
Ezra Zygmuntowicz
 
ETL With Cassandra Streaming Bulk Loading
ETL With Cassandra Streaming Bulk LoadingETL With Cassandra Streaming Bulk Loading
ETL With Cassandra Streaming Bulk Loading
alex_araujo
 
patroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deploymentpatroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deployment
hyeongchae lee
 

What's hot (20)

Xephon K A Time series database with multiple backends
Xephon K A Time series database with multiple backendsXephon K A Time series database with multiple backends
Xephon K A Time series database with multiple backends
 
Redis: REmote DIctionary Server
Redis: REmote DIctionary ServerRedis: REmote DIctionary Server
Redis: REmote DIctionary Server
 
ETL With Cassandra Streaming Bulk Loading
ETL With Cassandra Streaming Bulk LoadingETL With Cassandra Streaming Bulk Loading
ETL With Cassandra Streaming Bulk Loading
 
Bulk Loading Data into Cassandra
Bulk Loading Data into CassandraBulk Loading Data into Cassandra
Bulk Loading Data into Cassandra
 
Upgrading To The New Map Reduce API
Upgrading To The New Map Reduce APIUpgrading To The New Map Reduce API
Upgrading To The New Map Reduce API
 
RethinkDB - the open-source database for the realtime web
RethinkDB - the open-source database for the realtime webRethinkDB - the open-source database for the realtime web
RethinkDB - the open-source database for the realtime web
 
PostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 Taipei
PostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 TaipeiPostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 Taipei
PostgreSQL 9.4, 9.5 and Beyond @ COSCUP 2015 Taipei
 
Indexes don't mean slow inserts.
Indexes don't mean slow inserts.Indexes don't mean slow inserts.
Indexes don't mean slow inserts.
 
MongoDB @ fliptop
MongoDB @ fliptopMongoDB @ fliptop
MongoDB @ fliptop
 
What is new in MariaDB 10.6?
What is new in MariaDB 10.6?What is new in MariaDB 10.6?
What is new in MariaDB 10.6?
 
mesos-devoxx14
mesos-devoxx14mesos-devoxx14
mesos-devoxx14
 
patroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deploymentpatroni-based citrus high availability environment deployment
patroni-based citrus high availability environment deployment
 
Scala+data
Scala+dataScala+data
Scala+data
 
SORT & JOIN IN SPARK 2.0
SORT & JOIN IN SPARK 2.0SORT & JOIN IN SPARK 2.0
SORT & JOIN IN SPARK 2.0
 
Data Tiering: Squeezing Scale out of MySQL (LRUG Presentation 2014-01-13)
Data Tiering: Squeezing Scale out of MySQL (LRUG Presentation 2014-01-13)Data Tiering: Squeezing Scale out of MySQL (LRUG Presentation 2014-01-13)
Data Tiering: Squeezing Scale out of MySQL (LRUG Presentation 2014-01-13)
 
Managing a 14 TB reporting datawarehouse with postgresql
Managing a 14 TB reporting datawarehouse with postgresql Managing a 14 TB reporting datawarehouse with postgresql
Managing a 14 TB reporting datawarehouse with postgresql
 
ClickHouse Deep Dive, by Aleksei Milovidov
ClickHouse Deep Dive, by Aleksei MilovidovClickHouse Deep Dive, by Aleksei Milovidov
ClickHouse Deep Dive, by Aleksei Milovidov
 
Fighting Against Chaotically Separated Values with Embulk
Fighting Against Chaotically Separated Values with EmbulkFighting Against Chaotically Separated Values with Embulk
Fighting Against Chaotically Separated Values with Embulk
 
Big Data Analytics with Scala at SCALA.IO 2013
Big Data Analytics with Scala at SCALA.IO 2013Big Data Analytics with Scala at SCALA.IO 2013
Big Data Analytics with Scala at SCALA.IO 2013
 
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & PackerLAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
LAMP Stack (Reloaded) - Infrastructure as Code with Terraform & Packer
 

Viewers also liked

Caldwell recognition-2012
Caldwell recognition-2012Caldwell recognition-2012
Caldwell recognition-2012
ryanatsofa
 
Jill lintner's portfolio
Jill lintner's portfolioJill lintner's portfolio
Jill lintner's portfolio
ocwebservices
 
Storytime updated ppt
Storytime updated pptStorytime updated ppt
Storytime updated ppt
nolenlib
 

Viewers also liked (20)

Streaming Replication Made Easy in v9.3
Streaming Replication Made Easy in v9.3Streaming Replication Made Easy in v9.3
Streaming Replication Made Easy in v9.3
 
Tuning your PostgreSQL Database
Tuning your PostgreSQL DatabaseTuning your PostgreSQL Database
Tuning your PostgreSQL Database
 
1200 j lipman
1200 j lipman1200 j lipman
1200 j lipman
 
Caldwell recognition-2012
Caldwell recognition-2012Caldwell recognition-2012
Caldwell recognition-2012
 
Bab 5 9d
Bab 5 9dBab 5 9d
Bab 5 9d
 
P1 L2
P1 L2P1 L2
P1 L2
 
Jill lintner's portfolio
Jill lintner's portfolioJill lintner's portfolio
Jill lintner's portfolio
 
Hugps138
Hugps138Hugps138
Hugps138
 
Horizons Beyond Dreams Business Plan
Horizons Beyond Dreams Business PlanHorizons Beyond Dreams Business Plan
Horizons Beyond Dreams Business Plan
 
Intergenerational Networking
Intergenerational NetworkingIntergenerational Networking
Intergenerational Networking
 
The Praying Indians of Megunko
The Praying Indians of MegunkoThe Praying Indians of Megunko
The Praying Indians of Megunko
 
Cultural strength
Cultural strengthCultural strength
Cultural strength
 
Las leyes naturales, según Thomas Hobbes
Las leyes naturales, según Thomas HobbesLas leyes naturales, según Thomas Hobbes
Las leyes naturales, según Thomas Hobbes
 
Storytime updated ppt
Storytime updated pptStorytime updated ppt
Storytime updated ppt
 
nullcon 2011 - Buffer UnderRun Exploits
nullcon 2011 - Buffer UnderRun Exploitsnullcon 2011 - Buffer UnderRun Exploits
nullcon 2011 - Buffer UnderRun Exploits
 
The engineer’s licensing guidance document ELGD 2007
The engineer’s licensing guidance document ELGD 2007The engineer’s licensing guidance document ELGD 2007
The engineer’s licensing guidance document ELGD 2007
 
B.j. mate i
B.j. mate iB.j. mate i
B.j. mate i
 
aclogを支えるデザイン
aclogを支えるデザインaclogを支えるデザイン
aclogを支えるデザイン
 
Earth moon statistics
Earth moon statisticsEarth moon statistics
Earth moon statistics
 
Good prescribing
Good prescribingGood prescribing
Good prescribing
 

Similar to PostgreSQL v9.4features

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Justin Smestad
 
Orcale dba training
Orcale dba trainingOrcale dba training
Orcale dba training
Ugs8008
 

Similar to PostgreSQL v9.4features (20)

Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and Python
 
What’s New in MariaDB Server 10.2
What’s New in MariaDB Server 10.2What’s New in MariaDB Server 10.2
What’s New in MariaDB Server 10.2
 
Einführung in MongoDB
Einführung in MongoDBEinführung in MongoDB
Einführung in MongoDB
 
10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL
 
Json in Postgres - the Roadmap
 Json in Postgres - the Roadmap Json in Postgres - the Roadmap
Json in Postgres - the Roadmap
 
Hibernate 6.0 - What's new.pdf
Hibernate 6.0 - What's new.pdfHibernate 6.0 - What's new.pdf
Hibernate 6.0 - What's new.pdf
 
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018
Oracle JSON treatment evolution - from 12.1 to 18 AOUG-2018
 
MongoDB Knowledge share
MongoDB Knowledge shareMongoDB Knowledge share
MongoDB Knowledge share
 
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
 
Ceph Day Beijing - Our Journey to High Performance Large Scale Ceph Cluster a...
Ceph Day Beijing - Our Journey to High Performance Large Scale Ceph Cluster a...Ceph Day Beijing - Our Journey to High Performance Large Scale Ceph Cluster a...
Ceph Day Beijing - Our Journey to High Performance Large Scale Ceph Cluster a...
 
(DEV309) Large-Scale Metrics Analysis in Ruby
(DEV309) Large-Scale Metrics Analysis in Ruby(DEV309) Large-Scale Metrics Analysis in Ruby
(DEV309) Large-Scale Metrics Analysis in Ruby
 
Scala and Spring
Scala and SpringScala and Spring
Scala and Spring
 
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UKIntroduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
Introduction to Sqoop Aaron Kimball Cloudera Hadoop User Group UK
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabad
 
Orcale dba training
Orcale dba trainingOrcale dba training
Orcale dba training
 
Oracle DBA Training in Hyderabad
Oracle DBA Training in HyderabadOracle DBA Training in Hyderabad
Oracle DBA Training in Hyderabad
 
Oracle adapters for Ruby ORMs
Oracle adapters for Ruby ORMsOracle adapters for Ruby ORMs
Oracle adapters for Ruby ORMs
 
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DBPower Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
Power Saturday 2019 B4 - From relational to Multimodel Azure Cosmos DB
 

Recently uploaded

State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...КАТЕРИНА АБЗЯТОВА  «Ефективне планування тестування  ключові аспекти та практ...
КАТЕРИНА АБЗЯТОВА «Ефективне планування тестування ключові аспекти та практ...
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
UiPath New York Community Day in-person event
UiPath New York Community Day in-person eventUiPath New York Community Day in-person event
UiPath New York Community Day in-person event
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 

PostgreSQL v9.4features

  • 2. •JSONB-jsonBinary Storage •Replication improvements-Replication Slots •Logical Decoding in WAL log •Time Lagging Replica •pg_prewarm •ALTER SYSTEM Command •Great new enhancements in aggregation features
  • 3. Wasn’t JSON was introduced in v9.2? Well it just got better JSONB is much more optimized and faster for lookup New functions to extract and manipulate the jsondata You have the flexibility without compromising on Reliability! Non-relational data with ACID compliance!
  • 4. row_to_json–to convert a row to json json_object–Create jsonobject out of text array json_build_object–Create jsonobject out of variadicargument list array_to_json–to converan array to JSON json_eachand json_each_text–convert jsonobjects in key-value pair json_extract_path-Get value of a jsonobject json_populate_recordand json_populate_recordset-Convert jsonobject to records
  • 5. Operator Operand Type Purpose -> int Get JSON arraryelement -> text Get JSON object field ->> int Get JSON array element as text ->> text Get JSON object fieldas text #> array of text Get JSONobject at specified path #>> array of text Get JSON object at specified path as text @> jsonb Does the left JSON value contain within it the right value? <@ jsonb Is the left JSON value contained within the right value? ? text Does the key/elementstringexist within the JSON value? ?| text[] Do any of these key/elementstringsexist? ?& text[] Do all of these key/elementstringsexist?
  • 7. select data from Table as a jsonobject- SELECT JSON_BUILD_OBJECT( 'name',name) FROM books; Convert a row to json SELECT ROW_TO_JSON(my_row) FROM ( SELECT ROW(books.*) FROM books )my_row;
  • 8. Select output of join as a jsonobject- SELECT JSON_BUILD_OBJECT( 'name', name, 'author', name_arr) FROM( SELECT ARRAY_AGG( a.name ) AS name_arr, b.name AS name FROM authors a JOIN author_book_mapab ON a.id=ab.author_id JOIN books b ON b.id=ab.book_id GROUP BY b.name ) books_authors_join;
  • 9. Now you need to guess “wal_keep_segment” to avoid walfiles from getting removed Simply create a replication slot and WAL which are yet not replicated to the slot will not be removed from live WAL location Time Lagging Replica-You can define a lag period for your replica This can be used for back-dated reporting Or recover from a user error –an accidentally dropped table or a truncated table
  • 10. Set WAL level to ‘logical’ to do more verbose recoding in WAL files This will also record table and relation level details in each WAL entry These WAL files can be used for logical decoding and logical replication to replicate changes on a particular table There are commercial and open source solutions which are in beta stage and are based on this approach
  • 11. ALTER SYSTEM Command-Now a DBA can alter the configuration with ALTER SYSTEM command and avoid changing it in postgresql.conf pg_prewarm-now a DBA can load certain relations and blocks in cache after startup and avoid performance issues due to cold-reboot
  • 12. https://wiki.postgresql.org/wiki/What's_new_in_PostgreSQL_9.4 Hangout Recording for Replication Features in v9.4- https://www.youtube.com/watch?v=-HkrXwaWCb8 EnterpriseDB Whitepaper-http://www.enterprisedb.com/nosql-for-enterprise http://www.craigkerstiens.com/2014/03/24/Postgres-9.4-Looking-up/ Or just mail me… sameer.kasi200x@gmail.com sameer.kumar@ashnik.com