mkabilov / logical_backup

[WIP] Continuous backup of the tables using PostgreSQL logical replication
MIT License
9 stars 3 forks source link

Use memory buffer to write current deltas before flushing them #11

Closed alexeyklyukin closed 6 years ago

alexeyklyukin commented 6 years ago

Right now we write each delta to a delta file right away. What we could do to improve the performance is to write those deltas to the memory buffer first, flushing them when we fill the file.

As a related note, we could also send the flush response back to the server once we write all deltas to the file, fsync and close it. By not doing fsync we risk losing some records on crash, since the server usually disposes of them after receiving the flush.

mkabilov commented 6 years ago

two points here:

alexeyklyukin commented 6 years ago

Fixed at https://github.com/ikitiki/logical_backup/pull/16