Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3759254
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:17:17+00:00 2026-05-19T10:17:17+00:00

CouchDB has a mechanism in place to prevent unauthorized writes. Can it also prevent

  • 0

CouchDB has a mechanism in place to prevent unauthorized writes.

Can it also prevent unauthorized reads?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T10:17:18+00:00Added an answer on May 19, 2026 at 10:17 am

    Yes, CouchDB can prevent unauthorized reads. Unfortunately, it is slightly less straightforward.

    Imagine a secret auction application. You bid $20 and I bid $10; each bid in a couch document. Couch lets us read our own bid documents but no others. However, there is a map-reduce view showing the average. I load the view and see that the average is $15, so I conclude that your bid is $20 and I have broken the security policy. View output can leak some or all of a document’s information. It is not feasible to enforce security at the document level. That is why read access is at the database level.

    I know, it sucks. But that is the only correct, scalable answer.

    This is part of the reason the Couch philosophy is to create many databases—even one (or more!) per user. Read permission to a database is set in the readers value of the database _security object. (Note, the field readers was renamed to members in CouchDB trunk because it also specifies who may write to the DB.)

    The technique works like this:

    1. Create a database for each user. It will hold all documents the user may read. Add the user (or the user’s role) to the _security object.
    2. In the master database, create a filter function which implements the read policy. (It could share code with validate_doc_update.)
    3. Replicate from the master database to the user’s database with ?filter=my_filter_function.
    4. Allow the user to load (or replicate from) their database.

    Of course, this is all for a pure Couch application, where users access Couch directly. If you have a middle layer (MVC controller, or just a reverse HTTP proxy), then you can enforce policy there, between the user and the couch. But be careful. For example, a _show function or a _rewrite rule might allow a user to load a view or document despite your policy.

    Good luck!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since CouchDB has very few API documentation (at least I can not find it),
Can CouchDB handle thousands of separate databases on the same machine? Imagine you have
How to store a tree in CouchDB? The CouchDB Wiki has a How_to_store_hierarchical_data page
I have a CouchDB database in production. One of the documents has been edited
Can CouchDB's filtered replication be set to replicate not only the most recent version
I'm trying to create a database in couchdb, which has an admin user/password set,
I'm working on some CouchDB apps and it's been lots of fun. I'm also
CouchDB employs a cool pattern that can be used in a multitude of other
Couchbase announced changes to CouchDB distribution: http://blog.couchbase.com/couchbase-2011-year-review CouchBase Single server has GeoCouch integration, is
Though I use CouchDB-specific JQuery verison, the problem can appear to be not related

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.