SlideShare une entreprise Scribd logo
1  sur  40
Highload++ 2010
Scaling with Postgres
Robert Treat
Monday, October 25, 2010
Who Am I?
✤ Robert Treat
✤ OmniTI
✤ Design, Development,
Database, Ops
Monday, October 25, 2010
Who Am I?
✤ Robert Treat
✤ OmniTI
✤ Design, Development,
DATABASE, Ops
Monday, October 25, 2010
Who Am I?
✤ Robert Treat
✤ OmniTI
✤ Design, Development,
DATABASE, Ops
✤ Etsy, Allisports,
National Geographic,
Gilt, etc...
Monday, October 25, 2010
Who Am I?
✤ Robert Treat
✤ Postgres
✤ Web, Advocacy,
phpPgAdmin
✤ Major Contributor
Monday, October 25, 2010
Who Am I?
✤ Postgres 6.5 -> 9.1alpha1
✤ Terabytes of data
✤ Millions of transactions per day
✤ OLTP, ODS, DW
✤ Perl, PHP, Java, Ruby, C#
Monday, October 25, 2010
Who Am I?
OBSERVATION == LEARNING
(hopefully)
Monday, October 25, 2010
Scalability
It is the ability of a computer
application or product (hardware
or software) to continue to
function well when it (or its
context) is changed in size or
volume in order to meet a user
need.
Monday, October 25, 2010
Scalability
Given ever increasing load
Monday, October 25, 2010
Scalability
NEVER GO DOWN
ALWAYS PERFORM WELL
Given ever increasing load
Monday, October 25, 2010
Scalability
NEVER GO DOWN
ALWAYS PERFORM WELL
Given ever increasing load
impossible goal, but we’ll try
Monday, October 25, 2010
Scalability
NEVER GO DOWN
ALWAYS PERFORM WELL
Given ever increasing load
NOTE! data loss is not a goal, but ideally we won’t lose it :-)
Monday, October 25, 2010
It starts with culture...
Monday, October 25, 2010
✤ Get over schema purity
✤ add column default not null
Monday, October 25, 2010
✤ Get over schema purity
✤ add column default not null
Good performance comes from good schema
design, HOWEVER, perfect relational
modeling is NOT THE GOAL
Monday, October 25, 2010
✤ Devs must own schema and queries
✤ they design, you refine
Monday, October 25, 2010
✤ Devs must own schema and queries
✤ they design, you refine
Performance and scalability cannot be
managed solely within the database; both
require application level knowledge. To
achieve this, application developers need to
have visibility of the resources they work on
Monday, October 25, 2010
GainVisibility
Monday, October 25, 2010
GainVisibility
✤ Monitoring
✤ Alerts
✤ Trending
✤ Capacity Planning
✤ Performance Tuning
Monday, October 25, 2010
GainVisibility
✤ Alerts
✤ server: out of disk space, high load, etc...
✤ database: connections, sequences, etc...
✤ business: registrations, revenue, etc...
✤ etc...
check_postgres.pl
Monday, October 25, 2010
GainVisibility
✤ Trending
✤ server: disk usage, load, etc...
✤ database: connections, sequences, etc...
✤ business: registrations, revenue, etc...
✤ etc...
cacti, mrtg, circonus
Monday, October 25, 2010
GainVisibility
✤ Capacity Planning
✤ disks, cpu, memory
✤ connections, vacuum, bloat
simple projections, done regularly, are good enough
Monday, October 25, 2010
GainVisibility
✤ Performance tuning
✤ how long do queries take?
✤ how often do they run?
pgfouine
Monday, October 25, 2010
GainVisibility
COMMITS/PUSHES
Monday, October 25, 2010
GainVisibility
ALL alerts, graphs, query reports, etc...
MUST be available to EVERYONE on
the team AT ALL TIMES
Monday, October 25, 2010
Hands on
You can’t succeed without first putting
the right culture in place.
Once you are on the right path, make
sure you have the right technology
Monday, October 25, 2010
PostgresVersions
✤ MINIMUM: 8.3
✤ removes xid for read only queries, significant reduction in vacuum
activity
Monday, October 25, 2010
PostgresVersions
✤ MINIMUM: 8.3
✤ removes xid for read only queries, significant reduction in vacuum
activity
seriously!
Monday, October 25, 2010
PostgresVersions
✤ MINIMUM: 8.3
✤ removes xid for read only queries, significant reduction in vacuum
activity
✤ BETTER: 8.4
✤ revised free space map management leads to more efficient
vacuuming
Monday, October 25, 2010
PostgresVersions
✤ MINIMUM: 8.3
✤ removes xid for read only queries, significant reduction in vacuum
activity
✤ BETTER: 8.4
✤ revised free space map management leads to more efficient
vacuuming
✤ WHY NOT? 9.0
✤ Hot standby / streaming replication couldn’t hurt
Monday, October 25, 2010
Speaking of replication
✤ Common practice for scaling websites
✤ Good for READ based loads
✤ We have used many:
✤ slony, rubyrep, bucardo, 9.0 built-in, mammoth, wrote-our-own
Monday, October 25, 2010
Speaking of replication
Monday, October 25, 2010
Speaking of replication
✤ No favorite system for this, evaluate based on:
✤ avoid solutions that duplicate writes at sql level (imho)
✤ how comfortable am I debugging the system?
✤ do you need automated schema changes?
✤ how much redundancy / complexity do you need?
✤ how does the system handle node failure for N nodes?
Monday, October 25, 2010
So what would you use? (tm)
✤ 2 Nodes, master + standby: Postgres 9.0
✤ Master + multiple slaves: Slony
✤ Master-Master: Bucardo
All choices subject to change!!
Monday, October 25, 2010
A word about “Sharding”
✤ Distributed computing is hard(er)
✤ we think of things in a singular global state
✤ the more we can work in that model, the better
✤ RDBM offer poor solutions for multiple masters
✤ you must manage that complexity on your own
Monday, October 25, 2010
A word about “Sharding”
✤ Splitting systems by service:
✤ separate db for login, forums, sales, etc...
✤ allows for growth
✤ provides simple interface
Monday, October 25, 2010
Pooling
✤ Postgres connections are expensive!
✤ fork new process per connection
✤ keep 1 process open per connection
✤ 1000+ processes you will notice trouble
Monday, October 25, 2010
Pooling
✤ Postgres connections are expensive!
✤ fork new process per connection
✤ keep 1 process open per connection
✤ 1000+ processes you will notice trouble
✤ POOLING
✤ JDBC, mod-perl
✤ pgbouncer ftw!
Monday, October 25, 2010
Summary
✤ Schema / Queries should be shared between dev, dba teams!
✤ Monitoring + Visibility!
✤ >= 8.3 Required!
✤ Replication, jump in it!
✤ Use connection pooling!
Monday, October 25, 2010
Thanks!
more:
@robtreat2
www.xzilla.net
Oleg & Crew
Highload++
OmniTI
Postgres Community!
You!
Monday, October 25, 2010

