SlideShare a Scribd company logo
PostgreSQL - Object Relational Database
Presenter: Mubashar Iqbal
Senior Software Engineer
Object Relational Database System
Judging Criteria ??
Fast
Flexible
Powerful
Scalable
Easy Deployment
What’s in your mind ?
PostgreSQL - Object Relational Database
Introduction
The world's most advanced open source object-relational database system. The open
source Oracle. PostgreSQL has a large distributed developer and user community.
Community-owned with many companies involved.
Supported operating systems
● Linux
● Unix
● Mac OS X
● Solaris
● Windows
Native programming interfaces for:
C/C++, Java, .Net, Perl, Python, Ruby, PHP
Development Priorities
● Designed by/for Database Administrators
● Data integrity
● Security
● Reliability
● Standards
● DB Features
● Performance
● Ease-of-use
● Programmer Features
Most Common Uses
● ERP
● Data Warehouse
● Geographic
● OEM applications
● Network tools
● CRM
Prominent users
● Yahoo! for web user behavioral analysis, storing two petabytes and claimed to be
the largest data warehouse using a heavily modified version of PostgreSQL
● Sony Online multiplayer online games.
● Reddit social news website.
● Skype VoIP application, central business databases.
● Sun xVM, Sun's virtualization and datacenter automation suite.
● MusicBrainz, open online music encyclopedia.
● MyYearbook social networking site.
● Instagram, a popular mobile photo sharing service
● Disqus, an online discussion and commenting service
Features
● PostgreSQL often described as an open-source version of Oracle.
● BSD/MIT type license
● Reliability is PostgreSQL's top priority.
● Well-engineered, capable of supporting high-transaction and mission-critical
applications.
● Comprehensive documentation and manuals available for free online.
● Commercial support is available from independent vendors.
● PostgreSQL is fully ACID compliant.
● PostgreSQL is considered the solemn, full-featured, workhorse for transactional
enterprise applications, with strong ACID compliance.
Features (contd..)
● PostgreSQL supports one storage engine.
● SSL encryption
● Online backup
● Point-in-time recovery: Restore to any time in the past.
● Regular expression
Tools
● Psql: Command line front-end
● pgAdmin: GUI front-end
● phpPgadmin: Web based front-end
● MS ODBC
● MS Office + Postgres
● NaviCat: $$
● DeZign: $$
● EMS SQL Manager for PostgreSQL: $$
Data Types
● Numeric Types
● Character Types
● Hierarchical Types
● Binary Data Types
● Geometric Types
● Network Address Types
● Text Search Types
● UUID Type
● XML Type
● JSON Type
● Arrays
● Composite Types
Indexes
B-tree: B-trees can handle equality and range queries on data that can be sorted into
some ordering (<, <=,=,>=,>)
Hash: Hash indexes can only handle simple equality comparisons
GIN: GIN indexes are inverted indexes which can handle values that contain more than
one key, arrays for example, GIN operator classes for one-dimensional arrays
(<@,@>,=,&&)
GiST: Generalized Search Tree, it is a tree-structured access method and also known as
two-dimensional geometric data types (<@,@>,=,&&,>>,<<,&<,>&,~=)
Functions
A stored procedure and user-defined function is a set of SQL and procedural statements
(declarations, assignments, loops, flow-of-control) that stored on the database server and
can be invoked using the SQL interface.
CREATE FUNCTION function_name(p1 type, p2 type)
RETURNS type AS
BEGIN
-- logic
END;
LANGUAGE language_name;
Triggers
On DML (Data Manipulation Language) SELECT, INSERT, UPDATE, DELETE
CREATE TRIGGER
name { BEFORE | AFTER } { event [ OR ... ] }
ON
table [ FOR [ EACH ] { ROW | STATEMENT } ]
EXECUTE PROCEDURE
funcname ( arguments )
Cursors
● Used instead of FOR.
● Avoid memory overrun.
● Large data set.
DECLARE curs1 refcursor;
curs2 CURSOR FOR SELECT * FROM tenk1;
OPEN curs1 FOR SELECT * FROM foo WHERE key = mykey;
FETCH curs2 INTO foo, bar, baz;
CLOSE curs1;
View
View consists of a stored query accessible as a virtual table in a relational database or a
set of documents in a document-oriented database composed of the result set of a query.
Views are a great way to simplify your data model.
CREATE VIEW table_information AS
SELECT * FROM table WHERE id = 123;
Now you can simply query your new table directly:
SELECT * FROM table_information;
User-defined objects
New types of almost all objects inside the database can be created, including:
● Casts
● Conversions
● Data types
● Domains
● Functions, including aggregate functions and window functions
● Indexes including custom indexes for custom types
● Operators (existing ones can be overloaded)
● Procedural languages
Replication Methods
1. Master/Slave
● Asynchronous
● Synchronous
2. Multi-Master
● Asynchronous
● Synchronous
3. Proxy
4. Standby system
Master/Slave Replication
Asynchronous Synchronous
High availability High availibility
Read performance Better read performance
Offline peers Worse write performance
async
M S M S
sync
Multi-Master Replication
Asynchronous Synchronous
Read performance High availiability
Faster access across WANs Read performance
Manage offline peers Difficult to get good write performance
M M M M
async sync
Scaling behaviour
Comparison of scaling behaviour
Hierarchical Database
Data is organized into a tree like structure.
Representing information using parent/child relationships.
Each parent can have many children, but each child has only one parent also known as a 1-
to-many relationship.
Different ways store data like this are
• Enumeration path (ltree)
• Adjacency List
• Nested Sets
LTree – Label Tree
● Ltree is a PostgreSQL module.
● It is implements a data type ltree for representing labels of data stored in a
hierarchical tree-like structure.
● Labels must be less than 256 bytes long. ltree stores a label path.
● A label path is a sequence of zero or more labels separated by dots.
● ltree supports several types of indexes that can speed up the indicated operators.
● Ltree performance is much better when you need to do ad-hoc queries over the tree
● Faster than recursive function that constantly needs to recalculate the branching.
● Some other databases have similar types. SQL Server 2008 has a datatype called
HierarchyID which serves the same purpose as ltree but with different syntax.
Example
Technique Adjacency Ltree
Query WITH RECURSIVE d AS (
SELECT id
FROM sponsorship WHERE id = 799
UNION ALL
SELECT s.id
FROM d JOIN sponsorship s ON
s.parent_fk = d.id
)
SELECT * FROM d ORDER BY id
LIMIT 100;
WITH p AS (
SELECT path FROM
sponsorship
WHERE id=799
)
SELECT s.id
FROM sponsorship s, p
WHERE s.path <@ p.path
ORDER BY s.id LIMIT 100;
Total Runtime 1946.48 ms 28.00 ms
More Details
1. Value Expression
http://www.postgresql.org/docs/9.2/static/sql-expressions.html
2. String Functions and Operators
http://www.postgresql.org/docs/9.2/static/functions-string.html
3. Mathematical Functions and Operators
http://www.postgresql.org/docs/9.2/static/functions-math.html
4. MySQL vs PostgreSQL
http://get.enterprisedb.com/whitepapers/Postgres_Plus_8.4_vs_MySQL_5.5.pdf
5. Scaling Behaviour
http://tweakers.net/reviews/657/1/database-test-dual-intel-xeon-5160-introduction.html
References
http://www.postgresql.org/
http://tweakers.net/reviews/657/5/database-test-dual-intel-xeon-5160-
comparison-of-scaling-behaviour.html
http://www.slideshare.net/petereisentraut/replication-solutions-for-postgresql
http://gbif.blogspot.com/2012/06/taxonomic-trees-in-postgresql.html
http://www.slideshare.net/vuhung16plus/postgre-sqlintroduction20100506
PostgreSQL - Object Relational Database

