managing replication of postgresql, simon riggs

16
© 2ndQuadrant Limited 2010 Managing PostgreSQL Replication

Upload: fuenteovejuna

Post on 10-May-2015

1.090 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

ManagingPostgreSQLReplication

Page 2: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Who Am I?

• Simon Riggs

• Major Developer on PostgreSQL project

• CTO, 2ndQuadrant

Page 3: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Replication Use Cases

• High Availability

• Scalability

• Protection

• Total Cost of Ownership

• Exploiting success

Page 4: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Replication Mechanisms

• Trigger-based replication– User space solution

• Log-based replication– Integrated development

Page 5: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Log Shipping Developments

• 8.0 – Point in Time Recovery, Full WAL info

• 8.2 – Restartable Recovery, Log Switching, Streaming API

• 8.3 – Full Page Optimization, pg_standby

• 8.4 – BgWriter during Recovery

• 9.0 – Streaming Replication Hot Standby

Page 6: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Streaming Replication (9.0)

• Efficient real-time “log shipping”

• Master → Slave replication using full security

• Multiple concurrent slaves

• Robust bi-modal design

Page 7: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

WAL Sender

Page 8: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

WAL Receiver

Page 9: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Hot Standby

• Read-only access while “in recovery”

• Equivalent of Oracle 11g Active Data Guard

• Load balanced read scalability

• Query off-load from main write node

• Multiple highly available standby nodes

Page 10: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Capabilities

• High Performance

• Integrated

• Ease of Use

• Query Access

• Relay

• Selectivity

• Query Farm

Page 11: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Capabilities with Tools

• High Performance

• Integrated

• Ease of Use

• Query Access

• Relay

• Selectivity

• Query Farm

Page 12: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Repmgr

Page 13: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Repmgr

• Simplify standby management

• Monitor replication delays

• Provide feedback mechanisms

Page 14: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Future: Sync Replication (9.1)

• User-controlled robustness

• High performance design

• Simplicity

• Additional flexibility through registration

Page 15: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

Future: Loose Coupling

• Allows distributed database

• High Availability and Disaster Recovery

• No shared resources – better scalability

• “Cellular” approach

Page 16: Managing replication of PostgreSQL, Simon Riggs

© 2ndQuadrant Limited 2010

PostgreSQL Books

• http://www.2ndQuadrant.com/books/