Contenu connexe

En vedette

EKO 4 Company Overview
EKO 4 Company OverviewEKO 4 Company Overview
EKO 4 Company OverviewVess Christoph
 
Annual_Report_2015_04_Final_Single-Page
Annual_Report_2015_04_Final_Single-PageAnnual_Report_2015_04_Final_Single-Page
Annual_Report_2015_04_Final_Single-PageHeather Thomas
 
Getting your name out there
Getting your name out thereGetting your name out there
Getting your name out thereAlex Cato
 
Dr ravi r kasliwal cardiologist medanta medicity
Dr ravi r kasliwal cardiologist medanta medicityDr ravi r kasliwal cardiologist medanta medicity
Dr ravi r kasliwal cardiologist medanta medicityDr R R Kasliwal
 
Less Alarming Alerts!
Less Alarming Alerts!Less Alarming Alerts!
Less Alarming Alerts!Robert Treat
 
Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016Robert Treat
 
Postgres 9.4 First Look
Postgres 9.4 First LookPostgres 9.4 First Look
Postgres 9.4 First LookRobert Treat
 
Managing Databases In A DevOps Environment
Managing Databases In A DevOps EnvironmentManaging Databases In A DevOps Environment
Managing Databases In A DevOps EnvironmentRobert Treat
 
Modern Monitoring - devopsdays Cuba
Modern Monitoring - devopsdays CubaModern Monitoring - devopsdays Cuba
Modern Monitoring - devopsdays Cubabridgetkromhout
 
