Need help in designing a database schema for a SaaS application










2















I am a developer and have never worked on DB before (designing a DB). I am designing a database for an employee management system which is a Node.js + Express application using MySQL as its DB.



I already have the required tables, columns sorted out but there are still few unknowns I am dealing with. This is my plan so far and I need your input on it.



  1. The end users using this application will be small - mid size companies. The companies won't be sharing the tables in the database. So if there is a table named EmployeeCases I plan to create a new EmployeeCases table for each existing company or a new one who signs up for this application. I am planning to name the table as EmployeeCases_989809890 , where "989809890" will be the company id (or customer id). So if we have 3-4 companies who signed up for us, then all the tables (at least the ones which a company uses) will be recreated and named as TableName_CompanyId. My questions, is this a good way to go? Is there a better way?


  2. All the employee's data is held by the Employee table, including their login and password. Now each Employee table in DB will be named as Employee_CompanyId (as per my plan above). My question is, when an employee logs in, how will I know which Employee table to query to? Or should I remove the login from the Employee table and create a universal Users table where all the employees will be stored? The Users table will also have the CompanyId as one of its column and I will read the CompanyId from there which will be used to query other tables.


Any reference, website or blogs on this type of design will be appreciated.



Thanks.










share|improve this question


























    2















    I am a developer and have never worked on DB before (designing a DB). I am designing a database for an employee management system which is a Node.js + Express application using MySQL as its DB.



    I already have the required tables, columns sorted out but there are still few unknowns I am dealing with. This is my plan so far and I need your input on it.



    1. The end users using this application will be small - mid size companies. The companies won't be sharing the tables in the database. So if there is a table named EmployeeCases I plan to create a new EmployeeCases table for each existing company or a new one who signs up for this application. I am planning to name the table as EmployeeCases_989809890 , where "989809890" will be the company id (or customer id). So if we have 3-4 companies who signed up for us, then all the tables (at least the ones which a company uses) will be recreated and named as TableName_CompanyId. My questions, is this a good way to go? Is there a better way?


    2. All the employee's data is held by the Employee table, including their login and password. Now each Employee table in DB will be named as Employee_CompanyId (as per my plan above). My question is, when an employee logs in, how will I know which Employee table to query to? Or should I remove the login from the Employee table and create a universal Users table where all the employees will be stored? The Users table will also have the CompanyId as one of its column and I will read the CompanyId from there which will be used to query other tables.


    Any reference, website or blogs on this type of design will be appreciated.



    Thanks.










    share|improve this question
























      2












      2








      2








      I am a developer and have never worked on DB before (designing a DB). I am designing a database for an employee management system which is a Node.js + Express application using MySQL as its DB.



      I already have the required tables, columns sorted out but there are still few unknowns I am dealing with. This is my plan so far and I need your input on it.



      1. The end users using this application will be small - mid size companies. The companies won't be sharing the tables in the database. So if there is a table named EmployeeCases I plan to create a new EmployeeCases table for each existing company or a new one who signs up for this application. I am planning to name the table as EmployeeCases_989809890 , where "989809890" will be the company id (or customer id). So if we have 3-4 companies who signed up for us, then all the tables (at least the ones which a company uses) will be recreated and named as TableName_CompanyId. My questions, is this a good way to go? Is there a better way?


      2. All the employee's data is held by the Employee table, including their login and password. Now each Employee table in DB will be named as Employee_CompanyId (as per my plan above). My question is, when an employee logs in, how will I know which Employee table to query to? Or should I remove the login from the Employee table and create a universal Users table where all the employees will be stored? The Users table will also have the CompanyId as one of its column and I will read the CompanyId from there which will be used to query other tables.


      Any reference, website or blogs on this type of design will be appreciated.



      Thanks.










      share|improve this question














      I am a developer and have never worked on DB before (designing a DB). I am designing a database for an employee management system which is a Node.js + Express application using MySQL as its DB.



      I already have the required tables, columns sorted out but there are still few unknowns I am dealing with. This is my plan so far and I need your input on it.



      1. The end users using this application will be small - mid size companies. The companies won't be sharing the tables in the database. So if there is a table named EmployeeCases I plan to create a new EmployeeCases table for each existing company or a new one who signs up for this application. I am planning to name the table as EmployeeCases_989809890 , where "989809890" will be the company id (or customer id). So if we have 3-4 companies who signed up for us, then all the tables (at least the ones which a company uses) will be recreated and named as TableName_CompanyId. My questions, is this a good way to go? Is there a better way?


      2. All the employee's data is held by the Employee table, including their login and password. Now each Employee table in DB will be named as Employee_CompanyId (as per my plan above). My question is, when an employee logs in, how will I know which Employee table to query to? Or should I remove the login from the Employee table and create a universal Users table where all the employees will be stored? The Users table will also have the CompanyId as one of its column and I will read the CompanyId from there which will be used to query other tables.


      Any reference, website or blogs on this type of design will be appreciated.



      Thanks.







      mysql sql-server database database-design






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Aug 2 '16 at 3:14









      codeinprogresscodeinprogress

      52621127




      52621127






















          2 Answers
          2






          active

          oldest

          votes


















          2














          I don't recommend this approach, I think you should either:



          A) Put all the information in the same tables and have a companyId column to sort them out



          OR



          B) Have separate databases for each company and use the appropriate database using the code.



          The thing is, with your approach, you'll have a hard time maintaining your application if you have multiple copies of the same table with different names. If you decide to add a column to one of the tables, for instance, you will have to write as many SQL scripts as you have table instances. You'll also have a bad time with all of your unique identifiers.



          Here are some advantages/disadvantages of each design:



          A) Put all the information in the same tables and have a compagnyId column to sort them out



          Advantages:



          • Simplest

          • Allow usage of foreign key / constraints

          • Great for cross / client data extraction

          Disadvantages:



          • Not portable (a client can't just leave with his/her data)

          • Can be perceived as less secure (I guess you can make the case both ways)

          • More likely to have huge tables

          • Does not scale very well

          B) Have separate databases for each company and use the appropriate database using the code.



          Advantages:



          • Portable

          • Can be perceived as more secure

          Disadvantages:



          • Needs more discipline to keep track of all the databases

          • Needs a good segregation of what's part of your HUB (Your application that tracks which client access which database) and that's part of your client's database.

          • You need a login page by company (or have your clients specify the company in a field)

          An example of an application that uses this "two-step login" is Slack, when you sign-in you first enter your team domain THEN your user credentials.



          I think Google Apps for Work as the same approach. Also, I think most CRM I worked with has a separate database for their clients.



          Lastly, I'd like to direct you to this other question on stackoverflow that links to an interesting example.






          share|improve this answer

























          • So I was originally going with plan B. I am planning to host the node.js app on Heroku and assign custom domain based on the company name. Since we can connect a GitHub repository to a Heroku app, I will be creating a new repository for each client.

            – codeinprogress
            Aug 2 '16 at 15:33











          • You'll probably want to look into automating creation of new clients in your system. The more I think about it the more Plan B fits this kind of project.

            – mgadrat
            Aug 2 '16 at 22:06











          • Yeah, me too. The thing is, with plan B the database cost is distributed among my clients + their data is separated from each other using separate tables for each client.

            – codeinprogress
            Aug 14 '16 at 4:16


















          0














          You shouldn't split your tables just because companies won't share their information. Instead, you should have a companyId column in each table and access to the relevant data for each query. This should be implemented in your backend






          share|improve this answer























          • So every time I do a query to get anything from any table, there will be a second condition that says "and CompanyId = whatever "

            – codeinprogress
            Aug 2 '16 at 3:26











          • You will need to know the company anyway if you have splitted tables, right?

            – Mikel
            Aug 2 '16 at 3:29











          • Yes, that is true. So do I keep a universal users table which has the companyId and then an Employees table which has just the employee info? Or do I just merge them together?

            – codeinprogress
            Aug 2 '16 at 3:32











          • In general, I wouldn't split any table by company. Depending on the logic of your application it might make sense to have a table User and a table Employee separated, you should think if all Employees have one (and just one) user or might have different credentials for different things.

            – Mikel
            Aug 2 '16 at 3:38










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38711213%2fneed-help-in-designing-a-database-schema-for-a-saas-application%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          I don't recommend this approach, I think you should either:



          A) Put all the information in the same tables and have a companyId column to sort them out



          OR



          B) Have separate databases for each company and use the appropriate database using the code.



          The thing is, with your approach, you'll have a hard time maintaining your application if you have multiple copies of the same table with different names. If you decide to add a column to one of the tables, for instance, you will have to write as many SQL scripts as you have table instances. You'll also have a bad time with all of your unique identifiers.



          Here are some advantages/disadvantages of each design:



          A) Put all the information in the same tables and have a compagnyId column to sort them out



          Advantages:



          • Simplest

          • Allow usage of foreign key / constraints

          • Great for cross / client data extraction

          Disadvantages:



          • Not portable (a client can't just leave with his/her data)

          • Can be perceived as less secure (I guess you can make the case both ways)

          • More likely to have huge tables

          • Does not scale very well

          B) Have separate databases for each company and use the appropriate database using the code.



          Advantages:



          • Portable

          • Can be perceived as more secure

          Disadvantages:



          • Needs more discipline to keep track of all the databases

          • Needs a good segregation of what's part of your HUB (Your application that tracks which client access which database) and that's part of your client's database.

          • You need a login page by company (or have your clients specify the company in a field)

          An example of an application that uses this "two-step login" is Slack, when you sign-in you first enter your team domain THEN your user credentials.



          I think Google Apps for Work as the same approach. Also, I think most CRM I worked with has a separate database for their clients.



          Lastly, I'd like to direct you to this other question on stackoverflow that links to an interesting example.






          share|improve this answer

























          • So I was originally going with plan B. I am planning to host the node.js app on Heroku and assign custom domain based on the company name. Since we can connect a GitHub repository to a Heroku app, I will be creating a new repository for each client.

            – codeinprogress
            Aug 2 '16 at 15:33











          • You'll probably want to look into automating creation of new clients in your system. The more I think about it the more Plan B fits this kind of project.

            – mgadrat
            Aug 2 '16 at 22:06











          • Yeah, me too. The thing is, with plan B the database cost is distributed among my clients + their data is separated from each other using separate tables for each client.

            – codeinprogress
            Aug 14 '16 at 4:16















          2














          I don't recommend this approach, I think you should either:



          A) Put all the information in the same tables and have a companyId column to sort them out



          OR



          B) Have separate databases for each company and use the appropriate database using the code.



          The thing is, with your approach, you'll have a hard time maintaining your application if you have multiple copies of the same table with different names. If you decide to add a column to one of the tables, for instance, you will have to write as many SQL scripts as you have table instances. You'll also have a bad time with all of your unique identifiers.



          Here are some advantages/disadvantages of each design:



          A) Put all the information in the same tables and have a compagnyId column to sort them out



          Advantages:



          • Simplest

          • Allow usage of foreign key / constraints

          • Great for cross / client data extraction

          Disadvantages:



          • Not portable (a client can't just leave with his/her data)

          • Can be perceived as less secure (I guess you can make the case both ways)

          • More likely to have huge tables

          • Does not scale very well

          B) Have separate databases for each company and use the appropriate database using the code.



          Advantages:



          • Portable

          • Can be perceived as more secure

          Disadvantages:



          • Needs more discipline to keep track of all the databases

          • Needs a good segregation of what's part of your HUB (Your application that tracks which client access which database) and that's part of your client's database.

          • You need a login page by company (or have your clients specify the company in a field)

          An example of an application that uses this "two-step login" is Slack, when you sign-in you first enter your team domain THEN your user credentials.



          I think Google Apps for Work as the same approach. Also, I think most CRM I worked with has a separate database for their clients.



          Lastly, I'd like to direct you to this other question on stackoverflow that links to an interesting example.






          share|improve this answer

























          • So I was originally going with plan B. I am planning to host the node.js app on Heroku and assign custom domain based on the company name. Since we can connect a GitHub repository to a Heroku app, I will be creating a new repository for each client.

            – codeinprogress
            Aug 2 '16 at 15:33











          • You'll probably want to look into automating creation of new clients in your system. The more I think about it the more Plan B fits this kind of project.

            – mgadrat
            Aug 2 '16 at 22:06











          • Yeah, me too. The thing is, with plan B the database cost is distributed among my clients + their data is separated from each other using separate tables for each client.

            – codeinprogress
            Aug 14 '16 at 4:16













          2












          2








          2







          I don't recommend this approach, I think you should either:



          A) Put all the information in the same tables and have a companyId column to sort them out



          OR



          B) Have separate databases for each company and use the appropriate database using the code.



          The thing is, with your approach, you'll have a hard time maintaining your application if you have multiple copies of the same table with different names. If you decide to add a column to one of the tables, for instance, you will have to write as many SQL scripts as you have table instances. You'll also have a bad time with all of your unique identifiers.



          Here are some advantages/disadvantages of each design:



          A) Put all the information in the same tables and have a compagnyId column to sort them out



          Advantages:



          • Simplest

          • Allow usage of foreign key / constraints

          • Great for cross / client data extraction

          Disadvantages:



          • Not portable (a client can't just leave with his/her data)

          • Can be perceived as less secure (I guess you can make the case both ways)

          • More likely to have huge tables

          • Does not scale very well

          B) Have separate databases for each company and use the appropriate database using the code.



          Advantages:



          • Portable

          • Can be perceived as more secure

          Disadvantages:



          • Needs more discipline to keep track of all the databases

          • Needs a good segregation of what's part of your HUB (Your application that tracks which client access which database) and that's part of your client's database.

          • You need a login page by company (or have your clients specify the company in a field)

          An example of an application that uses this "two-step login" is Slack, when you sign-in you first enter your team domain THEN your user credentials.



          I think Google Apps for Work as the same approach. Also, I think most CRM I worked with has a separate database for their clients.



          Lastly, I'd like to direct you to this other question on stackoverflow that links to an interesting example.






          share|improve this answer















          I don't recommend this approach, I think you should either:



          A) Put all the information in the same tables and have a companyId column to sort them out



          OR



          B) Have separate databases for each company and use the appropriate database using the code.



          The thing is, with your approach, you'll have a hard time maintaining your application if you have multiple copies of the same table with different names. If you decide to add a column to one of the tables, for instance, you will have to write as many SQL scripts as you have table instances. You'll also have a bad time with all of your unique identifiers.



          Here are some advantages/disadvantages of each design:



          A) Put all the information in the same tables and have a compagnyId column to sort them out



          Advantages:



          • Simplest

          • Allow usage of foreign key / constraints

          • Great for cross / client data extraction

          Disadvantages:



          • Not portable (a client can't just leave with his/her data)

          • Can be perceived as less secure (I guess you can make the case both ways)

          • More likely to have huge tables

          • Does not scale very well

          B) Have separate databases for each company and use the appropriate database using the code.



          Advantages:



          • Portable

          • Can be perceived as more secure

          Disadvantages:



          • Needs more discipline to keep track of all the databases

          • Needs a good segregation of what's part of your HUB (Your application that tracks which client access which database) and that's part of your client's database.

          • You need a login page by company (or have your clients specify the company in a field)

          An example of an application that uses this "two-step login" is Slack, when you sign-in you first enter your team domain THEN your user credentials.



          I think Google Apps for Work as the same approach. Also, I think most CRM I worked with has a separate database for their clients.



          Lastly, I'd like to direct you to this other question on stackoverflow that links to an interesting example.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 13 '18 at 10:17









          Coder Absolute

          1,1311322




          1,1311322










          answered Aug 2 '16 at 3:42









          mgadratmgadrat

          13415




          13415












          • So I was originally going with plan B. I am planning to host the node.js app on Heroku and assign custom domain based on the company name. Since we can connect a GitHub repository to a Heroku app, I will be creating a new repository for each client.

            – codeinprogress
            Aug 2 '16 at 15:33











          • You'll probably want to look into automating creation of new clients in your system. The more I think about it the more Plan B fits this kind of project.

            – mgadrat
            Aug 2 '16 at 22:06











          • Yeah, me too. The thing is, with plan B the database cost is distributed among my clients + their data is separated from each other using separate tables for each client.

            – codeinprogress
            Aug 14 '16 at 4:16

















          • So I was originally going with plan B. I am planning to host the node.js app on Heroku and assign custom domain based on the company name. Since we can connect a GitHub repository to a Heroku app, I will be creating a new repository for each client.

            – codeinprogress
            Aug 2 '16 at 15:33











          • You'll probably want to look into automating creation of new clients in your system. The more I think about it the more Plan B fits this kind of project.

            – mgadrat
            Aug 2 '16 at 22:06











          • Yeah, me too. The thing is, with plan B the database cost is distributed among my clients + their data is separated from each other using separate tables for each client.

            – codeinprogress
            Aug 14 '16 at 4:16
















          So I was originally going with plan B. I am planning to host the node.js app on Heroku and assign custom domain based on the company name. Since we can connect a GitHub repository to a Heroku app, I will be creating a new repository for each client.

          – codeinprogress
          Aug 2 '16 at 15:33





          So I was originally going with plan B. I am planning to host the node.js app on Heroku and assign custom domain based on the company name. Since we can connect a GitHub repository to a Heroku app, I will be creating a new repository for each client.

          – codeinprogress
          Aug 2 '16 at 15:33













          You'll probably want to look into automating creation of new clients in your system. The more I think about it the more Plan B fits this kind of project.

          – mgadrat
          Aug 2 '16 at 22:06





          You'll probably want to look into automating creation of new clients in your system. The more I think about it the more Plan B fits this kind of project.

          – mgadrat
          Aug 2 '16 at 22:06













          Yeah, me too. The thing is, with plan B the database cost is distributed among my clients + their data is separated from each other using separate tables for each client.

          – codeinprogress
          Aug 14 '16 at 4:16





          Yeah, me too. The thing is, with plan B the database cost is distributed among my clients + their data is separated from each other using separate tables for each client.

          – codeinprogress
          Aug 14 '16 at 4:16













          0














          You shouldn't split your tables just because companies won't share their information. Instead, you should have a companyId column in each table and access to the relevant data for each query. This should be implemented in your backend






          share|improve this answer























          • So every time I do a query to get anything from any table, there will be a second condition that says "and CompanyId = whatever "

            – codeinprogress
            Aug 2 '16 at 3:26











          • You will need to know the company anyway if you have splitted tables, right?

            – Mikel
            Aug 2 '16 at 3:29











          • Yes, that is true. So do I keep a universal users table which has the companyId and then an Employees table which has just the employee info? Or do I just merge them together?

            – codeinprogress
            Aug 2 '16 at 3:32











          • In general, I wouldn't split any table by company. Depending on the logic of your application it might make sense to have a table User and a table Employee separated, you should think if all Employees have one (and just one) user or might have different credentials for different things.

            – Mikel
            Aug 2 '16 at 3:38















          0














          You shouldn't split your tables just because companies won't share their information. Instead, you should have a companyId column in each table and access to the relevant data for each query. This should be implemented in your backend






          share|improve this answer























          • So every time I do a query to get anything from any table, there will be a second condition that says "and CompanyId = whatever "

            – codeinprogress
            Aug 2 '16 at 3:26











          • You will need to know the company anyway if you have splitted tables, right?

            – Mikel
            Aug 2 '16 at 3:29











          • Yes, that is true. So do I keep a universal users table which has the companyId and then an Employees table which has just the employee info? Or do I just merge them together?

            – codeinprogress
            Aug 2 '16 at 3:32











          • In general, I wouldn't split any table by company. Depending on the logic of your application it might make sense to have a table User and a table Employee separated, you should think if all Employees have one (and just one) user or might have different credentials for different things.

            – Mikel
            Aug 2 '16 at 3:38













          0












          0








          0







          You shouldn't split your tables just because companies won't share their information. Instead, you should have a companyId column in each table and access to the relevant data for each query. This should be implemented in your backend






          share|improve this answer













          You shouldn't split your tables just because companies won't share their information. Instead, you should have a companyId column in each table and access to the relevant data for each query. This should be implemented in your backend







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Aug 2 '16 at 3:22









          MikelMikel

          2,62611227




          2,62611227












          • So every time I do a query to get anything from any table, there will be a second condition that says "and CompanyId = whatever "

            – codeinprogress
            Aug 2 '16 at 3:26











          • You will need to know the company anyway if you have splitted tables, right?

            – Mikel
            Aug 2 '16 at 3:29











          • Yes, that is true. So do I keep a universal users table which has the companyId and then an Employees table which has just the employee info? Or do I just merge them together?

            – codeinprogress
            Aug 2 '16 at 3:32











          • In general, I wouldn't split any table by company. Depending on the logic of your application it might make sense to have a table User and a table Employee separated, you should think if all Employees have one (and just one) user or might have different credentials for different things.

            – Mikel
            Aug 2 '16 at 3:38

















          • So every time I do a query to get anything from any table, there will be a second condition that says "and CompanyId = whatever "

            – codeinprogress
            Aug 2 '16 at 3:26











          • You will need to know the company anyway if you have splitted tables, right?

            – Mikel
            Aug 2 '16 at 3:29











          • Yes, that is true. So do I keep a universal users table which has the companyId and then an Employees table which has just the employee info? Or do I just merge them together?

            – codeinprogress
            Aug 2 '16 at 3:32











          • In general, I wouldn't split any table by company. Depending on the logic of your application it might make sense to have a table User and a table Employee separated, you should think if all Employees have one (and just one) user or might have different credentials for different things.

            – Mikel
            Aug 2 '16 at 3:38
















          So every time I do a query to get anything from any table, there will be a second condition that says "and CompanyId = whatever "

          – codeinprogress
          Aug 2 '16 at 3:26





          So every time I do a query to get anything from any table, there will be a second condition that says "and CompanyId = whatever "

          – codeinprogress
          Aug 2 '16 at 3:26













          You will need to know the company anyway if you have splitted tables, right?

          – Mikel
          Aug 2 '16 at 3:29





          You will need to know the company anyway if you have splitted tables, right?

          – Mikel
          Aug 2 '16 at 3:29













          Yes, that is true. So do I keep a universal users table which has the companyId and then an Employees table which has just the employee info? Or do I just merge them together?

          – codeinprogress
          Aug 2 '16 at 3:32





          Yes, that is true. So do I keep a universal users table which has the companyId and then an Employees table which has just the employee info? Or do I just merge them together?

          – codeinprogress
          Aug 2 '16 at 3:32













          In general, I wouldn't split any table by company. Depending on the logic of your application it might make sense to have a table User and a table Employee separated, you should think if all Employees have one (and just one) user or might have different credentials for different things.

          – Mikel
          Aug 2 '16 at 3:38





          In general, I wouldn't split any table by company. Depending on the logic of your application it might make sense to have a table User and a table Employee separated, you should think if all Employees have one (and just one) user or might have different credentials for different things.

          – Mikel
          Aug 2 '16 at 3:38

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f38711213%2fneed-help-in-designing-a-database-schema-for-a-saas-application%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          What does pagestruct do in Eviews?

          Dutch intervention in Lombok and Karangasem

          Channel Islands