Note that there are some explanatory texts on larger screens.

plurals
  1. POPhone books and databases : what's the best option?
    primarykey
    data
    text
    <p>I am currently working on a development project for which I need to make a database (I will be using Postgre).<br> Part of that database must store a phonebook for every company, and also for every user. Those two "types" of phonebook are stored in two tables, although they contain the same type of information :</p> <pre><code>PersonalPhoneBook(IdOwner, IdUser) //Ids of the owner and a user he's in contact with. CompanyPhoneBook(IdCompany, IdUser) //Ids of the company and a user it's in contact with </code></pre> <p>The personal phonebook will be retrieved with a request like:</p> <pre><code>SELECT * F ROM User WHERE IdUser IN (SELECT IdUser FROM PersonalPhoneBook WHERE IdOwner = x); </code></pre> <p>(this request isn't optimized, but you get the gist).</p> <p>I should also mention that every user and company has as many details (phone numbers, addresses, ...) as they want, thanks to these three tables :</p> <pre><code>ContactDetail(IdContactDetail, LbContactDetail, ValueContactDetail) Company_ContactDetail(IdCompany, IdContactDetail) User_ContactDetail(IdUser, IdContactDetail) </code></pre> <p>Now there is something that I didn't take in count in that model : the users and companies will want to include in their phone books some people that aren't users in the database.</p> <p>So I've been exploring several solutions, and I'd need advice to determine which is best:</p> <ul> <li><p>Making two other tables to store a fixed number of details (2 phone numbers, 1 address) on those "outsiders".</p></li> <li><p>Making all "outsiders" users (but I find that pretty ugly to store them together)</p></li> <li><p>Store an independent phonebook (LDAP-type) for every company and every user (but then data is replicated)</p></li> <li><p>Keep the contact detail system for companies and users and use a LDAP system for the others</p></li> <li><p>Other...?</p></li> </ul>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload