Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to sync CouchDB and PostgreSQL

We have a web application built on RoR, its using postgresql, now we have to integrate mobile application with it, the mobile application have to be able to manage offline mode, so we need to sync information between web app and mobile app.

The question is, if I have the data stored on postgresql and I need to use couchdb and pouchdb for offline syncing, what can I do??

Thanks!!

like image 330
Pablo Solís Avatar asked Sep 26 '16 15:09

Pablo Solís


People also ask

How do you replicate a database in CouchDB?

Simple Replication with the Admin InterfaceStart CouchDB and open your browser to http://127.0.0.1:5984/_utils/ . On the righthand side, you will see a list of things to visit in Futon. Click on “Replication.” Futon will show you an interface to start replication.

How do I connect to a PostgreSQL database in R?

Steps to Connect R & PostgreSQL using RPostgreSQLStep 1: Install the RPostgreSQL Package. Step 2: Enter your PostgreSQL Credentials. Step 3: Establish R & PostgreSQL Connection using RPostgreSQL. Step 4: Run and Test Queries using RPostgreSQL.

How do I connect to another database in PostgreSQL?

Switching between databases is another way of saying you are closing one connection and opening another. When you need to change between databases, you'll use the “connect” command, which is conveniently shortened to \c, followed by the database name.


1 Answers

Can you make sure that you write only on CouchDb and PostgreSQL is only used for reading data? In that case you can use the _changes feed of CouchDb to replicate all the data back to your PostgreSQL database for readonly-access.

like image 151
dmunch Avatar answered Sep 17 '22 12:09

dmunch