Re: Append only replication over intermittent links (with local only delete?)

From: Vick Khera <vivek(at)khera(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Append only replication over intermittent links (with local only delete?)
Date: 2018-06-15 13:46:33
Message-ID: CALd+dccpRrwtU75b+VhT+XMsh8NsEAJeCJXa_RkM-Gbapq5Jrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jun 14, 2018 at 8:04 AM, Uri Braun <uri(at)braunnet(dot)com> wrote:

> To be clear, the car device will surely add data -- append rows -- and may
> very occasionally add a new table. I would expect the only case where a
> delete may occur -- other than culling old data -- is during recovery of a
> partial write or transaction rollbacks. The time requirements are loose,
> but I would like replication consistency within hours (once connected).
>
> I'm wondering what replication scheme is appropriate for this use case and
> how to configure it appropriately.
>
>
I would recommend a trigger based approach where every table has an INSERT
trigger on it that adds the new data to a log table to store the data that
needs to be pushed up to the central server. When the system detects a
network connection, it sends the data and deletes them from the log table
in a transaction (begin, select, send, delete, get ack, commit).

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Amit Kapila 2018-06-15 14:36:41 Re: question on streaming replication
Previous Message Steven Lembark 2018-06-15 13:20:25 Re: PostgreSQL Volume Question