More Related Content

What's hot (20)

Yaml
YamlYaml
Yaml
Christoph Santschi
 
Oracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTSOracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTS
Christian Gohmann
 
Comparison of ACFS and DBFS
Comparison of ACFS and DBFSComparison of ACFS and DBFS
Comparison of ACFS and DBFS
DanielHillinger
 
Microsoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxMicrosoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptx
samtakke1
 
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud
PgDay.Seoul
 
Oracle ASM Training
Oracle ASM TrainingOracle ASM Training
Oracle ASM Training
Vigilant Technologies
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
EDB
 
Spark SQL
Spark SQLSpark SQL
Spark SQL
Joud Khattab
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
Jonas Bonér
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
Harri Kauhanen
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & Features
DataStax Academy
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
nehabsairam
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
Peter Eisentraut
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep Internal
EXEM
 
NoSQL databases
NoSQL databasesNoSQL databases
NoSQL databases
Marin Dimitrov
 
APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101
Connor McDonald
 
SQL
SQLSQL
SQL
Reimuel Bisnar
 
Introduction to elasticsearch
Introduction to elasticsearchIntroduction to elasticsearch
Introduction to elasticsearch
pmanvi
 
Apache Spark & Streaming
Apache Spark & StreamingApache Spark & Streaming
Apache Spark & Streaming
Fernando Rodriguez
 
Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022
Grant McAlister
 
Oracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTSOracle 21c: New Features and Enhancements of Data Pump & TTS
Oracle 21c: New Features and Enhancements of Data Pump & TTS
Christian Gohmann
 
Comparison of ACFS and DBFS
Comparison of ACFS and DBFSComparison of ACFS and DBFS
Comparison of ACFS and DBFS
DanielHillinger
 
Microsoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxMicrosoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptx
samtakke1
 
[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud[pgday.Seoul 2022] PostgreSQL with Google Cloud
[pgday.Seoul 2022] PostgreSQL with Google Cloud
PgDay.Seoul
 
Mastering PostgreSQL Administration
Mastering PostgreSQL AdministrationMastering PostgreSQL Administration
Mastering PostgreSQL Administration
EDB
 
Scalability, Availability & Stability Patterns
Scalability, Availability & Stability PatternsScalability, Availability & Stability Patterns
Scalability, Availability & Stability Patterns
Jonas Bonér
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & Features
DataStax Academy
 
introduction to NOSQL Database
introduction to NOSQL Databaseintroduction to NOSQL Database
introduction to NOSQL Database
nehabsairam
 
Programming with Python and PostgreSQL
Programming with Python and PostgreSQLProgramming with Python and PostgreSQL
Programming with Python and PostgreSQL
Peter Eisentraut
 
PostgreSQL Deep Internal
PostgreSQL Deep InternalPostgreSQL Deep Internal
PostgreSQL Deep Internal
EXEM
 
APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101
Connor McDonald
 
Introduction to elasticsearch
Introduction to elasticsearchIntroduction to elasticsearch
Introduction to elasticsearch
pmanvi
 
Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022Full Page Writes in PostgreSQL PGCONFEU 2022
Full Page Writes in PostgreSQL PGCONFEU 2022
Grant McAlister
 

Viewers also liked (13)

Small Overview of Skype Database Tools
Small Overview of Skype Database ToolsSmall Overview of Skype Database Tools
Small Overview of Skype Database Tools
elliando dias
 
The Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoThe Object Oriented Database System Manifesto
The Object Oriented Database System Manifesto
Beat Signer
 
Object Relational Database Management System
Object Relational Database Management SystemObject Relational Database Management System
Object Relational Database Management System
Amar Myana
 
A brief introduction to PostgreSQL
A brief introduction to PostgreSQLA brief introduction to PostgreSQL
A brief introduction to PostgreSQL
Vu Hung Nguyen
 
Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management System
Ajay Jha
 
Cloud Architecture best practices
Cloud Architecture best practicesCloud Architecture best practices
Cloud Architecture best practices
Omid Vahdaty
 
Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)
Sahan Walpitagamage
 
Ordbms
OrdbmsOrdbms
Ordbms
ramandeep brar
 
Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014
EDB
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbms
maryeem
 
08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS
koolkampus
 
Types dbms
Types dbmsTypes dbms
Types dbms
Avnish Shaw
 
Practical Object Oriented Models In Sql
Practical Object Oriented Models In SqlPractical Object Oriented Models In Sql
Practical Object Oriented Models In Sql
Karwin Software Solutions LLC
 
Small Overview of Skype Database Tools
Small Overview of Skype Database ToolsSmall Overview of Skype Database Tools
Small Overview of Skype Database Tools
elliando dias
 
The Object Oriented Database System Manifesto
The Object Oriented Database System ManifestoThe Object Oriented Database System Manifesto
The Object Oriented Database System Manifesto
Beat Signer
 
Object Relational Database Management System
Object Relational Database Management SystemObject Relational Database Management System
Object Relational Database Management System
Amar Myana
 
A brief introduction to PostgreSQL
A brief introduction to PostgreSQLA brief introduction to PostgreSQL
A brief introduction to PostgreSQL
Vu Hung Nguyen
 
Object Oriented Database Management System
Object Oriented Database Management SystemObject Oriented Database Management System
Object Oriented Database Management System
Ajay Jha
 
Cloud Architecture best practices
Cloud Architecture best practicesCloud Architecture best practices
Cloud Architecture best practices
Omid Vahdaty
 
Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)Object-Relational Database Systems(ORDBMSs)
Object-Relational Database Systems(ORDBMSs)
Sahan Walpitagamage
 
Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014Postgres in Production - Best Practices 2014
Postgres in Production - Best Practices 2014
EDB
 
Object Oriented Dbms
Object Oriented DbmsObject Oriented Dbms
Object Oriented Dbms
maryeem
 
08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS08. Object Oriented Database in DBMS
08. Object Oriented Database in DBMS
koolkampus
 
Ad

Similar to PostgreSQL - Object Relational Database (20)

PostgreSQL
PostgreSQLPostgreSQL
PostgreSQL
Reuven Lerner
 
Introduction to PostgreSQL
Introduction to PostgreSQLIntroduction to PostgreSQL
Introduction to PostgreSQL
Jim Mlodgenski
 
PostgreSQL - Case Study
PostgreSQL - Case StudyPostgreSQL - Case Study
PostgreSQL - Case Study
S.Shayan Daneshvar
 
PostgreSQL- An Introduction
PostgreSQL- An IntroductionPostgreSQL- An Introduction
PostgreSQL- An Introduction
Smita Prasad
 
Postgresql
PostgresqlPostgresql
Postgresql
NexThoughts Technologies
 
Chjkkkkkkkkkkkkkkkkkjjjjjjjjjjjjjjjjjjjjjjjjjj01_The Basics.pptx
Chjkkkkkkkkkkkkkkkkkjjjjjjjjjjjjjjjjjjjjjjjjjj01_The Basics.pptxChjkkkkkkkkkkkkkkkkkjjjjjjjjjjjjjjjjjjjjjjjjjj01_The Basics.pptx
Chjkkkkkkkkkkkkkkkkkjjjjjjjjjjjjjjjjjjjjjjjjjj01_The Basics.pptx
MhmdMk10
 
PostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty databasePostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty database
Barry Jones
 
An evening with Postgresql
An evening with PostgresqlAn evening with Postgresql
An evening with Postgresql
Joshua Drake
 
Demystifying PostgreSQL
Demystifying PostgreSQLDemystifying PostgreSQL
Demystifying PostgreSQL
NOLOH LLC.
 