Scaling up task processing with Celery
Scaling up task processing with CeleryScaling up task processing with Celery
Scaling up task processing with CeleryNicolas Grasset
 
rough draft sketches
rough draft sketchesrough draft sketches
rough draft sketchesbano2630
 

En vedette (13)

Ping pong & tennis.
Ping pong & tennis.Ping pong & tennis.
Ping pong & tennis.
 
EKO 4 Company Overview
EKO 4 Company OverviewEKO 4 Company Overview
EKO 4 Company Overview
 
Annual_Report_2015_04_Final_Single-Page
Annual_Report_2015_04_Final_Single-PageAnnual_Report_2015_04_Final_Single-Page
Annual_Report_2015_04_Final_Single-Page
 
Getting your name out there
Getting your name out thereGetting your name out there
Getting your name out there
 
Dr ravi r kasliwal cardiologist medanta medicity
Dr ravi r kasliwal cardiologist medanta medicityDr ravi r kasliwal cardiologist medanta medicity
Dr ravi r kasliwal cardiologist medanta medicity
 
Less Alarming Alerts!
Less Alarming Alerts!Less Alarming Alerts!
Less Alarming Alerts!
 
Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016Managing Databases In A DevOps Environment 2016
Managing Databases In A DevOps Environment 2016
 
Postgres 9.4 First Look
Postgres 9.4 First LookPostgres 9.4 First Look
Postgres 9.4 First Look
 
Managing Databases In A DevOps Environment
Managing Databases In A DevOps EnvironmentManaging Databases In A DevOps Environment
Managing Databases In A DevOps Environment
 
Modern Monitoring - devopsdays Cuba
Modern Monitoring - devopsdays CubaModern Monitoring - devopsdays Cuba
Modern Monitoring - devopsdays Cuba
 
Scaling up task processing with Celery
Scaling up task processing with CeleryScaling up task processing with Celery
Scaling up task processing with Celery
 
Salam_rahal_CV
Salam_rahal_CVSalam_rahal_CV
Salam_rahal_CV
 
rough draft sketches
rough draft sketchesrough draft sketches
rough draft sketches
 

Similaire à Scaling with Postgres (Highload++ 2010)

Scaling with Postgres (Robert Treat)
Scaling with Postgres (Robert Treat)Scaling with Postgres (Robert Treat)
Scaling with Postgres (Robert Treat)Ontico
 
Mysql features for the enterprise
Mysql features for the enterpriseMysql features for the enterprise
Mysql features for the enterpriseGiuseppe Maxia
 
DSR microservices
DSR microservicesDSR microservices
DSR microservicesSteve Upton
 
4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz Sowa
4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz Sowa4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz Sowa
4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz SowaPROIDEA
 
Microservices 101: opportunities, dilemmas and problems
Microservices 101: opportunities, dilemmas and problemsMicroservices 101: opportunities, dilemmas and problems
Microservices 101: opportunities, dilemmas and problemsŁukasz Sowa
 
Testing In Production (TiP) Advances with Big Data and the Cloud
Testing In Production (TiP) Advances with Big Data and the CloudTesting In Production (TiP) Advances with Big Data and the Cloud
Testing In Production (TiP) Advances with Big Data and the CloudSOASTA
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixC4Media
 
Drupal 8 for site builders
Drupal 8 for site buildersDrupal 8 for site builders
Drupal 8 for site buildersswentel
 
Design for Scale / Surge 2010
Design for Scale / Surge 2010Design for Scale / Surge 2010
Design for Scale / Surge 2010Christopher Brown
 
DBA Tips and Tricks - Presentation
DBA Tips and Tricks - PresentationDBA Tips and Tricks - Presentation
DBA Tips and Tricks - PresentationFrancisco Alvarez
 
Warsaw muleSoft meetup #11 MuleSoft OData
Warsaw muleSoft meetup #11 MuleSoft ODataWarsaw muleSoft meetup #11 MuleSoft OData
Warsaw muleSoft meetup #11 MuleSoft ODataPatryk Bandurski
 
The Trajectory of Change
The Trajectory of ChangeThe Trajectory of Change
The Trajectory of ChangeRaj Mudhar
 
Elastic Data Analytics Platform @Datadog
Elastic Data Analytics Platform @DatadogElastic Data Analytics Platform @Datadog
Elastic Data Analytics Platform @DatadogC4Media
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDBDenny Lee
 
