Database design | Contacts & Clients

Hi all,

So I’m starting the design of a new application that’s part CRM, part project system and I wanted to get some advice with regards to the database design. My application is intended to have “Contacts”, who are people (even though they’ll have companies stored as one of the fields for that data type) and then I’ll have “Clients” that are companies with which we have active contracts. “Clients” will have contacts too, and in fact it is possible that a Client may have more than one contacts associated with them.

I’m trying to decide on the best way to structure the database with regards to the data types or entities.

One part of me is thinking that the best way to structure this is to have two distinct data types as follows:

Contact

  • First name
  • Last name
  • Email
  • Company

Client

  • Company
  • Primary contact First name
  • Primary contact Last name
  • Primary contact email
  • Website
  • Additional Contacts (list of Contacts)

Another part of me is thinking that I should have a single data type and just use a field to toggle between the different types of contacts that I expect to have. So something like:

Contact

  • First name
  • Last name
  • Email
  • Company
  • Type (dropdown: Client, Lead, Funder, Contact)

I can’t think far enough into the pros and cons of each approach and am looking for any advice or guidance on how I should approach this.

Thanks in advance.

@SeanB Hello ! did you find a solution ? how did you go and which solution did you pick ? thanks

Hello

Actually both of your data architectures would work.
But you can think to these bulletpoints to find the right data structure :

  • performance (how you’ll search and find data)
  • security (who can see what and how to set with Bubble’s privacy rules)
  • scalability (how will become your app and which feature may be added)

DevEase