-
Notifications
You must be signed in to change notification settings - Fork 13
docs: Replication protocol #41
docs: Replication protocol #41
Conversation
PR contains sample of use replication protocol implemented in PR pgjdbc/pgjdbc#550
@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. |
I'll fix them. Thanks! |
@Gordyichuck, hopefully I haven't changed the essence ?
There was a problem hiding this 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extensions
Is it available render md files to html locally and check how this docs looks like? |
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 |
I meant on github. Sorry for the lack of precision Dave Cramer On 14 November 2016 at 15:16, Vladimir Gordiychuk notifications@github.com
|
There are two options:
|
I move replication page under extensions, and fix display code. Now I thinks this PR ready. |
@davecramer can you merge this PR? I complete all changes that I want in this PR, also pgjdbc/pgjdbc#550 was already merged. |
PR contains sample of use replication protocol implemented in PR
pgjdbc/pgjdbc#550