DSR Microservices (Day 1, Part 1)
DSR Microservices (Day 1, Part 1)DSR Microservices (Day 1, Part 1)
DSR Microservices (Day 1, Part 1)Steve Upton
 
Bringing it all together
Bringing it all togetherBringing it all together
Bringing it all togetherMelissaMcKay15
 
Kusto (Azure Data Explorer) Training for R&D - January 2019
Kusto (Azure Data Explorer) Training for R&D - January 2019 Kusto (Azure Data Explorer) Training for R&D - January 2019
Kusto (Azure Data Explorer) Training for R&D - January 2019 Tal Bar-Zvi
 
Softshake 2013: Introduction to NoSQL with Couchbase
Softshake 2013: Introduction to NoSQL with CouchbaseSoftshake 2013: Introduction to NoSQL with Couchbase
Softshake 2013: Introduction to NoSQL with CouchbaseTugdual Grall
 
PyData Texas 2015 Keynote
PyData Texas 2015 KeynotePyData Texas 2015 Keynote
PyData Texas 2015 KeynotePeter Wang
 

Similaire à Scaling with Postgres (Highload++ 2010) (20)

Scaling with Postgres (Robert Treat)
Scaling with Postgres (Robert Treat)Scaling with Postgres (Robert Treat)
Scaling with Postgres (Robert Treat)
 
Mysql features for the enterprise
Mysql features for the enterpriseMysql features for the enterprise
Mysql features for the enterprise
 
DSR microservices
DSR microservicesDSR microservices
DSR microservices
 
4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz Sowa
4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz Sowa4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz Sowa
4Developers 2015: Mikroserwisy - szanse, dylematy i problemy - Łukasz Sowa
 
Microservices 101: opportunities, dilemmas and problems
Microservices 101: opportunities, dilemmas and problemsMicroservices 101: opportunities, dilemmas and problems
Microservices 101: opportunities, dilemmas and problems
 
Testing In Production (TiP) Advances with Big Data and the Cloud
Testing In Production (TiP) Advances with Big Data and the CloudTesting In Production (TiP) Advances with Big Data and the Cloud
Testing In Production (TiP) Advances with Big Data and the Cloud
 
Data Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFixData Science in the Cloud @StitchFix
Data Science in the Cloud @StitchFix
 
Drupal 8 for site builders
Drupal 8 for site buildersDrupal 8 for site builders
Drupal 8 for site builders
 
Design for Scale / Surge 2010
Design for Scale / Surge 2010Design for Scale / Surge 2010
Design for Scale / Surge 2010
 
DBA Tips and Tricks - Presentation
DBA Tips and Tricks - PresentationDBA Tips and Tricks - Presentation
DBA Tips and Tricks - Presentation
 
Warsaw muleSoft meetup #11 MuleSoft OData
Warsaw muleSoft meetup #11 MuleSoft ODataWarsaw muleSoft meetup #11 MuleSoft OData
Warsaw muleSoft meetup #11 MuleSoft OData
 
The Trajectory of Change
The Trajectory of ChangeThe Trajectory of Change
The Trajectory of Change
 
Elastic Data Analytics Platform @Datadog
Elastic Data Analytics Platform @DatadogElastic Data Analytics Platform @Datadog
Elastic Data Analytics Platform @Datadog
 
Introduction to Azure DocumentDB
Introduction to Azure DocumentDBIntroduction to Azure DocumentDB
Introduction to Azure DocumentDB
 
DSR Microservices (Day 1, Part 1)
DSR Microservices (Day 1, Part 1)DSR Microservices (Day 1, Part 1)
DSR Microservices (Day 1, Part 1)
 
Bringing it all together
Bringing it all togetherBringing it all together
Bringing it all together
 
Kusto (Azure Data Explorer) Training for R&D - January 2019
Kusto (Azure Data Explorer) Training for R&D - January 2019 Kusto (Azure Data Explorer) Training for R&D - January 2019
Kusto (Azure Data Explorer) Training for R&D - January 2019
 
Softshake 2013: Introduction to NoSQL with Couchbase
Softshake 2013: Introduction to NoSQL with CouchbaseSoftshake 2013: Introduction to NoSQL with Couchbase
Softshake 2013: Introduction to NoSQL with Couchbase
 
