각 소스 PostgreSQL 데이터베이스는 논리적 디코딩 기능을 사용합니다. PostgreSQL에서 논리적 디코딩은 미리 쓰기 로그(WAL) 파일의 콘텐츠를 디코딩하여 구현됩니다. WAL 파일에는 데이터베이스의 활동 기록 정보가 포함되어 있으며 Datastream은 이러한 파일을 활용하여 데이터 변경사항을 쿼리합니다. Datastream에서 WAL 파일을 사용하는 방법에 대한 자세한 내용은 PostgreSQL 데이터베이스 WAL 파일 작업을 참조하세요.
게시 및 복제 슬롯
PostgreSQL 소스를 구성할 때는 게시와 복제 슬롯을 만들어야 합니다.
게시는 논리적 복제를 사용하여 복제하려는 테이블 또는 테이블 그룹에서 생성된 변경사항의 집합입니다.
복제 슬롯은 WAL 로그 파일에 저장된 변경사항 스트림이 올바른 순서로 대상에 복제되도록 하는 PostgreSQL 기능입니다.
각 복제 슬롯은 단일 데이터베이스의 변경사항 시퀀스를 스트리밍하고 각 게시는 하나의 데이터베이스에만 존재합니다. 즉, 데이터베이스당 하나 이상의 스트림을 만들고 스트림당 하나의 복제 슬롯을 만들어야 합니다. 또한 명확성을 위해 스트림에서 선택한 테이블과 게시물 이름을 일치시키는 것이 좋습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eDatastream leverages PostgreSQL's logical decoding feature, which decodes the Write Ahead Log (WAL) files to query data changes.\u003c/p\u003e\n"],["\u003cp\u003eConfiguring a PostgreSQL source for Datastream requires creating a publication, which is a set of changes from tables to be replicated.\u003c/p\u003e\n"],["\u003cp\u003eA replication slot, a PostgreSQL feature, is also needed to ensure that the stream of changes from a WAL log file is replicated to the destination in the correct order.\u003c/p\u003e\n"],["\u003cp\u003eDatastream supports various PostgreSQL databases, including AlloyDB for PostgreSQL, Amazon Aurora PostgreSQL, Cloud SQL for PostgreSQL, and self-managed PostgreSQL.\u003c/p\u003e\n"],["\u003cp\u003eEach replication slot streams a sequence of changes from a single database, and each publication exists in only one database.\u003c/p\u003e\n"]]],[],null,["# Configure a source PostgreSQL database\n\nEach source PostgreSQL database relies upon its [logical decoding](https://www.postgresql.org/docs/current/logicaldecoding-explanation.html) feature. In PostgreSQL, logical decoding is implemented by decoding the contents of the Write Ahead Log (WAL) files. The WAL files contain information about the history of activity on a database, and Datastream leverages these files to query data changes. For more information about how Datastream works with WAL files, see [Work with PostgreSQL database WAL files](/datastream/docs/work-with-postgresql-database-wal-log-files).\n\nPublication and replication slots\n---------------------------------\n\nWhen you configure your PostgreSQL source, you need to create a publication and a\nreplication slot.\n\nA publication is a set of changes generated from a table, or a group of tables,\nthat you want to replicate using logical replication.\n\nA replication slot is a PostgreSQL feature which ensures that a stream of changes\nstored in a WAL log file is replicated to the destination in the correct order.\n\nEach replication slot streams a sequence of changes from a single database, and each publication exists in only one database. This means that you need to create one or more streams per database, with one replication slot per stream. It's also a good practice to keep the publication name aligned with the tables selected in the stream for clarity.\n\nFor more information, see [Publication](https://www.postgresql.org/docs/current/logical-replication-publication.html#LOGICAL-REPLICATION-PUBLICATION)\nand [Replication slots](https://www.postgresql.org/docs/current/logicaldecoding-explanation.html#LOGICALDECODING-REPLICATION-SLOTS)\nin PostgreSQL documentation.\n\nSupported databases\n-------------------\n\nDatastream works with the following types of PostgreSQL databases:\n\n- AlloyDB for PostgreSQL\n- AlloyDB Omni\n- Amazon Aurora PostgreSQL\n- Amazon RDS for PostgreSQL\n- Cloud SQL for PostgreSQL\n- Self-managed PostgreSQL (on-premise or cloud-hosted)\n\nWhat's next\n-----------\n\n- Learn how to configure an [AlloyDB for PostgreSQL](/datastream/docs/configure-alloydb-psql) database to work with Datastream.\n- Learn how to configure [AlloyDB Omni](/datastream/docs/configure-self-managed-psql) to work with Datastream.\n- Learn how to configure an [Amazon Aurora PostgreSQL](/datastream/docs/configure-amazon-aurora-psql) database to work with Datastream.\n- Learn how to configure an [Amazon RDS for PostgreSQL](/datastream/docs/configure-amazon-rds-psql) database to work with Datastream.\n- Learn how to configure a [Cloud SQL for PostgreSQL](/datastream/docs/configure-cloudsql-psql) database to work with Datastream.\n- Learn how to configure a [self-managed PostgreSQL](/datastream/docs/configure-self-managed-psql) database to work with Datastream."]]