Demystifying PostgreSQL (Zendcon 2010)
Demystifying PostgreSQL (Zendcon 2010)Demystifying PostgreSQL (Zendcon 2010)
Demystifying PostgreSQL (Zendcon 2010)
NOLOH LLC.
 
PostgreSQL 9.0 & The Future
PostgreSQL 9.0 & The FuturePostgreSQL 9.0 & The Future
PostgreSQL 9.0 & The Future
Aaron Thul
 
Relational vs. Non-Relational
Relational vs. Non-RelationalRelational vs. Non-Relational
Relational vs. Non-Relational
PostgreSQL Experts, Inc.
 
PostgreSQL Terminology
PostgreSQL TerminologyPostgreSQL Terminology
PostgreSQL Terminology
Showmax Engineering
 
PostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLPostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQL
Alexei Krasner
 
PostgreSQL, your NoSQL database
PostgreSQL, your NoSQL databasePostgreSQL, your NoSQL database
PostgreSQL, your NoSQL database
Reuven Lerner
 
PostgreSQL Prologue
PostgreSQL ProloguePostgreSQL Prologue
PostgreSQL Prologue
Md. Golam Hossain
 
Modern sql
Modern sqlModern sql
Modern sql
Elizabeth Smith
 
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
PROIDEA
 
Sql analytic queries tips
Sql analytic queries tipsSql analytic queries tips
Sql analytic queries tips
Vedran Bilopavlović
 
Open Source SQL Databases
Open Source SQL DatabasesOpen Source SQL Databases
Open Source SQL Databases
Emanuel Calvo
 
Introduction to PostgreSQL
Introduction to PostgreSQLIntroduction to PostgreSQL
Introduction to PostgreSQL
Jim Mlodgenski
 
PostgreSQL- An Introduction
PostgreSQL- An IntroductionPostgreSQL- An Introduction
PostgreSQL- An Introduction
Smita Prasad
 
Chjkkkkkkkkkkkkkkkkkjjjjjjjjjjjjjjjjjjjjjjjjjj01_The Basics.pptx
Chjkkkkkkkkkkkkkkkkkjjjjjjjjjjjjjjjjjjjjjjjjjj01_The Basics.pptxChjkkkkkkkkkkkkkkkkkjjjjjjjjjjjjjjjjjjjjjjjjjj01_The Basics.pptx
Chjkkkkkkkkkkkkkkkkkjjjjjjjjjjjjjjjjjjjjjjjjjj01_The Basics.pptx
MhmdMk10
 
PostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty databasePostgreSQL - It's kind've a nifty database
PostgreSQL - It's kind've a nifty database
Barry Jones
 
An evening with Postgresql
An evening with PostgresqlAn evening with Postgresql
An evening with Postgresql
Joshua Drake
 
Demystifying PostgreSQL
Demystifying PostgreSQLDemystifying PostgreSQL
Demystifying PostgreSQL
NOLOH LLC.
 
Demystifying PostgreSQL (Zendcon 2010)
Demystifying PostgreSQL (Zendcon 2010)Demystifying PostgreSQL (Zendcon 2010)
Demystifying PostgreSQL (Zendcon 2010)
NOLOH LLC.
 
PostgreSQL 9.0 & The Future
PostgreSQL 9.0 & The FuturePostgreSQL 9.0 & The Future
PostgreSQL 9.0 & The Future
Aaron Thul
 
PostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQLPostgreSQL as an Alternative to MSSQL
PostgreSQL as an Alternative to MSSQL
Alexei Krasner
 
PostgreSQL, your NoSQL database
PostgreSQL, your NoSQL databasePostgreSQL, your NoSQL database
PostgreSQL, your NoSQL database
Reuven Lerner
 
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
JDD 2016 - Tomasz Borek - DB for next project? Why, Postgres, of course
PROIDEA
 
Open Source SQL Databases
Open Source SQL DatabasesOpen Source SQL Databases
Open Source SQL Databases
Emanuel Calvo
 
Ad

Recently uploaded (20)

Artificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across IndustriesArtificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across Industries
SandeepKS52
 
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration KeySmadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
 
Software Engineering Process, Notation & Tools Introduction - Part 4
Software Engineering Process, Notation & Tools Introduction - Part 4Software Engineering Process, Notation & Tools Introduction - Part 4
Software Engineering Process, Notation & Tools Introduction - Part 4
Gaurav Sharma
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutionsZoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlowDevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchAgentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Maxim Salnikov
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage OverlookCode and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free DownloadWondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
AI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | CertivoAI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | Certivo
certivoai
 
Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3
Gaurav Sharma
 
How to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdfHow to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdf
Creative Fosters
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
Step by step guide to install Flutter and Dart
Step by step guide to install Flutter and DartStep by step guide to install Flutter and Dart
Step by step guide to install Flutter and Dart
S Pranav (Deepu)
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
Transmission Media. (Computer Networks)
Transmission Media.  (Computer Networks)Transmission Media.  (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native BarcelonaOpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink TemplateeeeeeeeeeeeeeeeeeeeeeeeeeNeuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptxMicrosoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 
Artificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across IndustriesArtificial Intelligence Applications Across Industries
Artificial Intelligence Applications Across Industries
SandeepKS52
 
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration KeySmadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
Smadav Pro 2025 Rev 15.4 Crack Full Version With Registration Key
joybepari360
 
Software Engineering Process, Notation & Tools Introduction - Part 4
Software Engineering Process, Notation & Tools Introduction - Part 4Software Engineering Process, Notation & Tools Introduction - Part 4
Software Engineering Process, Notation & Tools Introduction - Part 4
Gaurav Sharma
 
Zoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutionsZoneranker’s Digital marketing solutions
Zoneranker’s Digital marketing solutions
reenashriee
 
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlowDevOps for AI: running LLMs in production with Kubernetes and KubeFlow
DevOps for AI: running LLMs in production with Kubernetes and KubeFlow
Aarno Aukia
 
AI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA TechnologiesAI and Deep Learning with NVIDIA Technologies
AI and Deep Learning with NVIDIA Technologies
SandeepKS52
 
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI SearchAgentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Agentic Techniques in Retrieval-Augmented Generation with Azure AI Search
Maxim Salnikov
 
Code and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage OverlookCode and No-Code Journeys: The Coverage Overlook
Code and No-Code Journeys: The Coverage Overlook
Applitools
 
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free DownloadWondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Wondershare PDFelement Pro 11.4.20.3548 Crack Free Download
Puppy jhon
 
AI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | CertivoAI-Powered Compliance Solutions for Global Regulations | Certivo
AI-Powered Compliance Solutions for Global Regulations | Certivo
certivoai
 
Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3Software Engineering Process, Notation & Tools Introduction - Part 3
Software Engineering Process, Notation & Tools Introduction - Part 3
Gaurav Sharma
 
How to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdfHow to Choose the Right Web Development Agency.pdf
How to Choose the Right Web Development Agency.pdf
Creative Fosters
 
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
Milwaukee Marketo User Group June 2025 - Optimize and Enhance Efficiency - Sm...
BradBedford3
 
Step by step guide to install Flutter and Dart
Step by step guide to install Flutter and DartStep by step guide to install Flutter and Dart
Step by step guide to install Flutter and Dart
S Pranav (Deepu)
 
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Meet You in the Middle: 1000x Performance for Parquet Queries on PB-Scale Dat...
Alluxio, Inc.
 
Transmission Media. (Computer Networks)
Transmission Media.  (Computer Networks)Transmission Media.  (Computer Networks)
Transmission Media. (Computer Networks)
S Pranav (Deepu)
 
OpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native BarcelonaOpenTelemetry 101 Cloud Native Barcelona
OpenTelemetry 101 Cloud Native Barcelona
Imma Valls Bernaus
 
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink TemplateeeeeeeeeeeeeeeeeeeeeeeeeeNeuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
Neuralink Templateeeeeeeeeeeeeeeeeeeeeeeeee
alexandernoetzold
 
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptxMicrosoft Business-230T01A-ENU-PowerPoint_01.pptx
Microsoft Business-230T01A-ENU-PowerPoint_01.pptx
soulamaabdoulaye128
 
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...Application Modernization with Choreo - The AI-Native Internal Developer Plat...
Application Modernization with Choreo - The AI-Native Internal Developer Plat...
WSO2
 

PostgreSQL - Object Relational Database

  • 2. Presenter: Mubashar Iqbal Senior Software Engineer Object Relational Database System
  • 11. Introduction The world's most advanced open source object-relational database system. The open source Oracle. PostgreSQL has a large distributed developer and user community. Community-owned with many companies involved. Supported operating systems ● Linux ● Unix ● Mac OS X ● Solaris ● Windows Native programming interfaces for: C/C++, Java, .Net, Perl, Python, Ruby, PHP
  • 12. Development Priorities ● Designed by/for Database Administrators ● Data integrity ● Security ● Reliability ● Standards ● DB Features ● Performance ● Ease-of-use ● Programmer Features
  • 13. Most Common Uses ● ERP ● Data Warehouse ● Geographic ● OEM applications ● Network tools ● CRM
  • 14. Prominent users ● Yahoo! for web user behavioral analysis, storing two petabytes and claimed to be the largest data warehouse using a heavily modified version of PostgreSQL ● Sony Online multiplayer online games. ● Reddit social news website. ● Skype VoIP application, central business databases. ● Sun xVM, Sun's virtualization and datacenter automation suite. ● MusicBrainz, open online music encyclopedia. ● MyYearbook social networking site. ● Instagram, a popular mobile photo sharing service ● Disqus, an online discussion and commenting service
  • 15. Features ● PostgreSQL often described as an open-source version of Oracle. ● BSD/MIT type license ● Reliability is PostgreSQL's top priority. ● Well-engineered, capable of supporting high-transaction and mission-critical applications. ● Comprehensive documentation and manuals available for free online. ● Commercial support is available from independent vendors. ● PostgreSQL is fully ACID compliant. ● PostgreSQL is considered the solemn, full-featured, workhorse for transactional enterprise applications, with strong ACID compliance.
  • 16. Features (contd..) ● PostgreSQL supports one storage engine. ● SSL encryption ● Online backup ● Point-in-time recovery: Restore to any time in the past. ● Regular expression
  • 17. Tools ● Psql: Command line front-end ● pgAdmin: GUI front-end ● phpPgadmin: Web based front-end ● MS ODBC ● MS Office + Postgres ● NaviCat: $$ ● DeZign: $$ ● EMS SQL Manager for PostgreSQL: $$
  • 18. Data Types ● Numeric Types ● Character Types ● Hierarchical Types ● Binary Data Types ● Geometric Types ● Network Address Types ● Text Search Types ● UUID Type ● XML Type ● JSON Type ● Arrays ● Composite Types
  • 19. Indexes B-tree: B-trees can handle equality and range queries on data that can be sorted into some ordering (<, <=,=,>=,>) Hash: Hash indexes can only handle simple equality comparisons GIN: GIN indexes are inverted indexes which can handle values that contain more than one key, arrays for example, GIN operator classes for one-dimensional arrays (<@,@>,=,&&) GiST: Generalized Search Tree, it is a tree-structured access method and also known as two-dimensional geometric data types (<@,@>,=,&&,>>,<<,&<,>&,~=)
  • 20. Functions A stored procedure and user-defined function is a set of SQL and procedural statements (declarations, assignments, loops, flow-of-control) that stored on the database server and can be invoked using the SQL interface. CREATE FUNCTION function_name(p1 type, p2 type) RETURNS type AS BEGIN -- logic END; LANGUAGE language_name;
  • 21. Triggers On DML (Data Manipulation Language) SELECT, INSERT, UPDATE, DELETE CREATE TRIGGER name { BEFORE | AFTER } { event [ OR ... ] } ON table [ FOR [ EACH ] { ROW | STATEMENT } ] EXECUTE PROCEDURE funcname ( arguments )
  • 22. Cursors ● Used instead of FOR. ● Avoid memory overrun. ● Large data set. DECLARE curs1 refcursor; curs2 CURSOR FOR SELECT * FROM tenk1; OPEN curs1 FOR SELECT * FROM foo WHERE key = mykey; FETCH curs2 INTO foo, bar, baz; CLOSE curs1;
  • 23. View View consists of a stored query accessible as a virtual table in a relational database or a set of documents in a document-oriented database composed of the result set of a query. Views are a great way to simplify your data model. CREATE VIEW table_information AS SELECT * FROM table WHERE id = 123; Now you can simply query your new table directly: SELECT * FROM table_information;
  • 24. User-defined objects New types of almost all objects inside the database can be created, including: ● Casts ● Conversions ● Data types ● Domains ● Functions, including aggregate functions and window functions ● Indexes including custom indexes for custom types ● Operators (existing ones can be overloaded) ● Procedural languages
  • 25. Replication Methods 1. Master/Slave ● Asynchronous ● Synchronous 2. Multi-Master ● Asynchronous ● Synchronous 3. Proxy 4. Standby system
  • 26. Master/Slave Replication Asynchronous Synchronous High availability High availibility Read performance Better read performance Offline peers Worse write performance async M S M S sync
  • 27. Multi-Master Replication Asynchronous Synchronous Read performance High availiability Faster access across WANs Read performance Manage offline peers Difficult to get good write performance M M M M async sync
  • 30. Hierarchical Database Data is organized into a tree like structure. Representing information using parent/child relationships. Each parent can have many children, but each child has only one parent also known as a 1- to-many relationship. Different ways store data like this are • Enumeration path (ltree) • Adjacency List • Nested Sets
  • 31. LTree – Label Tree ● Ltree is a PostgreSQL module. ● It is implements a data type ltree for representing labels of data stored in a hierarchical tree-like structure. ● Labels must be less than 256 bytes long. ltree stores a label path. ● A label path is a sequence of zero or more labels separated by dots. ● ltree supports several types of indexes that can speed up the indicated operators. ● Ltree performance is much better when you need to do ad-hoc queries over the tree ● Faster than recursive function that constantly needs to recalculate the branching. ● Some other databases have similar types. SQL Server 2008 has a datatype called HierarchyID which serves the same purpose as ltree but with different syntax.
  • 32. Example Technique Adjacency Ltree Query WITH RECURSIVE d AS ( SELECT id FROM sponsorship WHERE id = 799 UNION ALL SELECT s.id FROM d JOIN sponsorship s ON s.parent_fk = d.id ) SELECT * FROM d ORDER BY id LIMIT 100; WITH p AS ( SELECT path FROM sponsorship WHERE id=799 ) SELECT s.id FROM sponsorship s, p WHERE s.path <@ p.path ORDER BY s.id LIMIT 100; Total Runtime 1946.48 ms 28.00 ms
  • 33. More Details 1. Value Expression http://www.postgresql.org/docs/9.2/static/sql-expressions.html 2. String Functions and Operators http://www.postgresql.org/docs/9.2/static/functions-string.html 3. Mathematical Functions and Operators http://www.postgresql.org/docs/9.2/static/functions-math.html 4. MySQL vs PostgreSQL http://get.enterprisedb.com/whitepapers/Postgres_Plus_8.4_vs_MySQL_5.5.pdf 5. Scaling Behaviour http://tweakers.net/reviews/657/1/database-test-dual-intel-xeon-5160-introduction.html