1

I am using couchdb and each user has their own database.

However, I have a web app that should be able to look up an _id in any database and return the document. With thousands of users, querying across thousands of couchdb instances would be impractical.

How can I replicate my data to a single master database so that I can query by _id?

Jonathan Hall
  • 75,165
  • 16
  • 143
  • 189
Doug
  • 14,387
  • 17
  • 74
  • 104

1 Answers1

2

What I ended up doing is replicating every userdb to a master db when the database was created, using the _replicate API endpoint. The master db then contains a read-only copy of all the other databases.

Doug
  • 14,387
  • 17
  • 74
  • 104
  • UPDATE: I've since discovered https://github.com/cloudant-labs/envoy which lets me use a single database and avoid replication. – Doug May 28 '17 at 19:25