Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 30, 2012 01:41 PM by Dan Bracuk
Mar 27, 2012 08:22 AM|LINK
I am creating a application with a single database.
1. Multiple stores can use the application & register there clients for billing/subscription. Client e-mailID is used as user name and client can also login in to the system.
When the same client goes to a different store in the system, the store owner tries to register him with his e-mail address but this e-mail is already registered into the system with by the other store so registration is not possible with this e-mail address.
Mar 27, 2012 08:31 AM|LINK
I would suggest delink useraccount from store account & include a entity relation table with userid and storeid. When user reregisters just add the user to the other store too.
Mar 27, 2012 08:36 AM|LINK
but when user logs in to the system he will log in from the store1 website or store 2 webiste
so which store data to show him will be a problem.
User doesn't know both the store use the same software when he comes to store1 website and logs in he should see store 1 data only.
Though links can vary but the end system is the same
Mar 27, 2012 10:52 AM|LINK
Yes, you are correct. You have a few options:
Create a new database for each store - This is the most advisable option, but it will need more time in creating new database for each store and maintaining them. Also if you are planning to use data from all the sites, it will become very tough.
Second option is seperate userinfo from storeinfo & permit for duplication where the customer will have multiple accounts, but only one account per store. This is useful when it comes to customer not knowing the backend system.
But I think seperating userinfo and storeinfo will be very useful in the long run.
You can authenticate the customer based on userid, password & the storeid.
Mar 27, 2012 11:45 AM|LINK
Creating a new database for every store seems more cumbersome kind and i need to figure out a way to automate it. but is this option a better option in long learn? Do most of the enterprise application do this? Have you used Intuit QuickBook online are such
apps created on multiple database or single?
Now the second option. I am using asp.net security class for authencation by default i am making user e-mail as username and username is unique in the database, so if the same user tries to register with different store, how do i create duplicate username?
does security class allow that? during authentication i take care to map the username to store but how do i have the same username for different stores?
Mar 27, 2012 12:25 PM|LINK
Create GUID for the all store web sites and pass GUID from the website to database.Like as Below:
1. Site A GUID1
2.Site B Guid2
3 so on
Every method in BLC will contain a parameter ApplicationID equiavalent to GUID.When you hit DB you can hit the only data which is related to this GUID.
there will be Many to many relationship exists b/w user and store table then create a asscication table to maintain this relation.
Please let me know in case of more help
Mar 27, 2012 12:32 PM|LINK
Yes, new database is a difficult task, primarily if you are having to change queries etc in the code or fields in the database. Over a period of time it will require dedicated people to manage the database. but it is the best solution both in terms of security
If you want to go ahead with the multi-tenant model then, It is advisable to have a different unique id instead of emailid.
But if you don't have the option of changing the username, include the storeid also in your query & permit duplicate usernames. So if a username, password & storeid matches, then accept login.
Mar 27, 2012 12:34 PM|LINK
Mar 27, 2012 12:42 PM|LINK
Mar 27, 2012 02:10 PM|LINK
Why can't each login be unique and then have a lookup with a 1:many relationship for store IDs? This would also be how you could maintain a single database and still span multiple stores and users. I am assuming the database is centerally located and not
some local database with replicated updates or anything to and from each store.