PyData Texas 2015 Keynote
PyData Texas 2015 KeynotePyData Texas 2015 Keynote
PyData Texas 2015 Keynote
 
Dba tips and_tricks
Dba tips and_tricksDba tips and_tricks
Dba tips and_tricks
 

Plus de Robert Treat

Advanced Int->Bigint Conversions
Advanced Int->Bigint ConversionsAdvanced Int->Bigint Conversions
Advanced Int->Bigint ConversionsRobert Treat
 
Explaining Explain
Explaining ExplainExplaining Explain
Explaining ExplainRobert Treat
 
the-lost-art-of-plpgsql
the-lost-art-of-plpgsqlthe-lost-art-of-plpgsql
the-lost-art-of-plpgsqlRobert Treat
 
Managing Chaos In Production: Testing vs Monitoring
Managing Chaos In Production: Testing vs MonitoringManaging Chaos In Production: Testing vs Monitoring
Managing Chaos In Production: Testing vs MonitoringRobert Treat
 
Past, Present, and Pachyderm - All Things Open - 2013
Past, Present, and Pachyderm - All Things Open - 2013Past, Present, and Pachyderm - All Things Open - 2013
Past, Present, and Pachyderm - All Things Open - 2013Robert Treat
 
Big Bad "Upgraded" Postgres
Big Bad "Upgraded" PostgresBig Bad "Upgraded" Postgres
Big Bad "Upgraded" PostgresRobert Treat
 
The Essential PostgreSQL.conf
The Essential PostgreSQL.confThe Essential PostgreSQL.conf
The Essential PostgreSQL.confRobert Treat
 
Advanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITRAdvanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITRRobert Treat
 
Intro to Postgres 9 Tutorial
Intro to Postgres 9 TutorialIntro to Postgres 9 Tutorial
Intro to Postgres 9 TutorialRobert Treat
 
Database Scalability Patterns
Database Scalability PatternsDatabase Scalability Patterns
Database Scalability PatternsRobert Treat
 
A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0Robert Treat
 
Scaling With Postgres
Scaling With PostgresScaling With Postgres
Scaling With PostgresRobert Treat
 
Intro to Postgres 8.4 Tutorial
Intro to Postgres 8.4 TutorialIntro to Postgres 8.4 Tutorial
Intro to Postgres 8.4 TutorialRobert Treat
 
Intro to pl/PHP Oscon2007
Intro to pl/PHP Oscon2007Intro to pl/PHP Oscon2007
Intro to pl/PHP Oscon2007Robert Treat
 
The Essential postgresql.conf
The Essential postgresql.confThe Essential postgresql.conf
The Essential postgresql.confRobert Treat
 
PostgreSQL Partitioning, PGCon 2007
PostgreSQL Partitioning, PGCon 2007PostgreSQL Partitioning, PGCon 2007
PostgreSQL Partitioning, PGCon 2007Robert Treat
 
Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008Robert Treat
 
Database Anti Patterns
Database Anti PatternsDatabase Anti Patterns
Database Anti PatternsRobert Treat
 

Plus de Robert Treat (20)

Advanced Int->Bigint Conversions
Advanced Int->Bigint ConversionsAdvanced Int->Bigint Conversions
Advanced Int->Bigint Conversions
 
Explaining Explain
Explaining ExplainExplaining Explain
Explaining Explain
 
the-lost-art-of-plpgsql
the-lost-art-of-plpgsqlthe-lost-art-of-plpgsql
the-lost-art-of-plpgsql
 
Managing Chaos In Production: Testing vs Monitoring
Managing Chaos In Production: Testing vs MonitoringManaging Chaos In Production: Testing vs Monitoring
Managing Chaos In Production: Testing vs Monitoring
 
Past, Present, and Pachyderm - All Things Open - 2013
Past, Present, and Pachyderm - All Things Open - 2013Past, Present, and Pachyderm - All Things Open - 2013
Past, Present, and Pachyderm - All Things Open - 2013
 
Big Bad "Upgraded" Postgres
Big Bad "Upgraded" PostgresBig Bad "Upgraded" Postgres
Big Bad "Upgraded" Postgres
 
The Essential PostgreSQL.conf
The Essential PostgreSQL.confThe Essential PostgreSQL.conf
The Essential PostgreSQL.conf
 
Pro Postgres 9
Pro Postgres 9Pro Postgres 9
Pro Postgres 9
 
Advanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITRAdvanced WAL File Management With OmniPITR
Advanced WAL File Management With OmniPITR
 
Intro to Postgres 9 Tutorial
Intro to Postgres 9 TutorialIntro to Postgres 9 Tutorial
Intro to Postgres 9 Tutorial
 
Check Please!
Check Please!Check Please!
Check Please!
 
Database Scalability Patterns
Database Scalability PatternsDatabase Scalability Patterns
Database Scalability Patterns
 
A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0A Guide To PostgreSQL 9.0
A Guide To PostgreSQL 9.0
 
Scaling With Postgres
Scaling With PostgresScaling With Postgres
Scaling With Postgres
 
Intro to Postgres 8.4 Tutorial
Intro to Postgres 8.4 TutorialIntro to Postgres 8.4 Tutorial
Intro to Postgres 8.4 Tutorial
 
Intro to pl/PHP Oscon2007
Intro to pl/PHP Oscon2007Intro to pl/PHP Oscon2007
Intro to pl/PHP Oscon2007
 
The Essential postgresql.conf
The Essential postgresql.confThe Essential postgresql.conf
The Essential postgresql.conf
 
PostgreSQL Partitioning, PGCon 2007
PostgreSQL Partitioning, PGCon 2007PostgreSQL Partitioning, PGCon 2007
PostgreSQL Partitioning, PGCon 2007
 
Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008Pro PostgreSQL, OSCon 2008
Pro PostgreSQL, OSCon 2008
 
Database Anti Patterns
Database Anti PatternsDatabase Anti Patterns
Database Anti Patterns
 

Dernier

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 

Dernier (20)

Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 

