couch-to-postgres icon indicating copy to clipboard operation
couch-to-postgres copied to clipboard

multi master replication

Open gcarranza opened this issue 10 years ago • 5 comments

is it possible use couchdb replicator over the postgres database on couch-to-postgres?

gcarranza avatar Oct 01 '15 23:10 gcarranza

sorry im not clear on your question if you mean can it sync postgres as the source db then no

you can use the postgres http extension to populate a couchdb and then use couch as your datasource with master-master replication and using couch-to-postgres populate separate postgres databases.

This is currently how i am using it eg

Postgres at location 1 | couch-to-postgres 1 | couch at location 1 | | Internet | | Couch at location 2 | couch-to-postgres 2 | Postgres at location 2

With couch 1 & 2 replicating to each other - so if you add a doc to couch 1 it will appear in postgres 2

sysadminmike avatar Oct 01 '15 23:10 sysadminmike

ok, perfect, i have another question i need to know if you know other forms of doing master master replication with postgres and the advantages of using coudchb. i'm asking you because i'm looking for master master replication and your tool looks very interesting

gcarranza avatar Oct 02 '15 15:10 gcarranza

Im not sure there is a simple method to do multi-master replication with postgres - this is the reason we chose couchdb as our datasource - we were using solr then elasticsearch for searching/querying the data when couch map/reduce was not enough.

however elasticsearch uses a LOT of memory (and needs more as the index grows) but with postgres we have gone down from 4gb vm for elasticsearch to a 2gb vm for postgres and no problems with memory issues.

Take a peek at: http://blog.2ndquadrant.com/jsonb-type-performance-postgresql-9-4/ for jsonb indexing stuff and postgres

sysadminmike avatar Oct 02 '15 15:10 sysadminmike

Thanks for you reply, i have another question for that im open a new issue about instalation

gcarranza avatar Oct 04 '15 04:10 gcarranza

sure ask away - btw i have released an npm: https://www.npmjs.com/package/couch-to-postgres so should make life simpler to install with:

npm i couch-to-postgres

sysadminmike avatar Oct 04 '15 11:10 sysadminmike