gooderp18绿色标准版
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

55 líneas
6.5KB

  1. <?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 30. Logical Replication</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets V1.79.1" /><link rel="prev" href="wal-internals.html" title="29.5. WAL Internals" /><link rel="next" href="logical-replication-publication.html" title="30.1. Publication" /></head><body><div xmlns="http://www.w3.org/TR/xhtml1/transitional" class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">Chapter 30. Logical Replication</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="wal-internals.html" title="29.5. WAL Internals">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="admin.html" title="Part III. Server Administration">Up</a></td><th width="60%" align="center">Part III. Server Administration</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 12.4 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="logical-replication-publication.html" title="30.1. Publication">Next</a></td></tr></table><hr></hr></div><div class="chapter" id="LOGICAL-REPLICATION"><div class="titlepage"><div><div><h2 class="title">Chapter 30. Logical Replication</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl class="toc"><dt><span class="sect1"><a href="logical-replication-publication.html">30.1. Publication</a></span></dt><dt><span class="sect1"><a href="logical-replication-subscription.html">30.2. Subscription</a></span></dt><dd><dl><dt><span class="sect2"><a href="logical-replication-subscription.html#LOGICAL-REPLICATION-SUBSCRIPTION-SLOT">30.2.1. Replication Slot Management</a></span></dt></dl></dd><dt><span class="sect1"><a href="logical-replication-conflicts.html">30.3. Conflicts</a></span></dt><dt><span class="sect1"><a href="logical-replication-restrictions.html">30.4. Restrictions</a></span></dt><dt><span class="sect1"><a href="logical-replication-architecture.html">30.5. Architecture</a></span></dt><dd><dl><dt><span class="sect2"><a href="logical-replication-architecture.html#LOGICAL-REPLICATION-SNAPSHOT">30.5.1. Initial Snapshot</a></span></dt></dl></dd><dt><span class="sect1"><a href="logical-replication-monitoring.html">30.6. Monitoring</a></span></dt><dt><span class="sect1"><a href="logical-replication-security.html">30.7. Security</a></span></dt><dt><span class="sect1"><a href="logical-replication-config.html">30.8. Configuration Settings</a></span></dt><dt><span class="sect1"><a href="logical-replication-quick-setup.html">30.9. Quick Setup</a></span></dt></dl></div><p>
  3. Logical replication is a method of replicating data objects and their
  4. changes, based upon their replication identity (usually a primary key). We
  5. use the term logical in contrast to physical replication, which uses exact
  6. block addresses and byte-by-byte replication. PostgreSQL supports both
  7. mechanisms concurrently, see <a class="xref" href="high-availability.html" title="Chapter 26. High Availability, Load Balancing, and Replication">Chapter 26</a>. Logical
  8. replication allows fine-grained control over both data replication and
  9. security.
  10. </p><p>
  11. Logical replication uses a <em class="firstterm">publish</em>
  12. and <em class="firstterm">subscribe</em> model with one or
  13. more <em class="firstterm">subscribers</em> subscribing to one or more
  14. <em class="firstterm">publications</em> on a <em class="firstterm">publisher</em>
  15. node. Subscribers pull data from the publications they subscribe to and may
  16. subsequently re-publish data to allow cascading replication or more complex
  17. configurations.
  18. </p><p>
  19. Logical replication of a table typically starts with taking a snapshot
  20. of the data on the publisher database and copying that to the subscriber.
  21. Once that is done, the changes on the publisher are sent to the subscriber
  22. as they occur in real-time. The subscriber applies the data in the same
  23. order as the publisher so that transactional consistency is guaranteed for
  24. publications within a single subscription. This method of data replication
  25. is sometimes referred to as transactional replication.
  26. </p><p>
  27. The typical use-cases for logical replication are:
  28. </p><div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "><li class="listitem"><p>
  29. Sending incremental changes in a single database or a subset of a
  30. database to subscribers as they occur.
  31. </p></li><li class="listitem"><p>
  32. Firing triggers for individual changes as they arrive on the
  33. subscriber.
  34. </p></li><li class="listitem"><p>
  35. Consolidating multiple databases into a single one (for example for
  36. analytical purposes).
  37. </p></li><li class="listitem"><p>
  38. Replicating between different major versions of PostgreSQL.
  39. </p></li><li class="listitem"><p>
  40. Replicating between PostgreSQL instances on different platforms (for
  41. example Linux to Windows)
  42. </p></li><li class="listitem"><p>
  43. Giving access to replicated data to different groups of users.
  44. </p></li><li class="listitem"><p>
  45. Sharing a subset of the database between multiple databases.
  46. </p></li></ul></div><p>
  47. </p><p>
  48. The subscriber database behaves in the same way as any other PostgreSQL
  49. instance and can be used as a publisher for other databases by defining its
  50. own publications. When the subscriber is treated as read-only by
  51. application, there will be no conflicts from a single subscription. On the
  52. other hand, if there are other writes done either by an application or by other
  53. subscribers to the same set of tables, conflicts can arise.
  54. </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="wal-internals.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="admin.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="logical-replication-publication.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">29.5. WAL Internals </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> 30.1. Publication</td></tr></table></div></body></html>
上海开阖软件有限公司 沪ICP备12045867号-1