Scaling with Postgres (Highload++ 2010)

  • 1. Highload++ 2010 Scaling with Postgres Robert Treat Monday, October 25, 2010
  • 2. Who Am I? ✤ Robert Treat ✤ OmniTI ✤ Design, Development, Database, Ops Monday, October 25, 2010
  • 3. Who Am I? ✤ Robert Treat ✤ OmniTI ✤ Design, Development, DATABASE, Ops Monday, October 25, 2010
  • 4. Who Am I? ✤ Robert Treat ✤ OmniTI ✤ Design, Development, DATABASE, Ops ✤ Etsy, Allisports, National Geographic, Gilt, etc... Monday, October 25, 2010
  • 5. Who Am I? ✤ Robert Treat ✤ Postgres ✤ Web, Advocacy, phpPgAdmin ✤ Major Contributor Monday, October 25, 2010
  • 6. Who Am I? ✤ Postgres 6.5 -> 9.1alpha1 ✤ Terabytes of data ✤ Millions of transactions per day ✤ OLTP, ODS, DW ✤ Perl, PHP, Java, Ruby, C# Monday, October 25, 2010
  • 7. Who Am I? OBSERVATION == LEARNING (hopefully) Monday, October 25, 2010
  • 8. Scalability It is the ability of a computer application or product (hardware or software) to continue to function well when it (or its context) is changed in size or volume in order to meet a user need. Monday, October 25, 2010
  • 9. Scalability Given ever increasing load Monday, October 25, 2010
  • 10. Scalability NEVER GO DOWN ALWAYS PERFORM WELL Given ever increasing load Monday, October 25, 2010
  • 11. Scalability NEVER GO DOWN ALWAYS PERFORM WELL Given ever increasing load impossible goal, but we’ll try Monday, October 25, 2010
  • 12. Scalability NEVER GO DOWN ALWAYS PERFORM WELL Given ever increasing load NOTE! data loss is not a goal, but ideally we won’t lose it :-) Monday, October 25, 2010
  • 13. It starts with culture... Monday, October 25, 2010
  • 14. ✤ Get over schema purity ✤ add column default not null Monday, October 25, 2010
  • 15. ✤ Get over schema purity ✤ add column default not null Good performance comes from good schema design, HOWEVER, perfect relational modeling is NOT THE GOAL Monday, October 25, 2010
  • 16. ✤ Devs must own schema and queries ✤ they design, you refine Monday, October 25, 2010
  • 17. ✤ Devs must own schema and queries ✤ they design, you refine Performance and scalability cannot be managed solely within the database; both require application level knowledge. To achieve this, application developers need to have visibility of the resources they work on Monday, October 25, 2010
  • 19. GainVisibility ✤ Monitoring ✤ Alerts ✤ Trending ✤ Capacity Planning ✤ Performance Tuning Monday, October 25, 2010
  • 20. GainVisibility ✤ Alerts ✤ server: out of disk space, high load, etc... ✤ database: connections, sequences, etc... ✤ business: registrations, revenue, etc... ✤ etc... check_postgres.pl Monday, October 25, 2010
  • 21. GainVisibility ✤ Trending ✤ server: disk usage, load, etc... ✤ database: connections, sequences, etc... ✤ business: registrations, revenue, etc... ✤ etc... cacti, mrtg, circonus Monday, October 25, 2010
  • 22. GainVisibility ✤ Capacity Planning ✤ disks, cpu, memory ✤ connections, vacuum, bloat simple projections, done regularly, are good enough Monday, October 25, 2010
  • 23. GainVisibility ✤ Performance tuning ✤ how long do queries take? ✤ how often do they run? pgfouine Monday, October 25, 2010
  • 25. GainVisibility ALL alerts, graphs, query reports, etc... MUST be available to EVERYONE on the team AT ALL TIMES Monday, October 25, 2010
  • 26. Hands on You can’t succeed without first putting the right culture in place. Once you are on the right path, make sure you have the right technology Monday, October 25, 2010
  • 27. PostgresVersions ✤ MINIMUM: 8.3 ✤ removes xid for read only queries, significant reduction in vacuum activity Monday, October 25, 2010
  • 28. PostgresVersions ✤ MINIMUM: 8.3 ✤ removes xid for read only queries, significant reduction in vacuum activity seriously! Monday, October 25, 2010
  • 29. PostgresVersions ✤ MINIMUM: 8.3 ✤ removes xid for read only queries, significant reduction in vacuum activity ✤ BETTER: 8.4 ✤ revised free space map management leads to more efficient vacuuming Monday, October 25, 2010
  • 30. PostgresVersions ✤ MINIMUM: 8.3 ✤ removes xid for read only queries, significant reduction in vacuum activity ✤ BETTER: 8.4 ✤ revised free space map management leads to more efficient vacuuming ✤ WHY NOT? 9.0 ✤ Hot standby / streaming replication couldn’t hurt Monday, October 25, 2010
  • 31. Speaking of replication ✤ Common practice for scaling websites ✤ Good for READ based loads ✤ We have used many: ✤ slony, rubyrep, bucardo, 9.0 built-in, mammoth, wrote-our-own Monday, October 25, 2010
  • 33. Speaking of replication ✤ No favorite system for this, evaluate based on: ✤ avoid solutions that duplicate writes at sql level (imho) ✤ how comfortable am I debugging the system? ✤ do you need automated schema changes? ✤ how much redundancy / complexity do you need? ✤ how does the system handle node failure for N nodes? Monday, October 25, 2010
  • 34. So what would you use? (tm) ✤ 2 Nodes, master + standby: Postgres 9.0 ✤ Master + multiple slaves: Slony ✤ Master-Master: Bucardo All choices subject to change!! Monday, October 25, 2010
  • 35. A word about “Sharding” ✤ Distributed computing is hard(er) ✤ we think of things in a singular global state ✤ the more we can work in that model, the better ✤ RDBM offer poor solutions for multiple masters ✤ you must manage that complexity on your own Monday, October 25, 2010
  • 36. A word about “Sharding” ✤ Splitting systems by service: ✤ separate db for login, forums, sales, etc... ✤ allows for growth ✤ provides simple interface Monday, October 25, 2010
  • 37. Pooling ✤ Postgres connections are expensive! ✤ fork new process per connection ✤ keep 1 process open per connection ✤ 1000+ processes you will notice trouble Monday, October 25, 2010
  • 38. Pooling ✤ Postgres connections are expensive! ✤ fork new process per connection ✤ keep 1 process open per connection ✤ 1000+ processes you will notice trouble ✤ POOLING ✤ JDBC, mod-perl ✤ pgbouncer ftw! Monday, October 25, 2010
  • 39. Summary ✤ Schema / Queries should be shared between dev, dba teams! ✤ Monitoring + Visibility! ✤ >= 8.3 Required! ✤ Replication, jump in it! ✤ Use connection pooling! Monday, October 25, 2010