Use Case
The Options
For each customer store all pages in one _design document and serve the appropriate pages based on user type (permission)
For each customer store each page into it's own _design document
For each customer, store all pages associated with the user permission level in one _design document so that each user type will be served from a different _design document
Also, I've read two books now on couchDB and it's still not clear the advantages of using a _design document as opposed to a normal document to serve the web pages.
UPDATE 1:
I think I will need to give a clearer example.
Company A has a head office in Bangkok with management and administrative (secretaries) staff using the app. These users will belong to different user groups and have different permissions which will provide them access to different HMTL documents (or the same template doc but serving different content via js). This company has offices in Pattaya, Phuket and Chang Mai. At each of these offices they have different user types who will have access to different parts of the app and see different versions of HTML screens. The local apps will be based on filtered replication.
This couchDB will provide this service to multiple companies structured just like Company A, all from the same db (reason being that we need to be able to aggregate data for all companies and couchDB cannot aggregate across multiple databases since views are db specific if I read correctly.) However, each master Company could have slight differences to their HTML pages from other master Companies.
So focusing on structure only, my initial idea is to do multiple _design documents, one for each master Company. In each of these _design documents we store each and every HTML page for that company (which may or may not be the same as other master companies.
Is there a better way to structure this? Do you see scaling issues when we have say 1000 master companies?
P.S. Even if we can't complete solve ACL issues directly via couchDB we can always do it ourselves so this isn't a primary concern right now.
UPDATE 2:
So after more research I see how the show functions (shows) play a role in this by using templates. It doesn't fully answer my question, so I guess, based on this, I am also wondering now if there is ever a situation where you might want to have any other HTML attachement in the _design document other than index.html?
There are two basic solutions for the situation of multiple users, each can see only a subset of the total data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With