Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Am trying to design a nicely normalized schema for sharing entities in a database, with good referential integrity.

It should work similarly to Google Docs sharing.

Here is what I have so far:

enter image description here

Where a roleType is in {owner=1, viewer=2, commenter=3, editor=4}

A public permission allows for a document to be shared anonymously. An alternative would be to have a "magic" anonymous email address, but I am not so sure about that one.

A document can have one or zero publicPermissions or many explicitPermissions.

What other designs are out there, or what improvements can I make?

share|improve this question
What is publicPermission.isListed? Depending on what other attributes a publicPermission might have, I'm thinking that you could simplify the design by dropping publicPermission and making explicitPermission.emailAddressId nullable. –  Joel Brown Aug 6 '12 at 12:55
if isListed is false then you can view it if you have the url, but it doesn't show up on a list of docs anywhere. thx –  Neil McGuigan Aug 6 '12 at 18:50
If you wanted to get rid of the publicPermission table you'd therefore have to find a different home for the .isListed property. It could go on the document table, since .isListed is single-valued per document. If a similar concept actually applied to explicitPermission then you could put .isListed there instead. –  Joel Brown Aug 6 '12 at 22:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.