Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

docs: Replication protocol #41

Merged

Conversation

Gordiychuk
Copy link
Contributor

PR contains sample of use replication protocol implemented in PR
pgjdbc/pgjdbc#550

PR contains sample of use replication protocol implemented in PR
pgjdbc/pgjdbc#550
@Gordiychuk
Copy link
Contributor Author

@davecramer @vlsi I not ensure, which category to choose for this kind of docs, also please check my english, i am not native speaker and docs can have mistakes.

@davecramer
Copy link
Member

I'll fix them. Thanks!

@Gordyichuck, hopefully I haven't changed the essence ?
Copy link
Contributor Author

@Gordiychuk Gordiychuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davecramer thanks for you fixes.

If slightly different data gets written to two different datastores (perhaps due to a bug or a race condition),
the contents of the datastores will gradually drift apart — they will become more and more inconsistent over time.
Recovering from such gradual data corruption is difficult.
Before Logical replication keeping an external system synchronized in real time was problematic. The application would have to update/invalidate the appropriate cache entries, reindex the data in your search engine, send it to your analytics system, and so on.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to say that without logical replication, application can use dual writes patterns - in that case application first write to database, then writes for example to cache syste, then to search engine etc and this pattern have many problems, because not all system supports transaction and for example after successfull writes to postgresql you can get error from elasticsearch that not support transactions, or successfully writes to elasticsearch but by some reason fail during writes to postgresql. In this case very difficult support consistence state in all system.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I simplified it a bit, I think anyone wanting to use this will already know the issues

stream changes from database in real-time to external system.
Postgres 9.4 (released in December 2014) introduced a new feature called logical replication. Logical replication allows
changes from database to be streamed in real-time to external system. The difference between streaming replication and
logical replication is that logical replication sends data over in a logical format whereas streaming replication sends data over in a binary format. Additionally logical replication can send over a single table, or database. Streaming replication was all or nothing.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The difference between streaming replication and
+logical replication is that logical replication sends data over in a logical format whereas streaming replication sends data over in a binary format.

I thinks streaming replication term applies to both physical replication and logical replication.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it does, and it's somewhat implied. I can make it explicit if you insist

@@ -0,0 +1,352 @@
---
todo
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know which category to choose. It can be sub-category of "Chapter 9. PostgreSQL™ Extensions to the JDBC API" or a separate section "Chapter 12. API for consume physical and logical replication."

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extensions

@Gordiychuk
Copy link
Contributor Author

Is it available render md files to html locally and check how this docs looks like?

@davecramer
Copy link
Member

click on files changed, select the file and there is a view button on the top right

@Gordiychuk
Copy link
Contributor Author

click on files changed, select the file and there is a view button on the top right

Hm, IDEA offers me to do this only for html files

@davecramer
Copy link
Member

I meant on github. Sorry for the lack of precision

Dave Cramer

On 14 November 2016 at 15:16, Vladimir Gordiychuk notifications@github.com
wrote:

click on files changed, select the file and there is a view button on the
top right

Hm, IDEA offers me to do this only for html files


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#41 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAYz9hOLqAm_7tStz11zYgKkg_HEB225ks5q-MGYgaJpZM4Kws2I
.

@vlsi
Copy link
Member

vlsi commented Nov 14, 2016

Is it available render md files to html locally and check how this docs looks like?

There are two options:

  1. Open settings page for your fork of the repository, and enable GitHub pages for the master branch (or whatever you like).
    That would make the site available on-line: http://vlsi.github.io/www/

  2. Install jekyll (see https://jekyllrb.com/) and use bundle exec jekyll serve to start a local server.
    The good thing with jekyll is it picks changes automatically, so you can edit, save, and refresh the browser.

@Gordiychuk
Copy link
Contributor Author

jekyll helped me, thanks.

I move replication page under extensions, and fix display code. Now I thinks this PR ready.

@Gordiychuk
Copy link
Contributor Author

@davecramer can you merge this PR? I complete all changes that I want in this PR, also pgjdbc/pgjdbc#550 was already merged.

@davecramer davecramer merged commit 1828c43 into pgjdbc:master Feb 3, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants