1

I am building a website for big companies,the website will look the same,but the company "A" have sensitive data and they want to keep database at they place(server),the company "B" don't have any sensitive data sow they don't have a problem to keep database at my website server.How can i (if it possible) to use database company "A" if user if type "A" is logged in,and if it is user type"B" use another database.I need to change the connection string for each type of user,because each one of users-type(company) want to have they own database in place they think it safe.

I am currently checking the MVC/6 and Asp.Net5 for this decision.

Which approach is best?

Thanks in advance!

3
  • 1
    just redirect user two correct site, one site for each i think :), but take note on the cost and resources Commented Sep 21, 2015 at 7:38
  • I am not sure that I understand what is the issue - can you just make a connection to a remote database that is live on an other machine ? Commented Sep 21, 2015 at 7:40
  • One way can be to use a "security" database to store connection string of main database. Each user can have access to one (or more) data source Commented Sep 21, 2015 at 7:45

1 Answer 1

1

There can be several ways to achieve this. One way is to use a "security" database which would contain two data tables. One table would contain connection string of main database. The second table would contain user credentials along with data source the user have access to..

enter image description here

When a user logs in, the program can get the corresponding connection string and based on it login to the correct data source.

One user can also have, if you want, access to multiple data source. Once the user logs in he can be redirected to a screen to select the database he wants to login into.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.